aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeModules/CheckFunctionKeywords.cmake
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2016-07-24 20:39:43 +0000
committerXin LI <delphij@FreeBSD.org>2016-07-24 20:39:43 +0000
commit7db3f078630cfaac36b16a61362821443c0f7229 (patch)
tree8f5d4f820d4e3f425b2873efe68942716ef4f767 /CMakeModules/CheckFunctionKeywords.cmake
downloadsrc-vendor/libdivsufsort.tar.gz
src-vendor/libdivsufsort.zip
Vendor import of libdivsufsort, a software library that implementsvendor/libdivsufsort/0.0.2015.10.27vendor/libdivsufsort
a lightweight suffix array construction algorithm. Obtained from: https://github.com/y-256/libdivsufsort
Notes
Notes: svn path=/vendor/libdivsufsort/dist/; revision=303275 svn path=/vendor/libdivsufsort/0.0.2015.10.27/; revision=303276; tag=vendor/libdivsufsort/0.0.2015.10.27
Diffstat (limited to 'CMakeModules/CheckFunctionKeywords.cmake')
-rw-r--r--CMakeModules/CheckFunctionKeywords.cmake15
1 files changed, 15 insertions, 0 deletions
diff --git a/CMakeModules/CheckFunctionKeywords.cmake b/CMakeModules/CheckFunctionKeywords.cmake
new file mode 100644
index 000000000000..44601fd4e9fa
--- /dev/null
+++ b/CMakeModules/CheckFunctionKeywords.cmake
@@ -0,0 +1,15 @@
+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}")
+# break()
+ endif(${have_flag} AND NOT ${_result})
+ endforeach(flag)
+endmacro(check_function_keywords)