Don't strip binaries when building through Xcode

Without this change building the Release version results in an error (which
claims to be a warning) due to using -s which is obsolete.
This removes -s when building through xcode - gnumake and other platforms are
(presumably) unaffected.
This commit is contained in:
Karl Goetz 2014-12-15 20:31:24 +11:00
parent a63faa70bd
commit 56a5cc6f98
1 changed files with 11 additions and 2 deletions

View File

@ -196,14 +196,23 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
# Release compiler flags
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 ${CMAKE_CXX_FLAGS_RELEASE} -O3 ")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -s") ## Strip binary
IF(CMAKE_GENERATOR STREQUAL Xcode)
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") ## Strip binary
ELSE()
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -s") ## Strip binary
ENDIF()
# Release with debug info compiler flags
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g -O3 ")
# Release minimum size compiler flags
SET(CMAKE_CXX_FLAGS_MINSIZEREL "-O3 ${CMAKE_CXX_FLAGS_MINSIZEREL} -O3 ")
SET(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} -s") ## Strip binary
SET(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL}") ## Strip binary
IF(CMAKE_GENERATOR STREQUAL Xcode)
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") ## Strip binary
ELSE()
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -s") ## Strip binary
ENDIF()
# Get the git revision info for the binary
SET(HAS_GIT "FALSE")