diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-08-02 15:43:36 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-08-02 22:44:00 +0000 |
commit | e2969cbb3cc533ad0214e3d2d86d9543930c1528 (patch) | |
tree | 32e74b2530736e14afb05786e12dc409d94057d1 /CMakeLists.txt | |
parent | 81f5d71ff38f88c3d73664291853d34d8cf1f980 (diff) |
When testing compiler flags, test them with previously-tested flags.
That mirrors what we're doing with autotools, and catches cases where
an earlier-tested flag affects the results for a later-tested flag
(e.g., -fwrapv can affect whether -fno-strict-overflow produces a
warning when tested).
Change-Id: I8ca0b6f5dee14d2394af9b6b8b93b9dbda2702d7
Reviewed-on: https://code.wireshark.org/review/3369
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f962454c7b..b603c3a56f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -349,7 +349,7 @@ foreach(THIS_FLAG ${C_FLAG_TESTS}) set(${F} ${THIS_FLAG}) set(V C_${F}_VALID) message(STATUS "Checking for c-compiler flag: ${THIS_FLAG}") - check_c_compiler_flag(${${F}} ${V}) + check_c_compiler_flag("${ADDED_CMAKE_C_FLAGS} ${${F}}" ${V}) if (${${V}}) set(ADDED_CMAKE_C_FLAGS "${ADDED_CMAKE_C_FLAGS} ${${F}}") endif() @@ -361,7 +361,7 @@ foreach(THIS_FLAG ${CPP_FLAG_TESTS}) set(${F} ${THIS_FLAG}) set(V CPP_${F}_VALID) message(STATUS "Checking for c++-compiler flag: ${THIS_FLAG}") - check_cxx_compiler_flag(${${F}} ${V}) + check_cxx_compiler_flag("${ADDED_CMAKE_CXX_FLAGS} ${${F}}" ${V}) if (${${V}}) set(ADDED_CMAKE_CXX_FLAGS "${ADDED_CMAKE_CXX_FLAGS} ${${F}}") endif() |