0

I have one build script per each environment (debug, release, relwithdebuginfo etc).

Each script calls CMake with the relevant build environment set:

cmake -DCMAKE_BUILD_TYPE=Debug -DARG_FORCE_CLANG=True

a flag inside the CMakeLists.txt file controls the sanitize flag. However, I would like to control this from a new sanitize build script, something like:

cmake -DCMAKE_BUILD_TYPE=Debug -DARG_FORCE_CLANG=True -SANITIZE=true

Is there any way to achieve this?

10
  • Does this answer work for you? stackoverflow.com/a/55911219/461597 Commented Mar 31, 2020 at 17:18
  • @Unapiedra That's awesome. Only problem is how do I control whether I want my sanitize to be debug, release or relwithdebuginfo? Commented Mar 31, 2020 at 17:24
  • "ASAN" doesn't seem to be documented here: cmake.org/cmake/help/v3.17/variable/CMAKE_BUILD_TYPE.html Commented Mar 31, 2020 at 17:34
  • Question: Why do you want to run a sanitizer on Debug? That's not recommended. What do you gain by running all these configurations? Commented Mar 31, 2020 at 17:35
  • Sorry, I don't want to dismiss your use case. Could you explain your use case for me, please? Commented Mar 31, 2020 at 17:36

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.