forked from osmocom/wireshark
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>
This commit is contained in:
parent
81f5d71ff3
commit
e2969cbb3c
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue