From 879fe74e2a18b7b89d35cf1fc0fb8829a1b70b3d Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Thu, 29 Feb 2024 02:29:14 +0100 Subject: 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. --- bin/salis.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'bin') 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) -- cgit v1.2.1