1
0
Fork 0
mirror of https://git.tukaani.org/xz.git synced 2024-04-04 12:36:23 +02:00

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.
This commit is contained in:
Lasse Collin 2023-01-07 19:50:03 +02:00
parent e96dee55df
commit 706bce5018

View file

@ -611,6 +611,14 @@ if(HAVE_GETOPT_LONG)
target_link_libraries(xzdec PRIVATE liblzma) 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) tuklib_progname(xzdec)
install(TARGETS xzdec install(TARGETS xzdec
@ -682,6 +690,14 @@ if(NOT MSVC AND HAVE_GETOPT_LONG)
target_compile_definitions(xz PRIVATE ASSUME_RAM=128) 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_progname(xz)
tuklib_mbstr(xz) tuklib_mbstr(xz)