diff --git a/docs/build.rst b/docs/build.rst index 01ddd32f0..0b27ef4d2 100644 --- a/docs/build.rst +++ b/docs/build.rst @@ -168,9 +168,7 @@ Build with Debug To use debug information in PySCIPOpt you need to build it with the following command: .. code-block:: - - export CFLAGS="-UNDEBUG" - export CXXFLAGS="-UNDEBUG" + export PYSCIPOPT_DEBUG=True # With Windows CMD: set PYSCIPOPT_DEBUG=True python -m pip install . .. note:: Be aware that you will need the debug library of the SCIP Optimization Suite for this to work diff --git a/setup.py b/setup.py index abebcc5d4..b9f9f1991 100644 --- a/setup.py +++ b/setup.py @@ -62,9 +62,8 @@ extra_link_args.append(f"-Wl,-rpath,{libdir}") # enable debug mode if requested -if "--debug" in sys.argv: +if os.environ.get("PYSCIPOPT_DEBUG")=="True": extra_compile_args.append("-UNDEBUG") - sys.argv.remove("--debug") use_cython = True diff --git a/tests/test_vars.py b/tests/test_vars.py index 75629752a..7021c4b81 100644 --- a/tests/test_vars.py +++ b/tests/test_vars.py @@ -79,4 +79,4 @@ def test_markRelaxationOnly(): assert x.isRelaxationOnly() assert x.isDeletable() assert not y.isRelaxationOnly() - assert not y.isDeletable() \ No newline at end of file + assert not y.isDeletable()