mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
8b228e27f5
This is still not done, cmake here was a horrid mess, but we're getting our act together now.
15 lines
545 B
CMake
15 lines
545 B
CMake
include(CheckCSourceCompiles)
|
|
|
|
macro(check_function_keywords _wordlist)
|
|
set(${_result} "")
|
|
foreach(flag ${_wordlist})
|
|
string(REGEX REPLACE "[-+/ ()]" "_" flagname "${flag}")
|
|
string(TOUPPER "${flagname}" flagname)
|
|
set(have_flag "HAVE_${flagname}")
|
|
check_c_source_compiles("${flag} void func(); void func() { } int main() { func(); return 0; }" ${have_flag})
|
|
if(${have_flag} AND NOT ${_result})
|
|
set(${_result} "${flag}")
|
|
endif(${have_flag} AND NOT ${_result})
|
|
endforeach(flag)
|
|
endmacro(check_function_keywords)
|