Skip to content

Commit

Permalink
[liblzma] Patch headers to fix OpenTTD/OpenTTD#7614 (microsoft#7226)
Browse files Browse the repository at this point in the history
* [liblzma] Patch headers to fix OpenTTD/OpenTTD#7614

* Bump the version in CONTROL file

Co-authored-by: Billy Robert O'Neal III <[email protected]>
Co-authored-by: PhoebeHui <[email protected]>
Co-authored-by: nicole mazzuca <[email protected]>
  • Loading branch information
4 people authored and hellozee committed Sep 11, 2020
1 parent 24a92fe commit c903407
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions ports/liblzma/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Source: liblzma
Version: 5.2.5
Port-Version: 1
Homepage: https:/xz-mirror/xz
Description: Compression library with an API similar to that of zlib.
8 changes: 6 additions & 2 deletions ports/liblzma/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c903407

Please sign in to comment.