mirror of
https://github.com/mhx/dwarfs.git
synced 2025-08-04 02:06:22 -04:00
build: make UPX executable optional (not available e.g. on RISC-V)
This commit is contained in:
parent
e626bf4bc8
commit
ddcf7d3697
@ -1042,16 +1042,18 @@ if(STATIC_BUILD_DO_NOT_USE OR WIN32)
|
|||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
find_program(UPX_EXE upx upx.exe PATHS "c:/bin" DOC "ultimate packer for executables" REQUIRED)
|
find_program(UPX_EXE upx upx.exe PATHS "c:/bin" DOC "ultimate packer for executables")
|
||||||
|
|
||||||
# upx -9 is a good compromise between compression ratio and speed
|
if(UPX_EXE)
|
||||||
# also, anything above --best increases the startup time of the compressed
|
# upx -9 is a good compromise between compression ratio and speed
|
||||||
# executable significantly
|
# also, anything above --best increases the startup time of the compressed
|
||||||
add_custom_command(
|
# executable significantly
|
||||||
OUTPUT ${UNIVERSAL_OUT}
|
add_custom_command(
|
||||||
COMMAND ${UPX_EXE} -9 --best -o ${UNIVERSAL_OUT} $<TARGET_FILE:${tgt}>
|
OUTPUT ${UNIVERSAL_OUT}
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
COMMAND ${UPX_EXE} -9 --best -o ${UNIVERSAL_OUT} $<TARGET_FILE:${tgt}>
|
||||||
)
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND UNIVERSAL_UPX_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/${UNIVERSAL_OUT})
|
list(APPEND UNIVERSAL_UPX_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/${UNIVERSAL_OUT})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user