You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
336 B
14 lines
336 B
include(CheckCCompilerFlag)
|
|
|
|
macro(add_compiler_flags)
|
|
foreach(flag ${ARGN})
|
|
string(REGEX REPLACE "[-.+/:= ]" "_" _flag_esc "${flag}")
|
|
|
|
check_c_compiler_flag("${flag}" check_c_compiler_flag_${_flag_esc})
|
|
|
|
if (check_c_compiler_flag_${_flag_esc})
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
|
|
endif()
|
|
endforeach()
|
|
endmacro()
|