]> git.feebdaed.xyz Git - 0xmirror/liboqs.git/commitdiff
build: search unistd.h separately from sys/random.h for getentropy (#2104)
authorMartin Kröning <mkroening@posteo.net>
Thu, 20 Mar 2025 16:58:16 +0000 (17:58 +0100)
committerGitHub <noreply@github.com>
Thu, 20 Mar 2025 16:58:16 +0000 (12:58 -0400)
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
src/common/CMakeLists.txt

index 3ef6535743301e983527cc823d0fdef05d954e99..98badd23713cebc271c1d69460899462190cd7e3 100644 (file)
@@ -100,8 +100,9 @@ if(${OQS_USE_OPENSSL})
     target_include_directories(common PRIVATE ${OPENSSL_INCLUDE_DIR})
     target_include_directories(internal PRIVATE ${OPENSSL_INCLUDE_DIR})
 else()
-    check_symbol_exists(getentropy "unistd.h;sys/random.h" CMAKE_HAVE_GETENTROPY)
-    if(${CMAKE_HAVE_GETENTROPY})
+    check_symbol_exists(getentropy "unistd.h" CMAKE_UNISTD_HAVE_GETENTROPY)
+    check_symbol_exists(getentropy "sys/random.h" CMAKE_SYS_RANDOM_HAVE_GETENTROPY)
+    if("${CMAKE_UNISTD_HAVE_GETENTROPY}" OR "${CMAKE_SYS_RANDOM_HAVE_GETENTROPY}")
         target_compile_definitions(common PRIVATE OQS_HAVE_GETENTROPY)
         target_compile_definitions(internal PRIVATE OQS_HAVE_GETENTROPY)
     endif()