Created
November 19, 2017 16:04
-
-
Save robertodr/b16848f117d4c4dfe6807cad25ace8c0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include(CheckCXXCompilerFlag) | |
list(APPEND ASAN_FLAGS "-fsanitize=address" "-fno-omit-frame-pointer") | |
foreach(flag IN LISTS ASAN_FLAGS) | |
set(CMAKE_REQUIRED_FLAGS ${flag}) | |
check_cxx_compiler_flag(${flag} flag_works) | |
unset(CMAKE_REQUIRED_FLAGS) | |
if(flag_works) | |
string(REPLACE " " ";" _flag ${flag}) | |
list(APPEND _asan_flags ${_flag}) | |
endif() | |
unset(flag_works CACHE) | |
endforeach() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@bast primitive version of a compiler flag manager in CMake. More to come.