From 60fb59ce4d0b205f06282b11768d0d04fde60eae Mon Sep 17 00:00:00 2001 From: Vitaliy Parinov Date: Fri, 12 Jan 2018 05:50:19 +0300 Subject: [PATCH] [date] Update to 2.4 cont. (removed DATE_BUILD_LIB usages) --- ports/date/CMakeLists.txt | 2 -- ports/date/portfile.cmake | 7 +++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ports/date/CMakeLists.txt b/ports/date/CMakeLists.txt index c1efc4e2a..4c38e4a87 100644 --- a/ports/date/CMakeLists.txt +++ b/ports/date/CMakeLists.txt @@ -14,8 +14,6 @@ add_library(tz src/tz.cpp) if(BUILD_SHARED_LIBS) target_compile_definitions(tz PRIVATE -DDATE_BUILD_DLL) -else() - target_compile_definitions(tz PRIVATE -DDATE_BUILD_LIB) endif() install( diff --git a/ports/date/portfile.cmake b/ports/date/portfile.cmake index 14bae6195..e060edb87 100644 --- a/ports/date/portfile.cmake +++ b/ports/date/portfile.cmake @@ -25,4 +25,11 @@ vcpkg_install_cmake() vcpkg_copy_pdbs() +set(HEADER "${CURRENT_PACKAGES_DIR}/include/date/tz.h") +file(READ "${HEADER}" _contents) +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + string(REPLACE "ifdef DATE_BUILD_DLL" "if 1" _contents "${_contents}") +endif() +file(WRITE "${HEADER}" "${_contents}") + file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/date RENAME copyright)