CMakeLists.txt: Disable PIE when using UPX since executables seem to crash on some systems when it is enabled
Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
parent
a9d460d096
commit
efe7d8ca57
|
@ -159,6 +159,8 @@ if (NOT (UPPERCASE_BUILD_TYPE STREQUAL "DEBUG" OR UPPERCASE_BUILD_TYPE STREQUAL
|
|||
include(FindSelfPackers)
|
||||
if (SELF_PACKER_FOR_EXECUTABLE MATCHES upx) # UPX version d61edc9 or higher is required when using a cross-compiler to target the musl C library
|
||||
set(SELF_PACKER_FOR_EXECUTABLE_FLAGS ${SELF_PACKER_FOR_EXECUTABLE_FLAGS} --ultra-brute --best)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE FALSE)
|
||||
set_target_properties(${EXENAME} PROPERTIES POSITION_INDEPENDENT_CODE ${CMAKE_POSITION_INDEPENDENT_CODE})
|
||||
endif()
|
||||
if (NOT SELF_PACKER_FOR_EXECUTABLE STREQUAL "SELF_PACKER_FOR_EXECUTABLE-NOTFOUND")
|
||||
add_custom_command(TARGET ${EXENAME} POST_BUILD COMMAND "${SELF_PACKER_FOR_EXECUTABLE}" ${SELF_PACKER_FOR_EXECUTABLE_FLAGS} $<TARGET_FILE:${EXENAME}> VERBATIM)
|
||||
|
|
Loading…
Reference in New Issue