From 732cb887087f442829a48a81ccc279c898341f8c Mon Sep 17 00:00:00 2001 From: "gregory.hainaut" Date: Fri, 4 Jun 2010 11:07:25 +0000 Subject: [PATCH] [cmake]: * remove the dependency on libportaudiocpp as codeblock. (issue 721) * Improve build on 64 bit system git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3151 96395faa-99c1-11dd-bbfe-3dabce05a288 --- 3rdparty/SoundTouch/CMakeLists.txt | 12 ++++++-- 3rdparty/bzip2/CMakeLists.txt | 12 ++++++-- 3rdparty/liba52/CMakeLists.txt | 18 +++++++++-- 3rdparty/zlib/CMakeLists.txt | 49 ++++++++++++++++-------------- cmake/FindPortAudio.cmake | 6 ++-- cmake/SearchForStuff.cmake | 3 ++ 6 files changed, 67 insertions(+), 33 deletions(-) diff --git a/3rdparty/SoundTouch/CMakeLists.txt b/3rdparty/SoundTouch/CMakeLists.txt index 1faefb3191..fa2cc7b15c 100644 --- a/3rdparty/SoundTouch/CMakeLists.txt +++ b/3rdparty/SoundTouch/CMakeLists.txt @@ -3,22 +3,28 @@ # library name set(SoundTouchName SoundTouch) +set(CommonFlags + -m32 + -march=athlon-xp + -march=prescott + ) + # Debug - Build if(CMAKE_BUILD_TYPE STREQUAL Debug) # add defines - add_definitions(-g -O0 -march=athlon-xp -march=prescott -m32) + add_definitions(${CommonFlags} -g -O0) endif(CMAKE_BUILD_TYPE STREQUAL Debug) # Devel - Build if(CMAKE_BUILD_TYPE STREQUAL Devel) # add defines - add_definitions(-O1 -g -W -march=athlon-xp -march=prescott -m32) + add_definitions(${CommonFlags} -O1 -g -W) endif(CMAKE_BUILD_TYPE STREQUAL Devel) # Release - Build if(CMAKE_BUILD_TYPE STREQUAL Release) # add defines - add_definitions(-fexpensive-optimizations -O3 -Os -W -march=athlon-xp -march=prescott -m32) + add_definitions(${CommonFlags} -fexpensive-optimizations -O3 -Os -W) endif(CMAKE_BUILD_TYPE STREQUAL Release) # variable with all sources of this library diff --git a/3rdparty/bzip2/CMakeLists.txt b/3rdparty/bzip2/CMakeLists.txt index 6a33cb1980..81ce43e821 100644 --- a/3rdparty/bzip2/CMakeLists.txt +++ b/3rdparty/bzip2/CMakeLists.txt @@ -3,22 +3,28 @@ # library name set(bzip2Name bzip2) +set(CommonFlags + -m32 + -march=athlon-xp + -march=prescott + ) + # Debug - Build if(CMAKE_BUILD_TYPE STREQUAL Debug) # add defines - add_definitions(-g -O0 -march=athlon-xp -march=prescott) + add_definitions(${CommonFlags} -g -O0) endif(CMAKE_BUILD_TYPE STREQUAL Debug) # Devel - Build if(CMAKE_BUILD_TYPE STREQUAL Devel) # add defines - add_definitions(-O1 -g -W -march=athlon-xp -march=prescott) + add_definitions(${CommonFlags} -O1 -g -W) endif(CMAKE_BUILD_TYPE STREQUAL Devel) # Release - Build if(CMAKE_BUILD_TYPE STREQUAL Release) # add defines - add_definitions(-fexpensive-optimizations -O3 -Os -W -march=athlon-xp -march=prescott) + add_definitions(${CommonFlags} -fexpensive-optimizations -O3 -Os -W) endif(CMAKE_BUILD_TYPE STREQUAL Release) # variable with all sources of this library diff --git a/3rdparty/liba52/CMakeLists.txt b/3rdparty/liba52/CMakeLists.txt index cf65b5d41c..1763a07baf 100644 --- a/3rdparty/liba52/CMakeLists.txt +++ b/3rdparty/liba52/CMakeLists.txt @@ -3,22 +3,34 @@ # library name set(a52Name a52) +set(CommonFlags + -Wall + -m32 + -g + ) + +set(OptimizationFlags + -O2 + -Os + ) + + # Debug - Build if(CMAKE_BUILD_TYPE STREQUAL Debug) # add defines - add_definitions(-g -Wall) + add_definitions(${CommonFlags}) endif(CMAKE_BUILD_TYPE STREQUAL Debug) # Devel - Build if(CMAKE_BUILD_TYPE STREQUAL Devel) # add defines - add_definitions(-O2 -Wall -g -Os) + add_definitions(${CommonFlags} ${OptimizationFlags}) endif(CMAKE_BUILD_TYPE STREQUAL Devel) # Release - Build if(CMAKE_BUILD_TYPE STREQUAL Release) # add defines - add_definitions(-O2 -Wall -g -Os) + add_definitions(${CommonFlags} ${OptimizationFlags}) endif(CMAKE_BUILD_TYPE STREQUAL Release) # variable with all sources of this library diff --git a/3rdparty/zlib/CMakeLists.txt b/3rdparty/zlib/CMakeLists.txt index 645b4564c7..3a7fdf6cd5 100644 --- a/3rdparty/zlib/CMakeLists.txt +++ b/3rdparty/zlib/CMakeLists.txt @@ -3,54 +3,59 @@ # library name set(zlibName zlib) +set(CommonFlags + -W + -m32 + ) + # Debug - Build if(CMAKE_BUILD_TYPE STREQUAL Debug) # add defines - add_definitions(-W -g -O0) + add_definitions(${CommonFlags} -g -O0) endif(CMAKE_BUILD_TYPE STREQUAL Debug) # Devel - Build if(CMAKE_BUILD_TYPE STREQUAL Devel) # add defines - add_definitions(-O2 -W) + add_definitions(${CommonFlags} -O2) endif(CMAKE_BUILD_TYPE STREQUAL Devel) # Release - Build if(CMAKE_BUILD_TYPE STREQUAL Release) # add defines - add_definitions(-fexpensive-optimizations -O3 -W) + add_definitions(${CommonFlags} -fexpensive-optimizations -O3) endif(CMAKE_BUILD_TYPE STREQUAL Release) # variable with all sources of this library set(zlibSources -compress.c -deflate.c -gzwrite.c -trees.c +compress.c +deflate.c +gzwrite.c +trees.c crc32.c gzlib.c -infback.c -inftrees.c -adler32.c -gzclose.c -gzread.c -inffast.c -inflate.c -uncompr.c +infback.c +inftrees.c +adler32.c +gzclose.c +gzread.c +inffast.c +inflate.c +uncompr.c zutil.c) # variable with all headers of this library set(zlibHeaders -gzguts.h -inffast.h -inflate.h -zconf.h +gzguts.h +inffast.h +inflate.h +zconf.h zlib.h zutil.h -deflate.h -inffixed.h +deflate.h +inffixed.h trees.h -crc32.h +crc32.h inftrees.h ) # add library diff --git a/cmake/FindPortAudio.cmake b/cmake/FindPortAudio.cmake index 23b483710e..a0d0d5b163 100644 --- a/cmake/FindPortAudio.cmake +++ b/cmake/FindPortAudio.cmake @@ -14,8 +14,10 @@ find_path(PORTAUDIO_INCLUDE_DIR portaudio.h) # finally the library itself find_library(libPortAudio NAMES portaudio) -find_library(libPortAudioCpp NAMES portaudiocpp) -set(PORTAUDIO_LIBRARIES ${libPortAudio} ${libPortAudioCpp}) +# Seems to run OK without libportaudiocpp so do not pull additional dependency +# find_library(libPortAudioCpp NAMES portaudiocpp) +# set(PORTAUDIO_LIBRARIES ${libPortAudio} ${libPortAudioCpp}) +set(PORTAUDIO_LIBRARIES ${libPortAudio}) # handle the QUIETLY and REQUIRED arguments and set PORTAUDIO_FOUND to TRUE if # all listed variables are TRUE diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index ae768d2e80..b4e9517e83 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -16,6 +16,9 @@ detectOperatingSystem() SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS " ") SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS " ") +# Do not search Lib in /usr/lib64. Hope it is not overwritten in find_package or others macro +SET(FIND_LIBRARY_USE_LIB64_PATHS FALSE) + #------------------------------------------------------------------------------- # FindStuff #-------------------------------------------------------------------------------