From 039e795567edd2fc6a2c8597f150e68d71920f5b Mon Sep 17 00:00:00 2001 From: Albert Bezzina Date: Thu, 19 Oct 2017 15:52:59 +0200 Subject: [PATCH] FIX: Project did not build successfully when building as static. --- ports/pugixml/CONTROL | 2 +- ports/pugixml/portfile.cmake | 27 ++++++++++++++++----------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/ports/pugixml/CONTROL b/ports/pugixml/CONTROL index 5fc5f1e4e8..01679ea6ec 100644 --- a/ports/pugixml/CONTROL +++ b/ports/pugixml/CONTROL @@ -1,3 +1,3 @@ Source: pugixml -Version: 1.8.1-1 +Version: 1.8.1-2 Description: C++ XML processing library diff --git a/ports/pugixml/portfile.cmake b/ports/pugixml/portfile.cmake index 4fcbec84ba..0d51239746 100644 --- a/ports/pugixml/portfile.cmake +++ b/ports/pugixml/portfile.cmake @@ -7,17 +7,22 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/pugixmlapi.patch -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS - -DBUILD_DEFINES="PUGIXML_API=__declspec\(dllexport\)" -) +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + ) +else() + vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/pugixmlapi.patch + ) + vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DBUILD_DEFINES="PUGIXML_API=__declspec\(dllexport\)" + ) +endif() vcpkg_install_cmake() vcpkg_copy_pdbs()