Skip to content

Commit

Permalink
[liblzma] Update wrapper, add feature tools (#24708)
Browse files Browse the repository at this point in the history
* Fix liblzma wrapper for older CMake

* Add feature for tools

* Update versions

* Test find_package(... REQUIRED)
  • Loading branch information
dg0yt committed May 17, 2022
1 parent 6105887 commit 8d59cb3
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 4 deletions.
18 changes: 18 additions & 0 deletions ports/liblzma/build-tools.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cddbccb..63c8f3d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -492,6 +492,7 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/liblzmaConfig.cmake"
COMPONENT liblzma_Development)


+if(BUILD_TOOLS)
#############################################################################
# getopt_long
#############################################################################
@@ -663,3 +664,4 @@ if(NOT MSVC AND HAVE_GETOPT_LONG)
DESTINATION "${CMAKE_INSTALL_MANDIR}/man1"
COMPONENT xz)
endif()
+endif()
\ No newline at end of file
7 changes: 7 additions & 0 deletions ports/liblzma/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@ vcpkg_from_github(
fix_config_include.patch
win_output_name.patch # Fix output name on Windows. Autotool build does not generate lib prefixed libraries on windows.
add_support_ios.patch # add install bundle info for support ios
build-tools.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
tools BUILD_TOOLS
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
Expand Down
2 changes: 1 addition & 1 deletion ports/liblzma/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if(NOT "CONFIG" IN_LIST ARGS AND NOT "NO_MODULE" IN_LIST ARGS AND NOT CMAKE_DISA
if(CMAKE_VERSION VERSION_LESS 3.16)
# Older versions of FindLibLZMA.cmake need a single lib in LIBLZMA_LIBRARY.
set(z_vcpkg_liblzma_fixup_needed 1)
set(LIBLZMA_LIBRARY "${LIBLZMA_LIBRARY_RELEASE}")
set(LIBLZMA_LIBRARY "${LIBLZMA_LIBRARY_RELEASE}" CACHE INTERNAL "")
elseif(NOT TARGET LibLZMA::LibLZMA)
set(z_vcpkg_liblzma_fixup_needed 1)
endif()
Expand Down
10 changes: 8 additions & 2 deletions ports/liblzma/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "liblzma",
"version-semver": "5.2.5",
"port-version": 5,
"port-version": 6,
"description": "Compression library with an API similar to that of zlib.",
"homepage": "https://github.com/xz-mirror/xz",
"license": null,
Expand All @@ -14,5 +14,11 @@
"name": "vcpkg-cmake-config",
"host": true
}
]
],
"features": {
"tools": {
"description": "Build tools",
"supports": "!windows, mingw"
}
}
}
2 changes: 2 additions & 0 deletions scripts/test_ports/cmake-user/project/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ foreach(package ${FIND_PACKAGES})
message(SEND_ERROR "find_package(${package}) check: failed")
continue()
endif()
# REQUIRED changes the behaviour find_package_handle_standard_args.
find_package("${package}" REQUIRED)
message(STATUS "find_package(${package}) check: success")

set(libraries_var "")
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3738,7 +3738,7 @@
},
"liblzma": {
"baseline": "5.2.5",
"port-version": 5
"port-version": 6
},
"libmad": {
"baseline": "0.15.1",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/liblzma.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "96b6aac6211ad3fd3da29508a519c3cd5f09716d",
"version-semver": "5.2.5",
"port-version": 6
},
{
"git-tree": "18b7cbd0972b536a6bd4c0ef0f41dce9c3f047ac",
"version-semver": "5.2.5",
Expand Down

0 comments on commit 8d59cb3

Please sign in to comment.