[libxml2] cmake: Fix build with thread support



commit 18bcced9d788c4e53603cb29d17396380565c185
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Wed Apr 20 13:36:02 2022 +0200

    cmake: Fix build with thread support
    
    Move configure_file(config.h) below pthreads check.
    
    Fix regression caused by commit f5659a1.

 CMakeLists.txt | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5060774f..5e1a289c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -134,9 +134,7 @@ if(ZLIB_FOUND)
        list(APPEND CMAKE_REQUIRED_LIBRARIES ZLIB::ZLIB)
 endif()
 
-if(MSVC)
-       configure_file(include/win32config.h config.h COPYONLY)
-else()
+if (NOT MSVC)
        check_c_source_compiles("
                void __attribute__((destructor))
                f(void) {}
@@ -244,7 +242,6 @@ else()
                        set(XML_SOCKLEN_T int)
                endif()
        endif()
-       configure_file(config.h.cmake.in config.h)
 endif()
 
 set(
@@ -640,6 +637,11 @@ install(
        COMPONENT development
 )
 
+if(MSVC)
+       configure_file(include/win32config.h config.h COPYONLY)
+else()
+       configure_file(config.h.cmake.in config.h)
+endif()
 configure_file(include/libxml/xmlversion.h.in libxml/xmlversion.h)
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml/xmlversion.h DESTINATION 
${CMAKE_INSTALL_INCLUDEDIR}/libxml2/libxml COMPONENT development)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]