cmake/compile_flag.cmake

12 lines
427 B
CMake
Raw Normal View History

2017-01-17 19:20:12 +11:00
macro (append_compile_flag _flag)
string (MAKE_C_IDENTIFIER ${_flag} _name)
if (NOT __append_compile_flag_${_name})
check_cxx_compiler_flag (${_flag} __append_compile_flag_${_name})
if (__append_compile_flag_${_name})
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}")
set (__append_compile_flag_${_name} 1 INTERNAL)
endif ()
endif ()
endmacro(append_compile_flag)