diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2023-01-07 19:50:03 +0200 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2023-03-11 21:34:26 +0200 |
commit | 4dbdbd02d2a09e7e8c530d46de3d31e31c8f09a7 (patch) | |
tree | 19bfd56adf762b90e8262a2ef35de91f006b3c8a | |
parent | liblzma: Update documentation for lzma_filter_encoder. (diff) | |
download | xz-4dbdbd02d2a09e7e8c530d46de3d31e31c8f09a7.tar.xz |
CMake/Windows: Add resource files to xz.exe and xzdec.exe.
The command line tools cannot be built with MSVC for now but
they can be built with MinGW-w64.
Thanks to Iouri Kharon for the bug report and the original patch.
-rw-r--r-- | CMakeLists.txt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 84dd8edb..d91eb4ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -565,6 +565,14 @@ if(HAVE_GETOPT_LONG) target_link_libraries(xzdec PRIVATE liblzma) + if(WIN32) + # Add the Windows resource file for xzdec.exe. + target_sources(xz PRIVATE src/xzdec/xzdec_w32res.rc) + set_target_properties(xz PROPERTIES + LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/common/common_w32res.rc" + ) + endif() + tuklib_progname(xzdec) install(TARGETS xzdec @@ -636,6 +644,14 @@ if(NOT MSVC AND HAVE_GETOPT_LONG) target_compile_definitions(xz PRIVATE ASSUME_RAM=128) + if(WIN32) + # Add the Windows resource file for xz.exe. + target_sources(xz PRIVATE src/xz/xz_w32res.rc) + set_target_properties(xz PROPERTIES + LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/common/common_w32res.rc" + ) + endif() + tuklib_progname(xz) tuklib_mbstr(xz) |