Skip to content

Commit b36648a

Browse files
committed
Add build stripped static executable if possible
1 parent cc7913a commit b36648a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ set_target_properties( ${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE TRUE
125125

126126
set_target_properties( ${PROJECT_NAME} PROPERTIES LINK_SEARCH_START_STATIC TRUE ) # Add "-Bstatic"
127127

128-
# Build static executable if possible
129-
if( NOT (CMAKE_SYSTEM_NAME MATCHES "Darwin" OR MSVC) )
130-
set( CMAKE_EXE_LINKER_FLAGS "-static" )
128+
# Build stripped static executable if possible
129+
if( (NOT (CMAKE_SYSTEM_NAME MATCHES "Darwin" OR MSVC)) AND (NOT (CMAKE_BUILD_TYPE STREQUAL "debug")))
130+
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -s" )
131131
endif()
132132

133133
# Checking for math library 'libm' used when including <math.h> in pilight sources

0 commit comments

Comments
 (0)