mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
f01879d5a6
Even though the initial request was about Android, it is not only about it, but it could be the case for Linux as well (so as Apple M1/... chips) And this should not affect anything, since this is just ELFs Fixes: https://github.com/libevent/libevent/issues/1708
15 lines
416 B
CMake
15 lines
416 B
CMake
include(CheckLinkerFlag)
|
|
|
|
macro(add_linker_flags)
|
|
foreach(flag ${ARGN})
|
|
string(REGEX REPLACE "[-.+/:= ]" "_" _flag_esc "${flag}")
|
|
|
|
check_linker_flag(C "${flag}" check_c_linker_flag_${_flag_esc})
|
|
|
|
if (check_c_linker_flag_${_flag_esc})
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${flag}")
|
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${flag}")
|
|
endif()
|
|
endforeach()
|
|
endmacro()
|