aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2024-02-29 02:29:14 +0100
committerPaul Oliver <contact@pauloliver.dev>2024-02-29 02:29:14 +0100
commit879fe74e2a18b7b89d35cf1fc0fb8829a1b70b3d (patch)
treef80e34fed55cc2b7c8f5fc5f59d6cc4a8245a617 /bin
parent8af4b246d86df7bc906841689912534ea450cce5 (diff)
Simultaneous Debug and Release builds.
[#29] Makefile now generates both release and debug builds on every run. Salis.py can load the debug version on demand via a command line argument (--debug). Release version is loaded by default.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/salis.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/bin/salis.py b/bin/salis.py
index eef4263..dc86d1d 100755
--- a/bin/salis.py
+++ b/bin/salis.py
@@ -191,6 +191,10 @@ class Salis:
"-v", "--version", action="version",
version="Salis: A-Life Simulator (" + __version__ + ")"
)
+ parser.add_argument(
+ "-d", "--debug", action="store_true",
+ help="Run debug build of Salis library"
+ )
# Initialize the 'new/load' action subparsers.
subparsers = parser.add_subparsers(
@@ -266,7 +270,13 @@ class Salis:
Note to developers: the 'SALIS_API' keyword should *NOT* be used
anywhere else in the header files (not even in comments)!
"""
- lib = CDLL(os.path.join(self.path, "lib/libsalis.so"))
+ # Load debug or release versions of Salis into a CDLL object.
+ if self.args.debug:
+ suff = "-deb"
+ else:
+ suff = "-rel"
+
+ lib = CDLL(os.path.join(self.path, "lib/libsalis{}.so".format(suff)))
include_dir = os.path.join(self.path, "../include")
c_includes = [
os.path.join(include_dir, f)