Hi everyone,

I've setup some sanitizer builds on my project and I'd like to have two
separate builds for asan and lsan, meaning I want to disable leak detection
in the asan build.
I've managed to correctly setup the CTEST_MEMORYCHECK_SANITIZER_OPTIONS
with "detect_leaks=0" and at runtime (ctest_memcheck) the ASAN_OPTIONS is
populated with my custom value.

The issue is that CMake appends its own "detect_leak=1" (while
"log_file=..." is prepended). It overrides my own option which has then no
effect.

I see two possible fixes here:
1- Since "detect_leaks=1" is the default, we can simply not append it to
the options and make sure the user options are last
2- If we still want to explicitly set "detect_leaks=1", I'd suggest to
prepend it, like "log_file=", to the user options so that anyone can
override them if need be

The related code seems to be at:
25d7b883 : Source/CTest/cmCTestMemCheckHandler.cxx:600

If my analysis is correct I can make a MR. Which fixes would you prefer?

Regards,
Sylvain
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to