diff options
author | Brad King <brad.king@kitware.com> | 2019-07-02 12:37:18 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-07-02 12:38:24 (GMT) |
commit | 5d8dcdf5be57e66ab3a50d9f17f94baf24424582 (patch) | |
tree | c80ec628b406c48a5484584b2cc39835373ad87c /Utilities/cmexpat/ConfigureChecks.cmake | |
parent | 41acd44625f63d0730fdbd983ea598b227622087 (diff) | |
parent | 0998f6396a51248aa307c3254f876d2699597a5b (diff) | |
download | CMake-5d8dcdf5be57e66ab3a50d9f17f94baf24424582.zip CMake-5d8dcdf5be57e66ab3a50d9f17f94baf24424582.tar.gz CMake-5d8dcdf5be57e66ab3a50d9f17f94baf24424582.tar.bz2 |
Merge topic 'update-expat'
0998f6396a Merge branch 'upstream-expat' into update-expat
ba13dc2aa8 expat 2019-06-19 (d3b78b42)
7449c63f3e expat: Update script to get Expat 2.2.7
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3501
Diffstat (limited to 'Utilities/cmexpat/ConfigureChecks.cmake')
-rw-r--r-- | Utilities/cmexpat/ConfigureChecks.cmake | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/Utilities/cmexpat/ConfigureChecks.cmake b/Utilities/cmexpat/ConfigureChecks.cmake index 057cfa5..b2edc3e 100644 --- a/Utilities/cmexpat/ConfigureChecks.cmake +++ b/Utilities/cmexpat/ConfigureChecks.cmake @@ -1,6 +1,7 @@ +include(CheckCCompilerFlag) +include(CheckCSourceCompiles) include(CheckIncludeFile) include(CheckIncludeFiles) -include(CheckFunctionExists) include(CheckSymbolExists) include(TestBigEndian) @@ -16,10 +17,21 @@ check_include_file("sys/stat.h" HAVE_SYS_STAT_H) check_include_file("sys/types.h" HAVE_SYS_TYPES_H) check_include_file("unistd.h" HAVE_UNISTD_H) -check_function_exists("getpagesize" HAVE_GETPAGESIZE) -check_function_exists("bcopy" HAVE_BCOPY) -check_symbol_exists("memmove" "string.h" HAVE_MEMMOVE) -check_function_exists("mmap" HAVE_MMAP) +check_symbol_exists("getpagesize" "unistd.h" HAVE_GETPAGESIZE) +check_symbol_exists("mmap" "sys/mman.h" HAVE_MMAP) +check_symbol_exists("getrandom" "sys/random.h" HAVE_GETRANDOM) + +if(USE_libbsd) + set(CMAKE_REQUIRED_LIBRARIES "${LIB_BSD}") + set(_bsd "bsd/") +else() + set(_bsd "") +endif() +check_symbol_exists("arc4random_buf" "${_bsd}stdlib.h" HAVE_ARC4RANDOM_BUF) +if(NOT HAVE_ARC4RANDOM_BUF) + check_symbol_exists("arc4random" "${_bsd}stdlib.h" HAVE_ARC4RANDOM) +endif() +set(CMAKE_REQUIRED_LIBRARIES) #/* Define to 1 if you have the ANSI C header files. */ check_include_files("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS) @@ -40,5 +52,18 @@ else(HAVE_SYS_TYPES_H) set(SIZE_T "unsigned") endif(HAVE_SYS_TYPES_H) +check_c_source_compiles(" + #include <stdlib.h> /* for NULL */ + #include <unistd.h> /* for syscall */ + #include <sys/syscall.h> /* for SYS_getrandom */ + int main() { + syscall(SYS_getrandom, NULL, 0, 0); + return 0; + }" + HAVE_SYSCALL_GETRANDOM) + configure_file(expat_config.h.cmake "${CMAKE_CURRENT_BINARY_DIR}/expat_config.h") add_definitions(-DHAVE_EXPAT_CONFIG_H) + +check_c_compiler_flag("-fno-strict-aliasing" FLAG_NO_STRICT_ALIASING) +check_c_compiler_flag("-fvisibility=hidden" FLAG_VISIBILITY) |