From fa793cca25d4b51e407936592844e57a4007695a Mon Sep 17 00:00:00 2001 From: "gregory.hainaut" Date: Mon, 9 Aug 2010 19:05:02 +0000 Subject: [PATCH] cmake: * move machine optimization in the global setup. In same time use i686 instead of i486 * Also build the debug with fvisibility=hidden No reason to use it only on devel. (actually same as codeblock) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3628 96395faa-99c1-11dd-bbfe-3dabce05a288 --- cmake/BuildParameters.cmake | 12 +++++------- common/src/Utilities/CMakeLists.txt | 4 +--- common/src/x86emitter/CMakeLists.txt | 4 +--- pcsx2/CMakeLists.txt | 4 +--- plugins/CDVDiso/src/CMakeLists.txt | 2 +- plugins/CDVDnull/CMakeLists.txt | 2 +- plugins/FWnull/CMakeLists.txt | 2 +- plugins/GSnull/CMakeLists.txt | 3 +-- plugins/PadNull/CMakeLists.txt | 2 +- plugins/SPU2null/CMakeLists.txt | 2 +- plugins/USBnull/CMakeLists.txt | 2 +- plugins/dev9null/CMakeLists.txt | 2 +- plugins/onepad/CMakeLists.txt | 2 +- plugins/spu2-x/src/CMakeLists.txt | 3 +-- plugins/zzogl-pg/opengl/CMakeLists.txt | 7 +++---- 15 files changed, 21 insertions(+), 32 deletions(-) diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index 76adc36b75..a23bf175e2 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -96,10 +96,10 @@ endif(CMAKE_BUILD_STRIP) # 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 !!!") - string(STRIP "${USER_CMAKE_C_FLAGS} -m32" CMAKE_C_FLAGS) -else(DEFINED USER_CMAKE_C_FLAGS) - string(STRIP "-m32" CMAKE_C_FLAGS) + string(STRIP "${USER_CMAKE_C_FLAGS}" CMAKE_C_FLAGS) endif(DEFINED USER_CMAKE_C_FLAGS) +# Use some default machine flags +string(STRIP "${CMAKE_C_FLAGS} -m32 -msse -msse2 -march=i686" CMAKE_C_FLAGS) ### C++ flags @@ -108,11 +108,9 @@ endif(DEFINED USER_CMAKE_C_FLAGS) 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 !!!") string(STRIP "${USER_CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS) - string(STRIP "${USER_CMAKE_CXX_FLAGS} -m32" CMAKE_CXX_FLAGS) -else(DEFINED USER_CMAKE_CXX_FLAGS) - set(CMAKE_CXX_FLAGS "") - string(STRIP "-m32" CMAKE_CXX_FLAGS) endif(DEFINED USER_CMAKE_CXX_FLAGS) +# Use some default machine flags +string(STRIP "${CMAKE_CXX_FLAGS} -m32 -msse -msse2 -march=i686" CMAKE_CXX_FLAGS) #------------------------------------------------------------------------------- # Select library system vs 3rdparty diff --git a/common/src/Utilities/CMakeLists.txt b/common/src/Utilities/CMakeLists.txt index c9c824114e..a219b45a56 100644 --- a/common/src/Utilities/CMakeLists.txt +++ b/common/src/Utilities/CMakeLists.txt @@ -12,9 +12,7 @@ set(Output Utilities) # set common flags set(CommonFlags -pthread - -march=i486 - -msse - -msse2 + -fvisibility=hidden -fno-dse -fno-guess-branch-probability -fno-strict-aliasing diff --git a/common/src/x86emitter/CMakeLists.txt b/common/src/x86emitter/CMakeLists.txt index a6c64c0aa1..e20c275293 100644 --- a/common/src/x86emitter/CMakeLists.txt +++ b/common/src/x86emitter/CMakeLists.txt @@ -12,13 +12,11 @@ set(Output x86emitter) # set common flags set(CommonFlags -pthread + -fvisibility=hidden -fno-guess-branch-probability -fno-dse -fno-tree-dse -fno-strict-aliasing - -march=i486 - -msse - -msse2 -pipe -Wno-format -Wno-unused-parameter diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index dd4e21d435..866c07edd1 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -9,13 +9,11 @@ endif(NOT TOP_CMAKE_WAS_SOURCED) # set common flags set(CommonFlags -pthread + -fvisibility=hidden -fno-guess-branch-probability -fno-dse -fno-tree-dse -fno-strict-aliasing - -march=i486 - -msse - -msse2 -pipe -Wno-format -Wno-unused-parameter diff --git a/plugins/CDVDiso/src/CMakeLists.txt b/plugins/CDVDiso/src/CMakeLists.txt index 70b940e7f5..25a841ec25 100644 --- a/plugins/CDVDiso/src/CMakeLists.txt +++ b/plugins/CDVDiso/src/CMakeLists.txt @@ -10,12 +10,12 @@ endif(NOT TOP_CMAKE_WAS_SOURCED) set(Output CDVDiso) set(CommonFlags + -fvisibility=hidden -Wall -fpermissive ) set(OptimizationFlags - -fvisibility=hidden -O2 -DNDEBUG ) diff --git a/plugins/CDVDnull/CMakeLists.txt b/plugins/CDVDnull/CMakeLists.txt index 24f5b11671..8d063d22a1 100644 --- a/plugins/CDVDnull/CMakeLists.txt +++ b/plugins/CDVDnull/CMakeLists.txt @@ -10,11 +10,11 @@ endif(NOT TOP_CMAKE_WAS_SOURCED) set(Output CDVDnull) set(CommonFlags + -fvisibility=hidden -Wall ) set(OptimizationFlags - -fvisibility=hidden -O2 -DNDEBUG ) diff --git a/plugins/FWnull/CMakeLists.txt b/plugins/FWnull/CMakeLists.txt index f70b6af718..38e0d2176f 100644 --- a/plugins/FWnull/CMakeLists.txt +++ b/plugins/FWnull/CMakeLists.txt @@ -10,11 +10,11 @@ endif(NOT TOP_CMAKE_WAS_SOURCED) set(Output FWnull) set(CommonFlags + -fvisibility=hidden -Wall ) set(OptimizationFlags - -fvisibility=hidden -O2 ) diff --git a/plugins/GSnull/CMakeLists.txt b/plugins/GSnull/CMakeLists.txt index a702e3d706..f4f7322c4c 100644 --- a/plugins/GSnull/CMakeLists.txt +++ b/plugins/GSnull/CMakeLists.txt @@ -10,12 +10,11 @@ endif(NOT TOP_CMAKE_WAS_SOURCED) set(Output GSnull) set(CommonFlags + -fvisibility=hidden -Wall - -msse2 ) set(OptimizationFlags - -fvisibility=hidden -O2 -DNDEBUG ) diff --git a/plugins/PadNull/CMakeLists.txt b/plugins/PadNull/CMakeLists.txt index dff8218c88..a5d11495cb 100644 --- a/plugins/PadNull/CMakeLists.txt +++ b/plugins/PadNull/CMakeLists.txt @@ -9,11 +9,11 @@ endif(NOT TOP_CMAKE_WAS_SOURCED) set(Output PADnull) set(CommonFlags + -fvisibility=hidden -Wall ) set(OptimizationFlags - -fvisibility=hidden -O2 -DNDEBUG ) diff --git a/plugins/SPU2null/CMakeLists.txt b/plugins/SPU2null/CMakeLists.txt index 043d7d55be..4f0bdad78b 100644 --- a/plugins/SPU2null/CMakeLists.txt +++ b/plugins/SPU2null/CMakeLists.txt @@ -10,11 +10,11 @@ endif(NOT TOP_CMAKE_WAS_SOURCED) set(Output SPU2null) set(CommonFlags + -fvisibility=hidden -Wall ) set(OptimizationFlags - -fvisibility=hidden -O2 -DNDEBUG ) diff --git a/plugins/USBnull/CMakeLists.txt b/plugins/USBnull/CMakeLists.txt index b5d89ae326..5da7121146 100644 --- a/plugins/USBnull/CMakeLists.txt +++ b/plugins/USBnull/CMakeLists.txt @@ -10,11 +10,11 @@ endif(NOT TOP_CMAKE_WAS_SOURCED) set(Output USBnull) set(CommonFlags + -fvisibility=hidden -Wall ) set(OptimizationFlags - -fvisibility=hidden -O2 -DNDEBUG ) diff --git a/plugins/dev9null/CMakeLists.txt b/plugins/dev9null/CMakeLists.txt index 958abfd301..dfd2150dc6 100644 --- a/plugins/dev9null/CMakeLists.txt +++ b/plugins/dev9null/CMakeLists.txt @@ -10,11 +10,11 @@ endif(NOT TOP_CMAKE_WAS_SOURCED) set(Output dev9null) set(CommonFlags + -fvisibility=hidden -Wall ) set(OptimizationFlags - -fvisibility=hidden -O2 -DNDEBUG ) diff --git a/plugins/onepad/CMakeLists.txt b/plugins/onepad/CMakeLists.txt index ba95b83352..65a6ede0dd 100644 --- a/plugins/onepad/CMakeLists.txt +++ b/plugins/onepad/CMakeLists.txt @@ -10,11 +10,11 @@ endif(NOT TOP_CMAKE_WAS_SOURCED) set(Output onepad) set(CommonFlags + -fvisibility=hidden -Wall ) set(OptimizationFlags - -fvisibility=hidden -O2 -DNDEBUG ) diff --git a/plugins/spu2-x/src/CMakeLists.txt b/plugins/spu2-x/src/CMakeLists.txt index 616cf9470b..1f87419db8 100644 --- a/plugins/spu2-x/src/CMakeLists.txt +++ b/plugins/spu2-x/src/CMakeLists.txt @@ -10,12 +10,11 @@ endif(NOT TOP_CMAKE_WAS_SOURCED) set(Output spu2x) set(CommonFlags + -fvisibility=hidden -Wall - -msse2 ) set(OptimizationFlags - -fvisibility=hidden -O2 -DNDEBUG ) diff --git a/plugins/zzogl-pg/opengl/CMakeLists.txt b/plugins/zzogl-pg/opengl/CMakeLists.txt index cdba818851..fb31588644 100644 --- a/plugins/zzogl-pg/opengl/CMakeLists.txt +++ b/plugins/zzogl-pg/opengl/CMakeLists.txt @@ -11,14 +11,13 @@ set(Output zzogl) set(CommonFlags -pthread + -DZEROGS_SSE2 + -fno-regmove + -fno-strict-aliasing -Wno-format -Wno-unused-parameter -Wno-unused-value -Wunused-variable - -msse2 - -fno-regmove - -fno-strict-aliasing - -DZEROGS_SSE2 ) set(OptimizationFlags