[date] Update to 2.4 cont. (removed DATE_BUILD_LIB usages)

This commit is contained in:
Vitaliy Parinov 2018-01-12 05:50:19 +03:00
parent bfc50d8ee2
commit 60fb59ce4d
2 changed files with 7 additions and 2 deletions

View File

@ -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(

View File

@ -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)