mirror of
https://github.com/libevent/libevent.git
synced 2025-01-20 05:02:55 +08:00
36588e169d
- add_compiler_flags() must accept array IOW just ARGN will be enoough - add_compiler_flags() called with variable name instead of it's value P.S. and fix some alignments issues P.P.S. more cmake issues expected since now CFLAGS actually works P.P.P.S. some issues with cmake cache is possible, so just reset it
14 lines
336 B
CMake
14 lines
336 B
CMake
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()
|