libevent/cmake/AddCompilerFlags.cmake
Mark Ellzey a9db46aec2 CMAKE CMAKE CMAKE CLEANUPS
It's almost useful.
2015-12-20 00:43:46 -08:00

16 lines
347 B
CMake

include(CheckCCompilerFlag)
macro(add_compiler_flags _flags)
foreach(flag ${_flags})
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()