Skip to content

Commit 56c9343

Browse files
committed
Improve binary size further
This should actually make the binaries more reasonably sized.
1 parent bbe6d11 commit 56c9343

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

CMakeLists.txt

+9-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ else()
107107
set(GODOT_COMPILE_FLAGS "-fPIC -fvisibility=hidden -fvisibility-inlines-hidden -fexceptions -frtti -pthread")
108108

109109
if(CMAKE_BUILD_TYPE MATCHES Debug)
110-
set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -g -fno-omit-frame-pointer -O0")
110+
set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -fno-omit-frame-pointer -O0")
111111
else()
112112
set(GODOT_COMPILE_FLAGS "${GODOT_COMPILE_FLAGS} -O3")
113113
endif()
@@ -119,6 +119,14 @@ set_property(TARGET libopenmpt APPEND_STRING PROPERTY COMPILE_FLAGS ${GODOT_COMP
119119
set_property(TARGET ${PROJECT_NAME} APPEND_STRING PROPERTY LINK_FLAGS ${GODOT_LINKER_FLAGS})
120120
set_property(TARGET libopenmpt APPEND_STRING PROPERTY LINK_FLAGS ${GODOT_LINKER_FLAGS})
121121

122+
# Only generate debug symbols for the main extension... NOT libopenmpt.
123+
# Otherwise the binary sizes will be out of control.
124+
# Comment this out and compile if you really need to debug what libopenmpt is doing
125+
# (you probably don't)
126+
if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" AND CMAKE_BUILD_TYPE MATCHES Debug)
127+
set_property(TARGET ${PROJECT_NAME} APPEND_STRING PROPERTY COMPILE_FLAGS "-g")
128+
endif()
129+
122130
# Create the correct name (godot.os.build_type.system_bits)
123131
# Synchronized with godot-cpp's CMakeLists.txt
124132

0 commit comments

Comments
 (0)