aboutsummaryrefslogtreecommitdiff
path: root/ports/libxml2/CMakeLists.txt
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/CMakeLists.txt
parentece289b9a6466dca885fd2555ed783d70dcad9bf (diff)
downloadvcpkg-9f9778ccff48981a691bf34f30ecc4bf2efd5ac1.tar.gz
vcpkg-9f9778ccff48981a691bf34f30ecc4bf2efd5ac1.zip
[many ports] Improve behavior on Linux and general cleanup
Diffstat (limited to 'ports/libxml2/CMakeLists.txt')
-rw-r--r--ports/libxml2/CMakeLists.txt23
1 files changed, 16 insertions, 7 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
)