-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[liblzma] use upstream CMakeLists.txt + Add pkgconfig. (#14615)
* [liblzma] use upstream CMakeLists.txt + Add pkgconfig. * fixing regressions * add debug suffix. fix pkgconfig * fix cmake path * remove empty lines * fix wrapper * more fixes * fix findLibLZMA * fix patch for static builds
- Loading branch information
Showing
7 changed files
with
90 additions
and
191 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Source: liblzma | ||
Version: 5.2.5 | ||
Port-Version: 1 | ||
Port-Version: 2 | ||
Homepage: https://github.com/xz-mirror/xz | ||
Description: Compression library with an API similar to that of zlib. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 34c6aca00..7b3708ab2 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -401,6 +401,7 @@ if(WIN32) | ||
if(BUILD_SHARED_LIBS) | ||
# Add the Windows resource file for liblzma.dll. | ||
target_sources(liblzma PRIVATE src/liblzma/liblzma_w32res.rc) | ||
+ target_include_directories(liblzma PRIVATE windows/vs2019) | ||
|
||
# Export the public API symbols with __declspec(dllexport). | ||
target_compile_definitions(liblzma PRIVATE DLL_EXPORT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
The package liblzma provides CMake targets: | ||
|
||
find_package(LibLZMA REQUIRED) | ||
target_link_libraries(main PRIVATE LibLZMA::LibLZMA) | ||
|
||
or | ||
|
||
find_package(liblzma CONFIG REQUIRED) | ||
target_link_libraries(main PRIVATE liblzma::liblzma) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
list(REMOVE_ITEM ARGS "NO_MODULE") | ||
list(REMOVE_ITEM ARGS "CONFIG") | ||
list(REMOVE_ITEM ARGS "MODULE") | ||
list(REMOVE_ITEM ARGS "MODULE") # Always call CONFIG. | ||
_find_package(${ARGS} CONFIG) | ||
if(NOT TARGET LibLZMA::LibLZMA AND TARGET liblzma::liblzma) | ||
add_library(LibLZMA::LibLZMA INTERFACE IMPORTED) # Too lazy to fix wrong target usage all over vcpkg. | ||
set_target_properties(LibLZMA::LibLZMA PROPERTIES INTERFACE_LINK_LIBRARIES liblzma::liblzma) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 120dc7548..728ca3591 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -398,11 +398,12 @@ else() | ||
endif() | ||
|
||
if(WIN32) | ||
+ set_target_properties(liblzma PROPERTIES OUTPUT_NAME lzma) | ||
if(BUILD_SHARED_LIBS) | ||
# Add the Windows resource file for liblzma.dll. | ||
target_sources(liblzma PRIVATE src/liblzma/liblzma_w32res.rc) | ||
target_include_directories(liblzma PRIVATE windows/vs2019) | ||
|
||
# Export the public API symbols with __declspec(dllexport). | ||
target_compile_definitions(liblzma PRIVATE DLL_EXPORT) | ||
else() |