2017-01-17 21:25:31 +11:00
|
|
|
include(CheckCXXCompilerFlag)
|
|
|
|
|
2017-01-17 19:20:12 +11:00
|
|
|
macro (append_compile_flag _flag)
|
|
|
|
string (MAKE_C_IDENTIFIER ${_flag} _name)
|
|
|
|
|
2017-01-18 21:43:30 +11:00
|
|
|
if (NOT DEFINED compile_flag_${_name})
|
|
|
|
check_cxx_compiler_flag (${_flag} compile_flag_${_name})
|
2017-01-17 19:20:12 +11:00
|
|
|
endif ()
|
2017-01-18 21:43:30 +11:00
|
|
|
|
|
|
|
if (compile_flag_${_name})
|
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}")
|
|
|
|
endif()
|
2017-01-17 19:20:12 +11:00
|
|
|
endmacro(append_compile_flag)
|