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

@ -67,3 +67,7 @@ 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
@ -62,6 +62,11 @@ add_library(${CDVDnullName} SHARED
${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
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins)

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
@ -60,6 +60,11 @@ add_library(${FWnullName} SHARED
${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
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins)

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
@ -82,6 +82,11 @@ add_library(${GSnullName} SHARED
${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
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins)

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
@ -68,6 +68,11 @@ add_library(${PadNullName} SHARED
${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
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins)

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
@ -64,6 +64,11 @@ add_library(${SPU2nullName} SHARED
${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
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins)

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
@ -60,6 +60,11 @@ add_library(${USBnullName} SHARED
${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
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins)

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
@ -57,6 +57,11 @@ add_library(${dev9nullName} SHARED
${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
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins)

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
@ -71,6 +71,11 @@ add_library(${onepadName} SHARED
${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
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins)

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
@ -130,3 +130,7 @@ 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
@ -101,3 +101,7 @@ 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)