mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Merge commit '5223d1d95fddcef6f9a36e264a5800bd907ade8b' into main (cherry picked from commit b50261e21f39a6c7249a49e7b60aa878c98512a8)
14 lines
545 B
CMake
14 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)
|