aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/liblzma/CONTROL1
-rw-r--r--ports/liblzma/portfile.cmake8
2 files changed, 7 insertions, 2 deletions
diff --git a/ports/liblzma/CONTROL b/ports/liblzma/CONTROL
index e95b13c3c..dc9d0fda8 100644
--- a/ports/liblzma/CONTROL
+++ b/ports/liblzma/CONTROL
@@ -1,4 +1,5 @@
Source: liblzma
Version: 5.2.5
+Port-Version: 1
Homepage: https://github.com/xz-mirror/xz
Description: Compression library with an API similar to that of zlib.
diff --git a/ports/liblzma/portfile.cmake b/ports/liblzma/portfile.cmake
index acc0dbaaa..c29dbafed 100644
--- a/ports/liblzma/portfile.cmake
+++ b/ports/liblzma/portfile.cmake
@@ -68,9 +68,13 @@ set(LZMA_FOUND TRUE CACHE BOOL \"\")
set(LIBLZMA_FOUND TRUE CACHE BOOL \"\")
")
-if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
- file(APPEND ${CURRENT_PACKAGES_DIR}/share/liblzma/LibLZMAConfig.cmake "add_definitions(-DLZMA_API_STATIC)")
+file(READ ${CURRENT_PACKAGES_DIR}/include/lzma.h _contents)
+if (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ string(REPLACE "defined(LZMA_API_STATIC)" "1" _contents "${_contents}")
+else()
+ string(REPLACE "defined(LZMA_API_STATIC)" "0" _contents "${_contents}")
endif()
+file(WRITE ${CURRENT_PACKAGES_DIR}/include/lzma.h "${_contents}")
if (VCPKG_BUILD_TYPE STREQUAL debug)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/include)