Re: [CMake] CHECK_CXX_COMPILER_FLAG doesn't give correct result for -fsanitize=address

2019-10-25 Thread Eric Noulard
Le jeu. 24 oct. 2019 à 22:32, Turner, Adrian Keith via CMake < cmake@cmake.org> a écrit : > Hi CMake Mailing List, > > > I am using the CHECK_CXX_COMPILER_FLAG directive in a CMake file to > detect whether the compiler uses the "-fsanitize=address" compiler flag. > I'm using the g++ 7.3.0

Re: [CMake] CHECK_CXX_COMPILER_FLAG doesn't give correct result for -fsanitize=address

2019-10-25 Thread Marc CHEVRIER
This is the expected behaviour. As you already discovered, it is possible to control the compilation and link steps with variables as described in  https://cmake.org/cmake/help/latest/module/CheckCXXSourceCompiles.html#module:CheckCXXSourceCompiles. To specify, in a more clean way, link

Re: [CMake] CHECK_CXX_COMPILER_FLAG doesn't give correct result for -fsanitize=address

2019-10-24 Thread Michael Ellery
I’ve dealt with that using something like this: set (_saved_CRL ${CMAKE_REQUIRED_LIBRARIES}) set (CMAKE_REQUIRED_LIBRARIES “-fsanitize=address;asan") check_cxx_compiler_flag (-fsanitize=address COMPILER_SUPPORTS_SAN) set (CMAKE_REQUIRED_LIBRARIES ${_saved_CRL}) the second item in

[CMake] CHECK_CXX_COMPILER_FLAG doesn't give correct result for -fsanitize=address

2019-10-24 Thread Turner, Adrian Keith via CMake
Hi CMake Mailing List, I am using the CHECK_CXX_COMPILER_FLAG directive in a CMake file to detect whether the compiler uses the "-fsanitize=address" compiler flag. I'm using the g++ 7.3.0 compiler which supports this flag but the CHECK_CXX_COMPILER_FLAG directive incorrectly determines that