diff --git a/3rdparty/expat/CMakeLists.txt b/3rdparty/expat/CMakeLists.txt index b225166d..4b232414 100644 --- a/3rdparty/expat/CMakeLists.txt +++ b/3rdparty/expat/CMakeLists.txt @@ -1,7 +1,21 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux") - set(HAVE_GETRANDOM YES) + check_cxx_source_compiles( + "#include + 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 ") + endif() endif() + configure_file ( "${PROJECT_SOURCE_DIR}/3rdparty/expat/expat_config_cmake.in" "${PROJECT_BINARY_DIR}/3rdparty/expat/simgear_expat_config.h" diff --git a/3rdparty/expat/expat_config_cmake.in b/3rdparty/expat/expat_config_cmake.in index 15a76fcc..b17e2e24 100644 --- a/3rdparty/expat/expat_config_cmake.in +++ b/3rdparty/expat/expat_config_cmake.in @@ -11,6 +11,7 @@ #endif #cmakedefine HAVE_GETRANDOM +#cmakedefine XML_DEV_URANDOM // we can assume > 10.7 macOS so always set this #ifdef __APPLE__