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
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
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
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