aboutsummaryrefslogtreecommitdiff
path: root/ports/libxml2
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2018-03-11 23:41:51 -0700
committerRobert Schumacher <roschuma@microsoft.com>2018-03-11 23:42:54 -0700
commit9f9778ccff48981a691bf34f30ecc4bf2efd5ac1 (patch)
tree10ec609d13836ddc266345f441bae6f9e824056a /ports/libxml2
parentece289b9a6466dca885fd2555ed783d70dcad9bf (diff)
downloadvcpkg-9f9778ccff48981a691bf34f30ecc4bf2efd5ac1.tar.gz
vcpkg-9f9778ccff48981a691bf34f30ecc4bf2efd5ac1.zip
[many ports] Improve behavior on Linux and general cleanup
Diffstat (limited to 'ports/libxml2')
-rw-r--r--ports/libxml2/CMakeLists.txt23
-rw-r--r--ports/libxml2/CONTROL2
-rw-r--r--ports/libxml2/portfile.cmake12
-rw-r--r--ports/libxml2/vcpkg-cmake-wrapper.cmake11
4 files changed, 32 insertions, 16 deletions
diff --git a/ports/libxml2/CMakeLists.txt b/ports/libxml2/CMakeLists.txt
index 02cccd6c7..96ecb901d 100644
--- a/ports/libxml2/CMakeLists.txt
+++ b/ports/libxml2/CMakeLists.txt
@@ -5,8 +5,10 @@ option(INSTALL_HEADERS "Install public header files" ON)
find_package(ZLIB REQUIRED)
find_package(LibLZMA REQUIRED)
-find_library(ICONV NAMES libiconv)
-find_library(ICONV_CHARSET NAMES libcharset)
+if(WIN32)
+ find_library(ICONV NAMES libiconv)
+ find_library(ICONV_CHARSET NAMES libcharset)
+endif()
set(SOURCES
buf.c
@@ -79,17 +81,24 @@ target_include_directories(libxml2 PRIVATE ${CMAKE_CURRENT_BINARY_DIR} win32/vc1
target_link_libraries(libxml2 PRIVATE
ZLIB::ZLIB
${LIBLZMA_LIBRARIES}
- ${ICONV}
- ${ICONV_CHARSET}
- wsock32.lib
- ws2_32.lib
)
+if(WIN32)
+ target_link_libraries(libxml2 PRIVATE
+ ${ICONV}
+ ${ICONV_CHARSET}
+ wsock32.lib
+ ws2_32.lib
+ )
+ target_compile_definitions(libxml2 PRIVATE
+ -DHAVE_WIN32_THREADS
+ )
+endif()
+
target_compile_definitions(libxml2 PRIVATE
-D_CRT_SECURE_NO_DEPRECATE
-D_CRT_NONSTDC_NO_DEPRECATE
-D_REENTRANT
-DNOLIBTOOL
- -DHAVE_WIN32_THREADS
-DHAVE_ZLIB_H
-DHAVE_LZMA_H
)
diff --git a/ports/libxml2/CONTROL b/ports/libxml2/CONTROL
index ce430ceff..b8552e48e 100644
--- a/ports/libxml2/CONTROL
+++ b/ports/libxml2/CONTROL
@@ -1,4 +1,4 @@
Source: libxml2
-Version: 2.9.4-2
+Version: 2.9.4-4
Description: Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform)
Build-Depends: zlib, libiconv, liblzma
diff --git a/ports/libxml2/portfile.cmake b/ports/libxml2/portfile.cmake
index d50183f1d..a300fcaf5 100644
--- a/ports/libxml2/portfile.cmake
+++ b/ports/libxml2/portfile.cmake
@@ -1,11 +1,3 @@
-# Common Ambient Variables:
-# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
-# TARGET_TRIPLET is the current triplet (x86-windows, etc)
-# PORT is the current port name (zlib, etc)
-# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
-# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
-#
-
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libxml2-2.9.4)
vcpkg_download_distfile(ARCHIVE
@@ -30,3 +22,7 @@ file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libxm
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libxml2/COPYING ${CURRENT_PACKAGES_DIR}/share/libxml2/copyright)
vcpkg_copy_pdbs()
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/libxml2)
+endif()
diff --git a/ports/libxml2/vcpkg-cmake-wrapper.cmake b/ports/libxml2/vcpkg-cmake-wrapper.cmake
new file mode 100644
index 000000000..6452af426
--- /dev/null
+++ b/ports/libxml2/vcpkg-cmake-wrapper.cmake
@@ -0,0 +1,11 @@
+_find_package(${ARGS})
+if(LibXml2_FOUND AND (CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore"))
+ find_package(LibLZMA)
+ list(APPEND LIBXML2_LIBRARIES
+ ${LIBLZMA_LIBRARIES}
+ debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/libiconv.lib
+ optimized ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libiconv.lib
+ debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/libcharset.lib
+ optimized ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libcharset.lib
+ ws2_32)
+endif()