diff --git a/python/sdist/amici/setup.template.py b/python/sdist/amici/setup.template.py index 80fd3fde2a..c2ce7d5c20 100644 --- a/python/sdist/amici/setup.template.py +++ b/python/sdist/amici/setup.template.py @@ -24,6 +24,8 @@ def get_extension() -> CMakeExtension: else: os.environ["CMAKE_BUILD_PARALLEL_LEVEL"] = "1" + debug_build = os.getenv("AMICI_DEBUG", "").lower() in ["1", "true"] + return CMakeExtension( name="model_ext", source_dir=os.getcwd(), @@ -37,6 +39,7 @@ def get_extension() -> CMakeExtension: "-DAMICI_PYTHON_BUILD_EXT_ONLY=ON", f"-DPython3_EXECUTABLE={Path(sys.executable).as_posix()}", ], + cmake_build_type="Debug" if debug_build else "Release", ) diff --git a/python/sdist/setup.py b/python/sdist/setup.py index 83bf33237a..a29861ac75 100755 --- a/python/sdist/setup.py +++ b/python/sdist/setup.py @@ -141,6 +141,7 @@ def get_extensions(): ], ) # AMICI + debug_build = os.getenv("AMICI_DEBUG", "").lower() in ["1", "true"] amici_ext = CMakeExtension( name="amici", install_prefix="amici", @@ -153,6 +154,7 @@ def get_extensions(): "-DAMICI_PYTHON_BUILD_EXT_ONLY=ON", f"-DPython3_EXECUTABLE={Path(sys.executable).as_posix()}", ], + cmake_build_type="Debug" if debug_build else "Release", ) # Order matters! return [suitesparse_config, amd, btf, colamd, klu, sundials, amici_ext]