mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
a9db46aec2
It's almost useful.
16 lines
347 B
CMake
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()
|
|
|
|
|