File: CheckFunctionKeywords.cmake

package info (click to toggle)
libevent 2.1.12-stable-10
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 5,304 kB
  • sloc: ansic: 56,580; sh: 4,525; python: 1,356; makefile: 217
file content (14 lines) | stat: -rw-r--r-- 545 bytes parent folder | download | duplicates (34)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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)