From f85873a7b09117b6c63f12d7ff3edc831f76086f Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Tue, 9 Jan 2024 20:30:08 +0100 Subject: [PATCH] build: use upx -9 for universal binaries --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a07c044c..558ffe47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1042,9 +1042,12 @@ if(STATIC_BUILD_DO_NOT_USE OR WIN32) set(UNIVERSAL_PACKED "dwarfs-universal-${PRJ_VERSION_FULL}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}${CMAKE_EXECUTABLE_SUFFIX}") + # upx -9 is a good compromise between compression ratio and speed + # also, anything above --best increases the startup time of the compressed + # executable significantly add_custom_command( OUTPUT ${UNIVERSAL_PACKED} - COMMAND ${UPX_EXE} -o ${UNIVERSAL_PACKED} $ + COMMAND ${UPX_EXE} -9 -o ${UNIVERSAL_PACKED} $ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )