1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-10 08:58:16 +03:00

Add missing compile definition for static builds to CMake

This commit is contained in:
Markus Rickert 2020-11-19 22:06:23 +01:00 committed by Nick Wellnhofer
parent e028d29379
commit 7a62870a3c
2 changed files with 7 additions and 0 deletions

View File

@ -424,6 +424,10 @@ endif()
add_library(LibXml2 ${LIBXML2_HDRS} ${LIBXML2_SRCS})
if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(LibXml2 INTERFACE LIBXML_STATIC)
endif()
if(LIBXML2_WITH_THREADS)
target_compile_definitions(LibXml2 PRIVATE _REENTRANT)
if(WIN32)

View File

@ -8,6 +8,7 @@
#
# LIBXML2_INCLUDE_DIRS - Directory where libxml2 headers are located.
# LIBXML2_LIBRARIES - xml2 libraries to link against.
# LIBXML2_DEFINITIONS - the compiler switches required for using LibXml2
# LIBXML2_VERSION_MAJOR - The major version of libxml2.
# LIBXML2_VERSION_MINOR - The minor version of libxml2.
# LIBXML2_VERSION_PATCH - The patch version of libxml2.
@ -62,6 +63,8 @@ if(@LIBXML2_WITH_ICONV@)
endif()
if(NOT @BUILD_SHARED_LIBS@)
set(LIBXML2_DEFINITIONS -DLIBXML_STATIC)
if(@LIBXML2_WITH_THREADS@)
find_dependency(Threads)
list(APPEND LIBXML2_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})