1*b50261e2SCy Schubertinclude(CheckCCompilerFlag) 2*b50261e2SCy Schubert 3*b50261e2SCy Schubertmacro(add_compiler_flags) 4*b50261e2SCy Schubert foreach(flag ${ARGN}) 5*b50261e2SCy Schubert string(REGEX REPLACE "[-.+/:= ]" "_" _flag_esc "${flag}") 6*b50261e2SCy Schubert 7*b50261e2SCy Schubert check_c_compiler_flag("${flag}" check_c_compiler_flag_${_flag_esc}) 8*b50261e2SCy Schubert 9*b50261e2SCy Schubert if (check_c_compiler_flag_${_flag_esc}) 10*b50261e2SCy Schubert set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}") 11*b50261e2SCy Schubert endif() 12*b50261e2SCy Schubert endforeach() 13*b50261e2SCy Schubertendmacro() 14