diff options
author | Rolf Eike Beer <eike@sf-mail.de> | 2017-02-02 17:28:24 (GMT) |
---|---|---|
committer | Rolf Eike Beer <eike@sf-mail.de> | 2017-02-02 17:28:56 (GMT) |
commit | 940bf6a4a427c8edfd975bf078a3ea331847f72a (patch) | |
tree | 8c63512bb94994d40d894862012b68e0cb5acbf5 | |
parent | f26ca5a1953e7f260bc23d30c5d35cc071a6f6ab (diff) | |
download | CMake-940bf6a4a427c8edfd975bf078a3ea331847f72a.zip CMake-940bf6a4a427c8edfd975bf078a3ea331847f72a.tar.gz CMake-940bf6a4a427c8edfd975bf078a3ea331847f72a.tar.bz2 |
Tests/Module/WCDH: only use -Werror=undef compiler flag if actually supported
-rw-r--r-- | Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index a8406dd..2657aeb 100644 --- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt +++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt @@ -68,7 +68,11 @@ if (CMAKE_C_COMPILE_FEATURES) add_executable(C_undefined c_undefined.c) set_property(TARGET C_undefined PROPERTY C_STANDARD 90) - target_compile_options(C_undefined PRIVATE -Werror=undef) + include(CheckCCompilerFlag) + check_c_compiler_flag(-Werror=undef use_error_undef) + if (use_error_undef) + target_compile_options(C_undefined PRIVATE -Werror=undef) + endif() add_executable(WriteCompilerDetectionHeader_C main.c) set_property(TARGET WriteCompilerDetectionHeader_C PROPERTY C_STANDARD 90) |