Browse Source

CMake: Always strip the Release binary

pull/5315/head
Gleb Mazovetskiy 4 years ago committed by Anders Jenbo
parent
commit
1334ee8b96
  1. 3
      CMake/platforms/n3ds.cmake
  2. 40
      CMake/platforms/ps4.cmake
  3. 8
      CMakeLists.txt

3
CMake/platforms/n3ds.cmake

@ -23,6 +23,9 @@ list(APPEND DEVILUTIONX_PLATFORM_SUBDIRECTORIES platform/ctr)
list(APPEND DEVILUTIONX_PLATFORM_LINK_LIBRARIES libdevilutionx_ctr)
list(APPEND DEVILUTIONX_PLATFORM_COMPILE_DEFINITIONS __3DS__)
# The 3ds build handles the stripping in a custom way.
set(DEVILUTIONX_DISABLE_STRIP ON)
#SDL video mode parameters
set(SDL1_VIDEO_MODE_FLAGS SDL_DOUBLEBUF|SDL_HWSURFACE)
set(SDL1_FORCE_SVID_VIDEO_MODE ON)

40
CMake/platforms/ps4.cmake

@ -1,19 +1,21 @@
set(DISCORD_INTEGRATION OFF)
set(BUILD_TESTING OFF)
set(ASAN OFF)
set(UBSAN OFF)
SET(DISABLE_LTO ON)
set(NONET ON)
set(NOEXIT ON)
set(BUILD_ASSETS_MPQ ON)
# Packbrew SDK provides SDL_image, but FindSDL2_image() fails to
# pick up its dependencies (with includes libjpeg, libwebp etc).
# One way to address this, is to do the following:
#
# target_link_libraries(${BIN_TARGET} PUBLIC ${PC_SDL2_image_LIBRARIES})
#
# or simply use the in-tree copy as follows:
set(DEVILUTIONX_SYSTEM_SDL_IMAGE OFF)
set(DISCORD_INTEGRATION OFF)
set(BUILD_TESTING OFF)
set(ASAN OFF)
set(UBSAN OFF)
SET(DISABLE_LTO ON)
set(NONET ON)
set(NOEXIT ON)
set(BUILD_ASSETS_MPQ ON)
# Packbrew SDK provides SDL_image, but FindSDL2_image() fails to
# pick up its dependencies (with includes libjpeg, libwebp etc).
# One way to address this, is to do the following:
#
# target_link_libraries(${BIN_TARGET} PUBLIC ${PC_SDL2_image_LIBRARIES})
#
# or simply use the in-tree copy as follows:
set(DEVILUTIONX_SYSTEM_SDL_IMAGE OFF)
# If the executable is stripped, create-fself fails with:
# Failed to build FSELF: no symbol section
set(DEVILUTIONX_DISABLE_STRIP ON)

8
CMakeLists.txt

@ -301,6 +301,14 @@ else()
Packaging/windows/devilutionx.rc
Packaging/apple/AppIcon.icns
Packaging/apple/LaunchScreen.storyboard)
if(CMAKE_STRIP AND NOT DEVILUTIONX_DISABLE_STRIP)
add_custom_command(
TARGET ${BIN_TARGET} POST_BUILD
DEPENDS ${BIN_TARGET}
COMMAND $<$<CONFIG:Release>:${CMAKE_STRIP}>
ARGS --strip-all $<TARGET_FILE:${BIN_TARGET}>)
endif()
endif()
if(NOT UWP_LIB)

Loading…
Cancel
Save