diff options
author | Jakub Hrozek <jakub.hrozek@gmail.com> | 2014-07-29 10:22:31 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2014-08-07 13:35:09 +0200 |
commit | 815ad9613f63983284bb86fdd6f27791ac871a86 (patch) | |
tree | 973401eddfc6b36859135f84f02f3f947148522c | |
parent | 2487f7ad732b7f62605b14a1d9520ff68cb17054 (diff) | |
download | cmocka-815ad9613f63983284bb86fdd6f27791ac871a86.tar.gz cmocka-815ad9613f63983284bb86fdd6f27791ac871a86.tar.bz2 cmocka-815ad9613f63983284bb86fdd6f27791ac871a86.zip |
GNU_SOURCE is not a compiler flag
This line in DefineCompilerFlags.cmake always passed:
check_c_compiler_flag("-D_GNU_SOURCE" WITH_GNU_SOURCE)
because -D$string just defined a preprocessor macro, so the compilation
would always succeed.
On UNIX platforms, with GCC or LLVM compilers, we want to always use
GNU_SOURCE.
-rw-r--r-- | cmake/Modules/DefineCompilerFlags.cmake | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/cmake/Modules/DefineCompilerFlags.cmake b/cmake/Modules/DefineCompilerFlags.cmake index 4fb0aed..14d473f 100644 --- a/cmake/Modules/DefineCompilerFlags.cmake +++ b/cmake/Modules/DefineCompilerFlags.cmake @@ -36,10 +36,7 @@ if (UNIX AND NOT WIN32) endif() endif() - check_c_compiler_flag("-D_GNU_SOURCE" WITH_GNU_SOURCE) - if (WITH_GNU_SOURCE) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE") - endif (WITH_GNU_SOURCE) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE") endif (${CMAKE_C_COMPILER_ID} MATCHES "(GNU|Clang)") # |