comparison extern/jansson/cmake/CheckFunctionKeywords.cmake @ 0:1158cffe5a5e

Initial import
author David Demelier <markand@malikania.fr>
date Mon, 08 Feb 2016 16:43:14 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1158cffe5a5e
1 include(CheckCSourceCompiles)
2
3 macro(check_function_keywords _wordlist)
4 set(${_result} "")
5 foreach(flag ${_wordlist})
6 string(REGEX REPLACE "[-+/ ()]" "_" flagname "${flag}")
7 string(TOUPPER "${flagname}" flagname)
8 set(have_flag "HAVE_${flagname}")
9 check_c_source_compiles("${flag} void func(); void func() { } int main() { func(); return 0; }" ${have_flag})
10 if(${have_flag} AND NOT ${_result})
11 set(${_result} "${flag}")
12 # break()
13 endif(${have_flag} AND NOT ${_result})
14 endforeach(flag)
15 endmacro(check_function_keywords)