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

Eric Noulard eric.noulard at gmail.com
Fri Oct 25 06:50:38 EDT 2019


Le jeu. 24 oct. 2019 à 22:32, Turner, Adrian Keith via CMake <
cmake at 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 compiler which supports this flag but the CHECK_CXX_COMPILER_FLAG
> directive incorrectly determines that this flag is not supported.
>

You get appropriate answers to your initial question.

I'll add an alternative to your hand-crafted way to get sanitizers working.

I'm using: https://github.com/arsenm/sanitizers-cmake
and I find it easy to use and convenient when compiling with either clang
or gcc.


-- 
Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20191025/9653cad0/attachment-0001.html>


More information about the CMake mailing list