mirror of
https://gitlab.gnome.org/GNOME/libxml2
synced 2025-03-28 21:33:13 +00:00
build: Set Cflags.private on Windows
This commit is contained in:
parent
1a5ed74717
commit
c106455c25
@ -654,11 +654,20 @@ if(BUILD_SHARED_LIBS)
|
||||
set(XML_PC_LIBS_PRIVATE "
|
||||
Libs.private:")
|
||||
else()
|
||||
target_compile_definitions(LibXml2 PUBLIC LIBXML_STATIC)
|
||||
set(XML_CFLAGS "-DLIBXML_STATIC")
|
||||
set(XML_PRIVATE_LIBS_NO_SHARED "${XML_PRIVATE_LIBS}")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(XML_STATIC_CFLAGS "-DLIBXML_STATIC")
|
||||
if (BUILD_SHARED_LIBS)
|
||||
set(XML_PC_CFLAGS_PRIVATE "
|
||||
Cflags.private:")
|
||||
else()
|
||||
target_compile_definitions(LibXml2 PUBLIC LIBXML_STATIC)
|
||||
set(XML_CFLAGS "${XML_STATIC_CFLAGS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig" "${CMAKE_INSTALL_PREFIX}")
|
||||
string(REGEX REPLACE "/$" "" PACKAGE_RELATIVE_PATH "${PACKAGE_RELATIVE_PATH}")
|
||||
|
||||
|
15
configure.ac
15
configure.ac
@ -393,6 +393,8 @@ dnl
|
||||
XML_LIBDIR='-L${libdir}'
|
||||
XML_INCLUDEDIR='-I${includedir}/libxml2'
|
||||
XML_CFLAGS=""
|
||||
XML_STATIC_CFLAGS=""
|
||||
XML_PC_CFLAGS_PRIVATE=""
|
||||
|
||||
dnl Thread-local storage
|
||||
if test "$with_tls" = "yes"; then
|
||||
@ -486,9 +488,13 @@ case ${host} in
|
||||
# work properly (without it, xmlexports.h would force the use of
|
||||
# DLL imports, which obviously aren't present in a static
|
||||
# library).
|
||||
if test "x$enable_shared" = "xno"; then
|
||||
XML_CFLAGS="$XML_CFLAGS -DLIBXML_STATIC"
|
||||
AM_CFLAGS="$AM_CFLAGS -DLIBXML_STATIC"
|
||||
XML_STATIC_CFLAGS="-DLIBXML_STATIC"
|
||||
if test "x$enable_shared" = "xyes"; then
|
||||
XML_PC_CFLAGS_PRIVATE="
|
||||
Cflags.private:"
|
||||
else
|
||||
XML_CFLAGS="$XML_STATIC_CFLAGS"
|
||||
AM_CFLAGS="$AM_CFLAGS $XML_STATIC_CFLAGS"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
@ -1121,9 +1127,11 @@ fi
|
||||
AC_SUBST(XML_PRIVATE_LIBS_NO_SHARED)
|
||||
AC_SUBST(XML_PC_PRIVATE)
|
||||
AC_SUBST(XML_PC_LIBS_PRIVATE)
|
||||
AC_SUBST(XML_PC_CFLAGS_PRIVATE)
|
||||
AM_SUBST_NOTMAKE(XML_PRIVATE_LIBS_NO_SHARED)
|
||||
AM_SUBST_NOTMAKE(XML_PC_PRIVATE)
|
||||
AM_SUBST_NOTMAKE(XML_PC_LIBS_PRIVATE)
|
||||
AM_SUBST_NOTMAKE(XML_PC_CFLAGS_PRIVATE)
|
||||
|
||||
AC_SUBST(XML_PC_LIBS)
|
||||
AC_SUBST(XML_PC_REQUIRES)
|
||||
@ -1133,6 +1141,7 @@ AM_SUBST_NOTMAKE(XML_PC_REQUIRES)
|
||||
AC_SUBST(AM_CFLAGS)
|
||||
AC_SUBST(AM_LDFLAGS)
|
||||
AC_SUBST(XML_CFLAGS)
|
||||
AC_SUBST(XML_STATIC_CFLAGS)
|
||||
|
||||
AC_SUBST(XML_LIBDIR)
|
||||
AC_SUBST(XML_LIBS)
|
||||
|
@ -9,4 +9,4 @@ Version: @VERSION@
|
||||
Description: libXML library version2.
|
||||
Requires@XML_PC_PRIVATE@: @XML_PC_REQUIRES@
|
||||
Libs: @XML_LIBDIR@ @XML_LIBS@ @XML_PC_LIBS_PRIVATE@ @XML_PC_LIBS@ @LIBS@
|
||||
Cflags: @XML_INCLUDEDIR@ @XML_CFLAGS@
|
||||
Cflags: @XML_INCLUDEDIR@ @XML_PC_CFLAGS_PRIVATE@ @XML_STATIC_CFLAGS@
|
||||
|
Loading…
x
Reference in New Issue
Block a user