cmake: Change the way stripping is handled.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3021 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2010-05-16 00:12:10 +00:00
parent de91c8f30b
commit b363b7c715
18 changed files with 113 additions and 30 deletions

View File

@ -23,6 +23,21 @@ if(CMAKE_BUILD_TYPE STREQUAL "")
endif(CMAKE_BUILD_TYPE STREQUAL "")
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Set default strip option. Can be set with -DCMAKE_BUILD_STRIP=TRUE/FALSE
#-------------------------------------------------------------------------------
if(NOT DEFINED CMAKE_BUILD_STRIP)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(CMAKE_BUILD_STRIP TRUE)
message(STATUS "Enable the stripping by default in ${CMAKE_BUILD_TYPE} build !!!")
else(CMAKE_BUILD_TYPE STREQUAL "Release")
set(CMAKE_BUILD_STRIP FALSE)
message(STATUS "Disable the stripping by default in ${CMAKE_BUILD_TYPE} build !!!")
endif(CMAKE_BUILD_TYPE STREQUAL "Release")
endif(NOT DEFINED CMAKE_BUILD_STRIP)
#-------------------------------------------------------------------------------
# add additional project-wide include directories
include_directories(${PROJECT_SOURCE_DIR}/3rdparty
${PROJECT_SOURCE_DIR}/common/include

View File

@ -35,10 +35,6 @@ set(DebugFlags
-g
-W)
# set linker flags
set(LinkerFlags
-s)
# set optimization flags
set(OptimizationFlags
-falign-functions
@ -98,7 +94,7 @@ endif(CMAKE_BUILD_TYPE STREQUAL Devel)
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
add_definitions(${CommonFlags} ${OptimizationFlags} ${LinkerFlags})
add_definitions(${CommonFlags} ${OptimizationFlags})
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# variable with all sources of this library
@ -172,3 +168,8 @@ add_library(${UtilitiesName} STATIC ${UtilitiesSources} ${UtilitiesHeaders} ${Ut
# link target with wx
target_link_libraries(${UtilitiesName} ${wxWidgets_LIBRARIES})
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${UtilitiesName} -s)
endif (CMAKE_BUILD_STRIP)

View File

@ -35,10 +35,6 @@ set(DebugFlags
-W
-g)
# set linker flags
set(LinkerFlags
-s)
# set optimization flags
set(OptimizationFlags
-falign-functions
@ -80,7 +76,6 @@ set(OptimizationFlags
-ftree-vrp
-funit-at-a-time)
# Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug)
@ -99,7 +94,7 @@ endif(CMAKE_BUILD_TYPE STREQUAL Devel)
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
add_definitions(${CommonFlags} ${OptimizationFlags} ${LinkerFlags})
add_definitions(${CommonFlags} ${OptimizationFlags})
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# variable with all sources of this library
@ -155,3 +150,7 @@ add_library(${x86emitterName} STATIC ${x86emitterSources} ${x86emitterHeaders})
# link target with wx
target_link_libraries(${x86emitterName} ${wxWidgets_LIBRARIES})
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${x86emitterName} -s)
endif (CMAKE_BUILD_STRIP)

View File

@ -32,10 +32,6 @@ set(DebugFlags
-W
-g)
# set linker flags
set(LinkerFlags
-s)
# set optimization flags
set(OptimizationFlags
-falign-functions
@ -104,7 +100,7 @@ if(CMAKE_BUILD_TYPE STREQUAL Release)
set(pcsx2Name pcsx2)
# add defines
add_definitions(${CommonFlags} ${OptimizationFlags} ${LinkerFlags} -DWX_PRECOMP -DNDEBUG)
add_definitions(${CommonFlags} ${OptimizationFlags} -DWX_PRECOMP -DNDEBUG)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# you must have both svn client executable and a source that contains svn metadata
@ -648,3 +644,7 @@ else(projectZLIB)
target_link_libraries(${pcsx2Name} ${ZLIB_LIBRARIES})
endif(projectZLIB)
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${pcsx2Name} -s)
endif (CMAKE_BUILD_STRIP)

View File

@ -66,4 +66,8 @@ target_link_libraries(${CDVDisoName} ${BZIP2_LIBRARIES})
# Set link flags
target_link_libraries(${CDVDisoName} -m32)
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${CDVDisoName} -s)
endif (CMAKE_BUILD_STRIP)

View File

@ -18,7 +18,7 @@ endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
add_definitions(-Wall -fPIC -m32 -O2 -s)
add_definitions(-Wall -fPIC -m32 -O2)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# CDVDnull sources
@ -61,6 +61,11 @@ add_library(${CDVDnullName} SHARED
${CDVDnullHeaders}
${CDVDnullLinuxSources}
${CDVDnullLinuxHeaders})
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${CDVDnullName} -s)
endif (CMAKE_BUILD_STRIP)
# set output directory
set_target_properties(${CDVDnullName} PROPERTIES

View File

@ -18,7 +18,7 @@ endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
add_definitions(-Wall -fPIC -m32 -O2 -s)
add_definitions(-Wall -fPIC -m32 -O2)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# FWnull sources
@ -59,6 +59,11 @@ add_library(${FWnullName} SHARED
${FWnullHeaders}
${FWnullLinuxSources}
${FWnullLinuxHeaders})
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${FWnullName} -s)
endif (CMAKE_BUILD_STRIP)
# set output directory
set_target_properties(${FWnullName} PROPERTIES

View File

@ -18,7 +18,7 @@ endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
add_definitions(-Wall -fPIC -m32 -O2 -msse2 -s)
add_definitions(-Wall -fPIC -m32 -O2 -msse2)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# GSnull sources
@ -81,6 +81,11 @@ add_library(${GSnullName} SHARED
${GSnullnullHeaders}
${GSnullLinuxSources}
${GSnullLinuxHeaders})
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${GSnullName} -s)
endif (CMAKE_BUILD_STRIP)
# set output directory
set_target_properties(${GSnullName} PROPERTIES

View File

@ -18,7 +18,7 @@ endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
add_definitions(-Wall -fPIC -m32 -O2 -s)
add_definitions(-Wall -fPIC -m32 -O2)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# PadNull sources
@ -67,6 +67,11 @@ add_library(${PadNullName} SHARED
${PadNullHeaders}
${PadNullLinuxSources}
${PadNullLinuxHeaders})
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${PadNullName} -s)
endif (CMAKE_BUILD_STRIP)
# set output directory
set_target_properties(${PadNullName} PROPERTIES

View File

@ -18,7 +18,7 @@ endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
add_definitions(-Wall -fPIC -m32 -O2 -s)
add_definitions(-Wall -fPIC -m32 -O2)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# SPU2null sources
@ -63,6 +63,11 @@ add_library(${SPU2nullName} SHARED
${SPU2nullHeaders}
${SPU2nullLinuxSources}
${SPU2nullLinuxHeaders})
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${SPU2nullName} -s)
endif (CMAKE_BUILD_STRIP)
# set output directory
set_target_properties(${SPU2nullName} PROPERTIES

View File

@ -18,7 +18,7 @@ endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
add_definitions(-Wall -fPIC -m32 -O2 -s)
add_definitions(-Wall -fPIC -m32 -O2)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# USBnull sources
@ -59,6 +59,11 @@ add_library(${USBnullName} SHARED
${USBnullHeaders}
${USBnullLinuxSources}
${USBnullLinuxHeaders})
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${USBnullName} -s)
endif (CMAKE_BUILD_STRIP)
# set output directory
set_target_properties(${USBnullName} PROPERTIES

View File

@ -18,7 +18,7 @@ endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
add_definitions(-Wall -fPIC -m32 -O2 -s)
add_definitions(-Wall -fPIC -m32 -O2)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# dev9null sources
@ -56,6 +56,11 @@ add_library(${dev9nullName} SHARED
${dev9nullHeaders}
${dev9nullLinuxSources}
${dev9nullLinuxHeaders})
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${dev9nullName} -s)
endif (CMAKE_BUILD_STRIP)
# set output directory
set_target_properties(${dev9nullName} PROPERTIES

View File

@ -18,7 +18,7 @@ endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
add_definitions(-Wall -fPIC -m32 -O2 -s)
add_definitions(-Wall -fPIC -m32 -O2)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# onepad sources
@ -70,6 +70,11 @@ add_library(${onepadName} SHARED
${onepadHeaders}
${onepadLinuxSources}
${onepadLinuxHeaders})
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${onepadName} -s)
endif (CMAKE_BUILD_STRIP)
# set output directory
set_target_properties(${onepadName} PROPERTIES

View File

@ -28,7 +28,7 @@ endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
add_definitions(-Wall -fPIC -m32 -msse2 -s -DNDEBUG)
add_definitions(-Wall -fPIC -m32 -msse2 -DNDEBUG)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# spu2x sources
@ -128,3 +128,9 @@ endif(projectSoundTouch)
# link target with A52
target_link_libraries(${spu2xName} a52)
target_link_libraries(${spu2xName} -m32)
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${spu2xName} -s)
endif (CMAKE_BUILD_STRIP)

View File

@ -18,7 +18,7 @@ endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
add_definitions(-Wall -m32 -O2 -s)
add_definitions(-Wall -m32 -O2)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# zerogs sources
@ -129,4 +129,8 @@ target_link_libraries(${zerogsName} ${X11_LIBRARIES})
# link target with X11 videomod
target_link_libraries(${zerogsName} ${X11_Xxf86vm_LIB})
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${zerogsName} -s)
endif (CMAKE_BUILD_STRIP)

View File

@ -81,3 +81,8 @@ target_link_libraries(${zeropadName} ${SDL_LIBRARY})
# Set link flag
target_link_libraries(${zeropadName} -m32)
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${zeropadName} -s)
endif (CMAKE_BUILD_STRIP)

View File

@ -18,7 +18,7 @@ endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
add_definitions(-Wall -fPIC -m32 -msse2 -O2 -s)
add_definitions(-Wall -fPIC -m32 -msse2 -O2)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# zerospu2 sources
@ -100,4 +100,8 @@ if(projectSoundTouch)
else(projectSoundTouch)
target_link_libraries(${zerospu2Name} ${SOUNDTOUCH_LIBRARIES})
endif(projectSoundTouch)
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${zerospu2Name} -s)
endif (CMAKE_BUILD_STRIP)

View File

@ -157,3 +157,8 @@ target_link_libraries(${zzoglName} ${X11_Xxf86vm_LIB})
# Set link flag
target_link_libraries(${zzoglName} -m32)
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${zzoglName} -s)
endif (CMAKE_BUILD_STRIP)