aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/date/CMakeLists.txt2
-rw-r--r--ports/date/portfile.cmake7
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)