* Major rework of the linker flags. Use some globals flags for -s and -m32
  Add a USER_CMAKE_LD_FLAGS variable. Easier to play with advanced link flags for future gcc version (>=4.5)
* Remove useless stub file
[debian]
* minor dependency fix


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3475 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gregory.hainaut 2010-07-13 09:16:13 +00:00
parent 56d3982dc5
commit b326504054
27 changed files with 59 additions and 236 deletions

View File

@ -4,7 +4,6 @@
set(SoundTouchName pcsx2_SoundTouch)
set(CommonFlags
-m32
-march=athlon-xp
-march=prescott
)
@ -61,6 +60,3 @@ set(SoundTouchHeaders
# add library
add_library(${SoundTouchName} STATIC ${SoundTouchSources} ${SoundTouchHeaders})
# Force the linker into 32 bits mode
target_link_libraries(${SoundTouchName} -m32)

View File

@ -4,7 +4,6 @@
set(bzip2Name pcsx2_bzip2)
set(CommonFlags
-m32
-march=athlon-xp
-march=prescott
)
@ -49,6 +48,3 @@ set(bzip2Headers
# add library
add_library(${bzip2Name} STATIC ${bzip2Sources} ${bzip2Headers})
# Force the linker into 32 bits mode
target_link_libraries(${bzip2Name} -m32)

View File

@ -5,7 +5,6 @@ set(a52Name pcsx2_a52)
set(CommonFlags
-Wall
-m32
-g
)
@ -54,6 +53,3 @@ set(a52Headers
# add library
add_library(${a52Name} STATIC ${a52Sources} ${a52Headers})
# Force the linker into 32 bits mode
target_link_libraries(${a52Name} -m32)

View File

@ -5,7 +5,6 @@ set(zlibName pcsx2_zlib)
set(CommonFlags
-W
-m32
)
set(OptimizationFlags
@ -64,7 +63,3 @@ inftrees.h )
# add library
add_library(${zlibName} STATIC ${zlibSources} ${zlibHeaders})
# Force the linker into 32 bits mode
target_link_libraries(${zlibName} -m32)

View File

@ -36,7 +36,8 @@ endif(EXISTS "${PROJECT_SOURCE_DIR}/3rdparty")
# make common
if(common_libs)
add_subdirectory(common)
add_subdirectory(common/src/Utilities)
add_subdirectory(common/src/x86emitter)
endif(common_libs)
# make tools

View File

@ -8,8 +8,36 @@
### Add some flags to the build process
# control C flags : -DUSER_CMAKE_C_FLAGS="cflags"
# control C++ flags : -DUSER_CMAKE_CXX_FLAGS="cxxflags"
# control link flags : -DUSER_CMAKE_LD_FLAGS="ldflags"
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# if no build type is set, use Devel as default
# Note without the CMAKE_BUILD_TYPE options the value is still defined to ""
# Ensure that the value set by the User is correct to avoid some bad behavior later
#-------------------------------------------------------------------------------
if(NOT CMAKE_BUILD_TYPE MATCHES "Debug|Devel|Release")
set(CMAKE_BUILD_TYPE Devel)
message(STATUS "BuildType set to ${CMAKE_BUILD_TYPE} by default")
endif(NOT CMAKE_BUILD_TYPE MATCHES "Debug|Devel|Release")
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# 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)
#-------------------------------------------------------------------------------
# Control GCC flags
#-------------------------------------------------------------------------------
### Cmake set default value for various compilation variable
### Here the list of default value for documentation purpose
# ${CMAKE_SHARED_LIBRARY_CXX_FLAGS} = "-fPIC"
@ -46,46 +74,46 @@ set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
#-------------------------------------------------------------------------------
# Allow user to set some default flags
# By default do not use any flags
# Note: string STRIP must be used to remove trailing and leading spaces.
# See policy CMP0004
#-------------------------------------------------------------------------------
### linker flags
if(DEFINED USER_CMAKE_LD_FLAGS)
message(STATUS "Pcsx2 is very sensible with gcc flags, so use USER_CMAKE_LD_FLAGS at your own risk !!!")
string(STRIP "${USER_CMAKE_LD_FLAGS}" USER_CMAKE_LD_FLAGS)
else(DEFINED USER_CMAKE_LD_FLAGS)
set(USER_CMAKE_LD_FLAGS "")
endif(DEFINED USER_CMAKE_LD_FLAGS)
# ask the linker to strip the binary
if(CMAKE_BUILD_STRIP)
string(STRIP "${USER_CMAKE_LD_FLAGS} -s" USER_CMAKE_LD_FLAGS)
endif(CMAKE_BUILD_STRIP)
### c flags
# Note CMAKE_C_FLAGS is also send to the linker.
# By default allow build on amd64 machine
if(DEFINED USER_CMAKE_C_FLAGS)
message(STATUS "Pcsx2 is very sensible with gcc flags, so use USER_CMAKE_C_FLAGS at your own risk !!!")
set(CMAKE_C_FLAGS "${USER_CMAKE_C_FLAGS}")
string(STRIP "${USER_CMAKE_C_FLAGS} ${USER_CMAKE_LD_FLAGS} -m32" CMAKE_C_FLAGS)
else(DEFINED USER_CMAKE_C_FLAGS)
set(CMAKE_C_FLAGS "")
string(STRIP "${USER_CMAKE_LD_FLAGS} -m32" CMAKE_C_FLAGS)
endif(DEFINED USER_CMAKE_C_FLAGS)
### C++ flags
# Note CMAKE_CXX_FLAGS is also send to the linker.
# By default allow build on amd64 machine
if(DEFINED USER_CMAKE_CXX_FLAGS)
message(STATUS "Pcsx2 is very sensible with gcc flags, so use USER_CMAKE_CXX_FLAGS at your own risk !!!")
set(CMAKE_CXX_FLAGS "${USER_CMAKE_CXX_FLAGS}")
string(STRIP "${USER_CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS)
string(STRIP "${USER_CMAKE_CXX_FLAGS} ${USER_CMAKE_LD_FLAGS} -m32" CMAKE_CXX_FLAGS)
else(DEFINED USER_CMAKE_CXX_FLAGS)
set(CMAKE_CXX_FLAGS "")
string(STRIP "${USER_CMAKE_LD_FLAGS} -m32" CMAKE_CXX_FLAGS)
endif(DEFINED USER_CMAKE_CXX_FLAGS)
#-------------------------------------------------------------------------------
# if no build type is set, use Devel as default
# Note without the CMAKE_BUILD_TYPE options the value is still defined to ""
# Ensure that the value set by the User is correct to avoid some bad behavior later
#-------------------------------------------------------------------------------
if(NOT CMAKE_BUILD_TYPE MATCHES "Debug|Devel|Release")
set(CMAKE_BUILD_TYPE Devel)
message(STATUS "BuildType set to ${CMAKE_BUILD_TYPE} by default")
endif(NOT CMAKE_BUILD_TYPE MATCHES "Debug|Devel|Release")
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# 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)
#-------------------------------------------------------------------------------
# Select library system vs 3rdparty
#-------------------------------------------------------------------------------

View File

@ -1,5 +0,0 @@
# src
add_subdirectory(src)

View File

@ -1,13 +0,0 @@
# Check that people use the good file
if(NOT TOP_CMAKE_WAS_SOURCED)
message(FATAL_ERROR "
You did not 'cmake' the good CMakeLists.txt file. Use the one in the top dir.
It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt")
endif(NOT TOP_CMAKE_WAS_SOURCED)
# make Utilities
add_subdirectory(Utilities)
# make x86emitter
add_subdirectory(x86emitter)

View File

@ -12,7 +12,6 @@ set(UtilitiesName Utilities)
# set common flags
set(CommonFlags
-pthread
-m32
-march=i486
-msse
-msse2
@ -171,11 +170,3 @@ add_library(${UtilitiesName} STATIC ${UtilitiesSources} ${UtilitiesHeaders} ${Ut
# link target with wx
target_link_libraries(${UtilitiesName} ${wxWidgets_LIBRARIES})
# Force the linker into 32 bits mode
target_link_libraries(${UtilitiesName} -m32)
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${UtilitiesName} -s)
endif (CMAKE_BUILD_STRIP)

View File

@ -16,7 +16,6 @@ set(CommonFlags
-fno-dse
-fno-tree-dse
-fno-strict-aliasing
-m32
-march=i486
-msse
-msse2
@ -144,11 +143,3 @@ add_library(${x86emitterName} STATIC ${x86emitterSources} ${x86emitterHeaders})
# link target with wx
target_link_libraries(${x86emitterName} ${wxWidgets_LIBRARIES})
# Force the linker into 32 bits mode
target_link_libraries(${x86emitterName} -m32)
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${x86emitterName} -s)
endif (CMAKE_BUILD_STRIP)

View File

@ -12,7 +12,7 @@ Build-Depends: debhelper (>= 7.0.50), dpkg-dev (>= 1.15.5.6), cmake (>=2.8),
libwxgtk2.8-dev (>= 2.8.10), libwxgtk2.8-dev (<< 2.8.11),
libgtk2.0-dev (>= 2.16),
liba52-0.7.4-dev,
libasound2-dev | lib32asound2 [amd64],
libasound2-dev | lib32asound2-dev [amd64],
portaudio19-dev,
# version not yet in debian
# libsoundtouch1-dev (>= 1.5),

View File

@ -13,7 +13,6 @@ set(CommonFlags
-fno-dse
-fno-tree-dse
-fno-strict-aliasing
-m32
-march=i486
-msse
-msse2
@ -642,11 +641,3 @@ endif(Linux)
# link target with zlib
target_link_libraries(${pcsx2Name} ${ZLIB_LIBRARIES})
# Force the linker into 32 bits mode
target_link_libraries(${pcsx2Name} -m32)
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${pcsx2Name} -s)
endif (CMAKE_BUILD_STRIP)

View File

@ -11,7 +11,6 @@ set(CDVDisoName CDVDiso)
set(CommonFlags
-Wall
-m32
-fpermissive
)
@ -80,11 +79,3 @@ set_target_properties(${CDVDisoName} PROPERTIES
# Link with bz2
target_link_libraries(${CDVDisoName} ${BZIP2_LIBRARIES})
# Force the linker into 32 bits mode
target_link_libraries(${CDVDisoName} -m32)
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${CDVDisoName} -s)
endif (CMAKE_BUILD_STRIP)

View File

@ -5,7 +5,6 @@ set(CDVDlinuzName CDVDlinuz)
set(CommonFlags
-Wall
-m32
-fPIC
-D_LARGEFILE64_SOURCE
)
@ -92,11 +91,3 @@ add_library(${CDVDlinuzName} SHARED
# set output directory
set_target_properties(${CDVDlinuzName} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins)
# Set link flags
target_link_libraries(${CDVDlinuzName} -m32)
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${CDVDlinuzName} -s)
endif (CMAKE_BUILD_STRIP)

View File

@ -11,7 +11,6 @@ set(CDVDnullName CDVDnull)
set(CommonFlags
-Wall
-m32
)
set(OptimizationFlags
@ -63,15 +62,6 @@ add_library(${CDVDnullName} SHARED
${CDVDnullHeaders}
)
# Force the linker into 32 bits mode
target_link_libraries(${CDVDnullName} -m32)
# 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

@ -11,7 +11,6 @@ set(FWnullName FWnull)
set(CommonFlags
-Wall
-m32
)
set(OptimizationFlags
@ -75,15 +74,6 @@ add_library(${FWnullName} SHARED
${FWnullLinuxSources}
${FWnullLinuxHeaders})
# Force the linker into 32 bits mode
target_link_libraries(${FWnullName} -m32)
# 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

@ -11,7 +11,6 @@ set(GSnullName GSnull)
set(CommonFlags
-Wall
-m32
-msse2
)
@ -93,15 +92,6 @@ add_library(${GSnullName} SHARED
${GSnullLinuxSources}
${GSnullLinuxHeaders})
# Force the linker into 32 bits mode
target_link_libraries(${GSnullName} -m32)
# 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

@ -8,7 +8,6 @@ endif(NOT TOP_CMAKE_WAS_SOURCED)
set(CommonFlags
-Wall
-m32
)
set(OptimizationFlags
@ -75,15 +74,6 @@ add_library(${PadNullName} SHARED
${PadNullLinuxSources}
${PadNullLinuxHeaders})
# Force the linker into 32 bits mode
target_link_libraries(${PadNullName} -m32)
# 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

@ -11,7 +11,6 @@ set(SPU2nullName SPU2null)
set(CommonFlags
-Wall
-m32
)
set(OptimizationFlags
@ -74,16 +73,6 @@ add_library(${SPU2nullName} SHARED
${SPU2nullLinuxSources}
${SPU2nullLinuxHeaders})
# Force the linker into 32 bits mode
target_link_libraries(${SPU2nullName} -m32)
# 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

@ -11,7 +11,6 @@ set(USBnullName USBnull)
set(CommonFlags
-Wall
-m32
)
set(OptimizationFlags
@ -76,15 +75,6 @@ add_library(${USBnullName} SHARED
${USBnullLinuxSources}
${USBnullLinuxHeaders})
# Force the linker into 32 bits mode
target_link_libraries(${USBnullName} -m32)
# 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

@ -11,7 +11,6 @@ set(dev9nullName dev9null)
set(CommonFlags
-Wall
-m32
)
set(OptimizationFlags
@ -73,15 +72,6 @@ add_library(${dev9nullName} SHARED
${dev9nullLinuxSources}
${dev9nullLinuxHeaders})
# Force the linker into 32 bits mode
target_link_libraries(${dev9nullName} -m32)
# 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

@ -11,7 +11,6 @@ set(onepadName onepad)
set(CommonFlags
-Wall
-m32
)
set(OptimizationFlags
@ -82,18 +81,9 @@ add_library(${onepadName} SHARED
${onepadLinuxSources}
${onepadLinuxHeaders})
# Force the linker into 32 bits mode
target_link_libraries(${onepadName} -m32)
# 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)
# link target with SDL
target_link_libraries(${onepadName} ${SDL_LIBRARY})

View File

@ -11,7 +11,6 @@ set(spu2xName spu2x)
set(CommonFlags
-Wall
-m32
-msse2
)
@ -127,11 +126,3 @@ target_link_libraries(${spu2xName} ${SOUNDTOUCH_LIBRARIES})
# link target with A52
target_link_libraries(${spu2xName} ${A52_LIBRARIES})
# Force the linker into 32 bits mode
target_link_libraries(${spu2xName} -m32)
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${spu2xName} -s)
endif (CMAKE_BUILD_STRIP)

View File

@ -5,7 +5,6 @@ set(zerogsName zerogs)
set(CommonFlags
-Wall
-m32
)
set(OptimizationFlags
@ -138,11 +137,3 @@ target_link_libraries(${zerogsName} ${X11_LIBRARIES})
# link target with X11 videomod
target_link_libraries(${zerogsName} ${X11_Xxf86vm_LIB})
# Force the linker into 32 bits mode
target_link_libraries(${zerogsName} -m32)
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${zerogsName} -s)
endif (CMAKE_BUILD_STRIP)

View File

@ -11,7 +11,6 @@ set(zeropadName zeropad)
set(CommonFlags
-Wall
-m32
-fpic
)
@ -97,11 +96,3 @@ set_target_properties(${zeropadName} PROPERTIES
# link target with SDL
target_link_libraries(${zeropadName} ${SDL_LIBRARY})
# Force the linker into 32 bits mode
target_link_libraries(${zeropadName} -m32)
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${zeropadName} -s)
endif (CMAKE_BUILD_STRIP)

View File

@ -11,7 +11,6 @@ set(zerospu2Name zerospu2)
set(CommonFlags
-Wall
-m32
-msse2
)
@ -107,11 +106,3 @@ endif(PORTAUDIO_FOUND)
# link target with SoundTouch
target_link_libraries(${zerospu2Name} ${SOUNDTOUCH_LIBRARIES})
# Force the linker into 32 bits mode
target_link_libraries(${zerospu2Name} -m32)
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${zerospu2Name} -s)
endif (CMAKE_BUILD_STRIP)

View File

@ -11,7 +11,6 @@ set(zzoglName zzogl)
set(CommonFlags
-pthread
-m32
-Wno-format
-Wno-unused-parameter
-Wno-unused-value
@ -158,11 +157,3 @@ target_link_libraries(${zzoglName} ${X11_LIBRARIES})
# link target with X11 videomod
target_link_libraries(${zzoglName} ${X11_Xxf86vm_LIB})
# Force the linker into 32 bits mode
target_link_libraries(${zzoglName} -m32)
# Linker strip option
if (CMAKE_BUILD_STRIP)
target_link_libraries(${zzoglName} -s)
endif (CMAKE_BUILD_STRIP)