mirror of
https://gitlab.gnome.org/GNOME/libxml2
synced 2025-03-28 21:33:13 +00:00
cmake: Find threads dep early as it may be needed for later checks
This commit is contained in:
parent
b7d56ef7f1
commit
8617d8aa10
@ -99,6 +99,12 @@ set(PACKAGE_TARNAME "libxml2")
|
|||||||
set(PACKAGE_URL "https://gitlab.gnome.org/GNOME/libxml2")
|
set(PACKAGE_URL "https://gitlab.gnome.org/GNOME/libxml2")
|
||||||
set(PACKAGE_VERSION ${VERSION})
|
set(PACKAGE_VERSION ${VERSION})
|
||||||
|
|
||||||
|
if(LIBXML2_WITH_THREADS)
|
||||||
|
find_package(Threads REQUIRED)
|
||||||
|
set(THREAD_LIBS ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
list(APPEND CMAKE_REQUIRED_LIBRARIES Threads::Threads)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (NOT MSVC)
|
if (NOT MSVC)
|
||||||
check_c_source_compiles("
|
check_c_source_compiles("
|
||||||
void __attribute__((destructor))
|
void __attribute__((destructor))
|
||||||
@ -395,9 +401,7 @@ if(LIBXML2_WITH_LZMA)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(LIBXML2_WITH_THREADS)
|
if(LIBXML2_WITH_THREADS)
|
||||||
find_package(Threads REQUIRED)
|
|
||||||
target_link_libraries(LibXml2 PRIVATE Threads::Threads)
|
target_link_libraries(LibXml2 PRIVATE Threads::Threads)
|
||||||
set(THREAD_LIBS ${CMAKE_THREAD_LIBS_INIT})
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(LIBXML2_WITH_ZLIB)
|
if(LIBXML2_WITH_ZLIB)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user