]> granicus.if.org Git - libexpat/commitdiff
CMake: Write expat_config.h as late as needed
authorSebastian Pipping <sebastian@pipping.org>
Tue, 9 Jul 2019 21:10:07 +0000 (23:10 +0200)
committerSebastian Pipping <sebastian@pipping.org>
Tue, 9 Jul 2019 21:14:18 +0000 (23:14 +0200)
Previously, our post-processing of HAVE_GETRANDOM did
was not applied to expat_config.h.

expat/CMakeLists.txt
expat/ConfigureChecks.cmake

index e45e324695f5d8d17581f8a2f7426d12ca35bf2b..4b743cdf5cf1c944334e02d9e1bea8615ade2dab 100644 (file)
@@ -107,6 +107,7 @@ if(BUILD_tests)
     enable_testing()\r
 endif(BUILD_tests)\r
 \r
+\r
 include(${CMAKE_CURRENT_LIST_DIR}/ConfigureChecks.cmake)\r
 \r
 macro(evaluate_detection_results use_ref have_ref thing_lower thing_title)\r
@@ -124,6 +125,9 @@ if(NOT WIN32)
     evaluate_detection_results(USE_SYS_GETRANDOM HAVE_SYSCALL_GETRANDOM "syscall SYS_getrandom" "Syscall SYS_getrandom")\r
 endif()\r
 \r
+configure_file(expat_config.h.cmake "${CMAKE_CURRENT_BINARY_DIR}/expat_config.h")\r
+add_definitions(-DHAVE_EXPAT_CONFIG_H)\r
+\r
 \r
 set(EXTRA_COMPILE_FLAGS)\r
 if(FLAG_NO_STRICT_ALIASING)\r
index 1e245da016b979388062c940552846dce8ab6473..0803c7b21ab9598c4792115c03b873cf3e4e947f 100644 (file)
@@ -62,8 +62,5 @@ check_c_source_compiles("
         }"\r
     HAVE_SYSCALL_GETRANDOM)\r
 \r
-configure_file(expat_config.h.cmake "${CMAKE_CURRENT_BINARY_DIR}/expat_config.h")\r
-add_definitions(-DHAVE_EXPAT_CONFIG_H)\r
-\r
 check_c_compiler_flag("-fno-strict-aliasing" FLAG_NO_STRICT_ALIASING)\r
 check_c_compiler_flag("-fvisibility=hidden" FLAG_VISIBILITY)\r