Expat: build on older GLibC versions
getrandom() is only in GLibC >= 2.2.5, and CentOS 7 uses an older GCC version, so add CMake logic to fallback to /dev/urandom as the Expat entroy source.
This commit is contained in:
parent
7ee427c202
commit
6b9575d076
16
3rdparty/expat/CMakeLists.txt
vendored
16
3rdparty/expat/CMakeLists.txt
vendored
@ -1,7 +1,21 @@
|
|||||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
set(HAVE_GETRANDOM YES)
|
check_cxx_source_compiles(
|
||||||
|
"#include <sys/random.h>
|
||||||
|
int main(void) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
"
|
||||||
|
HAVE_GETRANDOM)
|
||||||
|
|
||||||
|
if (NOT HAVE_GETRANDOM)
|
||||||
|
# on older (GLibC < 2.25) fall back to /dev/urandom
|
||||||
|
set(XML_DEV_URANDOM 1)
|
||||||
|
else()
|
||||||
|
message(STATUS "Found <sys/random.h>")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
configure_file (
|
configure_file (
|
||||||
"${PROJECT_SOURCE_DIR}/3rdparty/expat/expat_config_cmake.in"
|
"${PROJECT_SOURCE_DIR}/3rdparty/expat/expat_config_cmake.in"
|
||||||
"${PROJECT_BINARY_DIR}/3rdparty/expat/simgear_expat_config.h"
|
"${PROJECT_BINARY_DIR}/3rdparty/expat/simgear_expat_config.h"
|
||||||
|
1
3rdparty/expat/expat_config_cmake.in
vendored
1
3rdparty/expat/expat_config_cmake.in
vendored
@ -11,6 +11,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#cmakedefine HAVE_GETRANDOM
|
#cmakedefine HAVE_GETRANDOM
|
||||||
|
#cmakedefine XML_DEV_URANDOM
|
||||||
|
|
||||||
// we can assume > 10.7 macOS so always set this
|
// we can assume > 10.7 macOS so always set this
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
Loading…
Reference in New Issue
Block a user