compile_flag: restore CMAKE_REQUIRED_FLAGS
This commit is contained in:
parent
878a1f118f
commit
26319b51a1
@ -21,6 +21,8 @@ macro (append_compile_flag _flag)
|
|||||||
# you use the negation.
|
# you use the negation.
|
||||||
string (REGEX MATCH "^-Wno-(.+)$" compile_flag_inverse ${_flag})
|
string (REGEX MATCH "^-Wno-(.+)$" compile_flag_inverse ${_flag})
|
||||||
|
|
||||||
|
set(_append_compile_flag_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
|
||||||
|
|
||||||
if ("x" STREQUAL "x${compile_flag_inverse}")
|
if ("x" STREQUAL "x${compile_flag_inverse}")
|
||||||
set(CMAKE_REQUIRED_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}")
|
set(CMAKE_REQUIRED_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}")
|
||||||
else ()
|
else ()
|
||||||
@ -29,6 +31,7 @@ macro (append_compile_flag _flag)
|
|||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
check_cxx_source_compiles("int main(int,char**) { return 0; }" compile_flag_${_name})
|
check_cxx_source_compiles("int main(int,char**) { return 0; }" compile_flag_${_name})
|
||||||
|
set(CMAKE_REQUIRED_FLAGS "${_append_compile_flag_REQUIRED_FLAGS}")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (compile_flag_${_name})
|
if (compile_flag_${_name})
|
||||||
|
Loading…
Reference in New Issue
Block a user