2014-07-05 12:54:56 +00:00
|
|
|
### TODO
|
2013-11-01 21:05:59 +00:00
|
|
|
# Hardcode GAMEINDEX_DIR, if default is fine for everybody
|
2012-08-15 10:22:19 +00:00
|
|
|
|
2010-06-03 17:28:20 +00:00
|
|
|
### Select the build type
|
2011-10-31 10:25:24 +00:00
|
|
|
# Use Release/Devel/Debug : -DCMAKE_BUILD_TYPE=Release|Devel|Debug
|
2011-10-30 00:32:22 +00:00
|
|
|
# Enable/disable the stripping : -DCMAKE_BUILD_STRIP=TRUE|FALSE
|
2011-10-31 10:25:24 +00:00
|
|
|
# generation .po based on src : -DCMAKE_BUILD_PO=TRUE|FALSE
|
2011-10-30 00:32:22 +00:00
|
|
|
|
2011-07-17 11:25:17 +00:00
|
|
|
### GCC optimization options
|
2010-07-07 11:36:54 +00:00
|
|
|
# control C flags : -DUSER_CMAKE_C_FLAGS="cflags"
|
|
|
|
# control C++ flags : -DUSER_CMAKE_CXX_FLAGS="cxxflags"
|
2010-07-13 09:16:13 +00:00
|
|
|
# control link flags : -DUSER_CMAKE_LD_FLAGS="ldflags"
|
2011-10-30 00:32:22 +00:00
|
|
|
|
2011-07-17 11:25:17 +00:00
|
|
|
### Packaging options
|
|
|
|
# Plugin installation path : -DPLUGIN_DIR="/usr/lib/pcsx2"
|
2012-05-11 20:52:50 +00:00
|
|
|
# GL Shader installation path : -DGLSL_SHADER_DIR="/usr/share/games/pcsx2"
|
2012-10-21 18:10:13 +00:00
|
|
|
# Game DB installation path : -DGAMEINDEX_DIR="/usr/share/games/pcsx2"
|
2010-06-03 17:28:20 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
|
2014-07-05 12:54:56 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
# Graphical option
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
option(GLSL_API "Replace zzogl CG backend by GLSL (experimental option)")
|
|
|
|
option(EGL_API "Use EGL on zzogl (experimental/developer option)")
|
|
|
|
option(GLES_API "Use GLES on GSdx (experimental/developer option)")
|
|
|
|
option(REBUILD_SHADER "Rebuild glsl/cg shader (developer option)")
|
|
|
|
option(BUILD_REPLAY_LOADERS "Build GS replayer to ease testing (developer option)")
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
# Path and lib option
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
option(PACKAGE_MODE "Use this option to ease packaging of PCSX2 (developer/distribution option)")
|
|
|
|
option(XDG_STD "Use XDG standard path instead of the standard PCSX2 path")
|
|
|
|
option(EXTRA_PLUGINS "Build various 'extra' plugins")
|
2014-12-20 12:22:54 +00:00
|
|
|
option(SDL2_API "Use SDL2 on spu2x and onepad (experimental/wxWidget mustn't be built with SDL1.2 support")
|
|
|
|
option(WX28_API "Force wxWidget 2.8 lib (deprecated)")
|
|
|
|
option(GTK3_API "Use GTK3 api (experimental/wxWidget must be built with GTK3 support)")
|
2014-07-05 12:54:56 +00:00
|
|
|
|
|
|
|
if(PACKAGE_MODE)
|
|
|
|
if(NOT DEFINED PLUGIN_DIR)
|
|
|
|
set(PLUGIN_DIR "${CMAKE_INSTALL_PREFIX}/lib/games/pcsx2")
|
|
|
|
endif(NOT DEFINED PLUGIN_DIR)
|
|
|
|
|
|
|
|
if(NOT DEFINED GAMEINDEX_DIR)
|
|
|
|
set(GAMEINDEX_DIR "${CMAKE_INSTALL_PREFIX}/share/games/pcsx2")
|
|
|
|
endif(NOT DEFINED GAMEINDEX_DIR)
|
|
|
|
|
2014-09-27 18:26:42 +00:00
|
|
|
if(NOT DEFINED BIN_DIR)
|
|
|
|
set(BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin")
|
|
|
|
endif(NOT DEFINED BIN_DIR)
|
|
|
|
|
2014-07-05 12:54:56 +00:00
|
|
|
# Compile all source codes with these 2 defines
|
|
|
|
add_definitions(-DPLUGIN_DIR_COMPILATION=${PLUGIN_DIR} -DGAMEINDEX_DIR_COMPILATION=${GAMEINDEX_DIR})
|
|
|
|
endif(PACKAGE_MODE)
|
|
|
|
|
2014-07-12 14:04:57 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
# Compiler extra
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
option(USE_CLANG "Use llvm/clang to build PCSX2 (developer option)")
|
2014-07-12 17:57:26 +00:00
|
|
|
option(USE_ASAN "Enable address sanitizer")
|
2014-07-12 14:04:57 +00:00
|
|
|
|
2014-07-05 12:54:56 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
# Select the architecture
|
|
|
|
#-------------------------------------------------------------------------------
|
2014-09-12 18:01:43 +00:00
|
|
|
option(64BIT_BUILD_DONT_WORK "Enable a x86_64 build instead of cross compiling (WARNING: NOTHING WORK)" OFF)
|
2014-11-11 13:50:56 +00:00
|
|
|
option(DISABLE_ADVANCE_SIMD "Disable advance use of SIMD (SSE2+ & AVX)" OFF)
|
2014-07-05 12:54:56 +00:00
|
|
|
|
|
|
|
# Architecture bitness detection
|
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
set(_ARCH_64 1)
|
|
|
|
else()
|
|
|
|
set(_ARCH_32 1)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Print a clear message that 64bits is not supported
|
|
|
|
if(_ARCH_64)
|
|
|
|
message(WARNING "
|
2014-09-12 18:01:43 +00:00
|
|
|
PCSX2 does not support a 64-bits environment and has no yet a plan to support it.
|
2014-07-05 12:54:56 +00:00
|
|
|
It would need a complete rewrite of the core emulator and a lot of time.
|
|
|
|
|
|
|
|
You can still run a 32-bits binary if you install all 32-bits libraries (runtime and dev).")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# 64 bits cross-compile specific configuration
|
2014-09-13 12:22:41 +00:00
|
|
|
if(_ARCH_64 AND 64BIT_BUILD_DONT_WORK)
|
2014-07-05 12:54:56 +00:00
|
|
|
message("Compiling 64bit build on 64bit architecture")
|
|
|
|
# Search library in /usr/lib64
|
|
|
|
SET_PROPERTY(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON)
|
|
|
|
# Probably useless but it will not harm
|
|
|
|
SET_PROPERTY(GLOBAL PROPERTY COMPILE_DEFINITIONS "-m64")
|
|
|
|
|
2014-07-05 13:08:39 +00:00
|
|
|
# Note: /usr/lib64 is already taken care above
|
|
|
|
|
2014-07-05 12:54:56 +00:00
|
|
|
# For Debian/ubuntu multiarch
|
|
|
|
if(EXISTS "/usr/lib/x86_64-linux-gnu")
|
|
|
|
set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
|
|
|
|
endif()
|
|
|
|
|
2014-07-15 22:25:34 +00:00
|
|
|
# x86_64 requires -fPIC
|
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
|
2014-10-26 13:36:34 +00:00
|
|
|
if (DISABLE_ADVANCE_SIMD)
|
|
|
|
set(ARCH_FLAG "-m64 -msse -msse2")
|
|
|
|
else()
|
2014-11-09 14:45:54 +00:00
|
|
|
#set(ARCH_FLAG "-m64 -march=native -fabi-version=6")
|
|
|
|
set(ARCH_FLAG "-m64 -march=native")
|
2014-10-26 13:36:34 +00:00
|
|
|
endif()
|
2014-07-15 04:00:31 +00:00
|
|
|
add_definitions(-D_ARCH_64=1 -D_M_X86=1 -D_M_X86_64=1)
|
|
|
|
set(_ARCH_64 1)
|
|
|
|
set(_M_X86 1)
|
|
|
|
set(_M_X86_64 1)
|
2014-07-05 12:54:56 +00:00
|
|
|
else()
|
|
|
|
message("Compiling 32bit build on 32/64bit architecture")
|
|
|
|
# Do not search library in /usr/lib64
|
|
|
|
SET_PROPERTY(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS OFF)
|
|
|
|
# Probably useless but it will not harm
|
|
|
|
SET_PROPERTY(GLOBAL PROPERTY COMPILE_DEFINITIONS "-m32")
|
|
|
|
|
|
|
|
# Force the search on 32-bits path.
|
|
|
|
if(EXISTS "/usr/lib32")
|
|
|
|
set(CMAKE_LIBRARY_ARCHITECTURE "../lib32")
|
|
|
|
endif()
|
|
|
|
# Debian/ubuntu drop /usr/lib32 and move /usr/lib to /usr/lib/i386-linux-gnu
|
|
|
|
if(EXISTS "/usr/lib/i386-linux-gnu")
|
|
|
|
set(CMAKE_LIBRARY_ARCHITECTURE "i386-linux-gnu")
|
|
|
|
endif()
|
|
|
|
|
2014-07-15 22:25:34 +00:00
|
|
|
# * -fPIC option was removed for multiple reasons.
|
|
|
|
# - Code only supports the x86 architecture.
|
|
|
|
# - code uses the ebx register so it's not compliant with PIC.
|
|
|
|
# - Impacts the performance too much.
|
|
|
|
# - Only plugins. No package will link to them.
|
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE OFF)
|
|
|
|
|
2014-10-26 13:36:34 +00:00
|
|
|
if (DISABLE_ADVANCE_SIMD)
|
|
|
|
set(ARCH_FLAG "-m32 -msse -msse2 -march=i686")
|
|
|
|
else()
|
|
|
|
# AVX requires some fix of the ABI (mangling) (default 2)
|
|
|
|
# Note: V6 requires GCC 4.7
|
2014-11-09 14:45:54 +00:00
|
|
|
#set(ARCH_FLAG "-m32 -march=native -fabi-version=6")
|
|
|
|
set(ARCH_FLAG "-m32 -march=native")
|
2014-10-26 13:36:34 +00:00
|
|
|
endif()
|
2014-07-15 04:00:31 +00:00
|
|
|
add_definitions(-D_ARCH_32=1 -D_M_X86=1 -D_M_X86_32=1)
|
|
|
|
set(_ARCH_32 1)
|
|
|
|
set(_M_X86 1)
|
|
|
|
set(_M_X86_32 1)
|
2014-07-05 12:54:56 +00:00
|
|
|
endif()
|
|
|
|
|
2010-07-13 09:16:13 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
# 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")
|
2014-12-15 18:29:05 +00:00
|
|
|
endif()
|
2010-07-13 09:16:13 +00:00
|
|
|
|
2014-07-05 12:54:56 +00:00
|
|
|
# Initially strip was disabled on release build but it is not stackstrace friendly!
|
2014-01-10 20:25:03 +00:00
|
|
|
# It only cost several MB so disbable it by default
|
2014-07-05 13:08:39 +00:00
|
|
|
option(CMAKE_BUILD_STRIP "Srip binaries to save a couple of MB (developer option)")
|
2010-07-13 09:16:13 +00:00
|
|
|
|
2011-10-31 10:25:24 +00:00
|
|
|
if(NOT DEFINED CMAKE_BUILD_PO)
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
|
|
|
set(CMAKE_BUILD_PO TRUE)
|
|
|
|
message(STATUS "Enable the building of po files by default in ${CMAKE_BUILD_TYPE} build !!!")
|
2014-07-05 13:08:39 +00:00
|
|
|
else()
|
2011-10-31 10:25:24 +00:00
|
|
|
set(CMAKE_BUILD_PO FALSE)
|
|
|
|
message(STATUS "Disable the building of po files by default in ${CMAKE_BUILD_TYPE} build !!!")
|
2014-07-05 13:08:39 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
2011-10-31 10:25:24 +00:00
|
|
|
|
2014-07-05 12:54:56 +00:00
|
|
|
|
2010-07-13 09:16:13 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
# Control GCC flags
|
|
|
|
#-------------------------------------------------------------------------------
|
2010-07-04 12:37:42 +00:00
|
|
|
### Cmake set default value for various compilation variable
|
|
|
|
### Here the list of default value for documentation purpose
|
|
|
|
# ${CMAKE_SHARED_LIBRARY_CXX_FLAGS} = "-fPIC"
|
|
|
|
# ${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS} = "-rdynamic"
|
2014-07-05 12:54:56 +00:00
|
|
|
#
|
2010-07-07 11:08:05 +00:00
|
|
|
# ${CMAKE_C_FLAGS} = "-g -O2"
|
|
|
|
# ${CMAKE_CXX_FLAGS} = "-g -O2"
|
2010-07-04 12:37:42 +00:00
|
|
|
# Use in debug mode
|
|
|
|
# ${CMAKE_CXX_FLAGS_DEBUG} = "-g"
|
|
|
|
# Use in release mode
|
|
|
|
# ${CMAKE_CXX_FLAGS_RELEASE} = "-O3 -DNDEBUG"
|
|
|
|
|
2010-07-07 11:08:05 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
# Do not use default cmake flags
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
set(CMAKE_C_FLAGS_DEBUG "")
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "")
|
2010-07-07 11:36:54 +00:00
|
|
|
set(CMAKE_C_FLAGS_DEVEL "")
|
|
|
|
set(CMAKE_CXX_FLAGS_DEVEL "")
|
2010-07-07 11:08:05 +00:00
|
|
|
set(CMAKE_C_FLAGS_RELEASE "")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "")
|
|
|
|
|
2010-07-04 12:37:42 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
# Remove bad default option
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
# Remove -rdynamic option that can some segmentation fault when openining pcsx2 plugins
|
2010-07-07 11:36:54 +00:00
|
|
|
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
|
|
|
|
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
|
2014-07-15 22:25:34 +00:00
|
|
|
if(_ARCH_32)
|
|
|
|
# Remove -fPIC option on 32bit architectures.
|
|
|
|
# No good reason to use it for plugins, also it impacts performance.
|
|
|
|
set(CMAKE_SHARED_LIBRARY_C_FLAGS "")
|
|
|
|
set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
|
|
|
|
endif()
|
2010-06-10 07:14:53 +00:00
|
|
|
|
2011-10-29 11:39:06 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
2011-10-30 00:32:22 +00:00
|
|
|
# Set some default compiler flags
|
2011-10-29 11:39:06 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
2014-07-14 11:58:06 +00:00
|
|
|
set(COMMON_FLAG "-pipe -std=c++0x -fvisibility=hidden -pthread")
|
|
|
|
set(HARDENING_FLAG "-D_FORTIFY_SOURCE=2 -Wformat -Wformat-security")
|
2014-04-18 21:39:12 +00:00
|
|
|
# -Wno-attributes: "always_inline function might not be inlinable" <= real spam (thousand of warnings!!!)
|
|
|
|
# -Wno-missing-field-initializers: standard allow to init only the begin of struct/array in static init. Just a silly warning.
|
|
|
|
# -Wno-unused-function: warn for function not used in release build
|
2014-07-11 21:33:09 +00:00
|
|
|
# -Wno-unused-variable: just annoying to manage different level of logging, a couple of extra var won't kill any serious compiler.
|
2014-08-02 06:42:28 +00:00
|
|
|
# -Wno-unused-value: lots of warning for this kind of statements "0 && ...". There are used to disable some parts of code in release/dev build.
|
2014-12-20 12:22:54 +00:00
|
|
|
set(DEFAULT_WARNINGS "-Wall -Wno-attributes -Wno-missing-field-initializers -Wno-unused-function -Wno-unused-parameter -Wno-unused-variable -Wno-unused-value ")
|
|
|
|
# -Wstrict-aliasing=n: to fix one day aliasing issue. n=1/2/3
|
|
|
|
set(AGGRESSIVE_WARNING "-Wstrict-aliasing -Wstrict-overflow=4 ")
|
2014-07-14 11:58:06 +00:00
|
|
|
|
2014-07-12 14:04:57 +00:00
|
|
|
if (USE_CLANG)
|
2014-07-14 11:58:06 +00:00
|
|
|
# -Wno-deprecated-register: glib issue...
|
2014-07-12 14:04:57 +00:00
|
|
|
set(DEFAULT_WARNINGS "${DEFAULT_WARNINGS} -Wno-deprecated-register")
|
2014-07-14 11:58:06 +00:00
|
|
|
set(COMMON_FLAG "${COMMON_FLAG} -no-integrated-as")
|
2014-07-12 14:04:57 +00:00
|
|
|
endif()
|
|
|
|
|
2014-12-15 18:29:05 +00:00
|
|
|
if(CMAKE_BUILD_TYPE MATCHES "Debug")
|
2014-07-11 21:33:09 +00:00
|
|
|
set(DEBUG_FLAG "-g")
|
2014-12-15 18:29:05 +00:00
|
|
|
elseif(CMAKE_BUILD_TYPE MATCHES "Devel")
|
|
|
|
set(DEBUG_FLAG "-g -DNDEBUG")
|
|
|
|
elseif(CMAKE_BUILD_TYPE MATCHES "Release")
|
|
|
|
set(DEBUG_FLAG "-DNDEBUG")
|
2014-04-06 09:43:40 +00:00
|
|
|
endif()
|
2014-07-11 21:33:09 +00:00
|
|
|
|
2014-07-12 17:57:26 +00:00
|
|
|
if (USE_ASAN)
|
|
|
|
set(ASAN_FLAG "-fsanitize=address -fno-omit-frame-pointer -g -mpreferred-stack-boundary=4 -mincoming-stack-boundary=2 -DASAN_WORKAROUND")
|
|
|
|
else()
|
|
|
|
set(ASAN_FLAG "")
|
|
|
|
endif()
|
|
|
|
|
2014-12-07 21:06:39 +00:00
|
|
|
# Note: -DGTK_DISABLE_DEPRECATED can be used to test a build without gtk deprecated feature. It could be useful to port to a newer API
|
2014-12-20 12:22:54 +00:00
|
|
|
set(DEFAULT_GCC_FLAG "${ARCH_FLAG} ${COMMON_FLAG} ${DEFAULT_WARNINGS} ${AGGRESSIVE_WARNING} ${HARDENING_FLAG} ${DEBUG_FLAG} ${ASAN_FLAG}")
|
2014-07-05 13:08:39 +00:00
|
|
|
# c++ only flags
|
2011-10-30 00:32:22 +00:00
|
|
|
set(DEFAULT_CPP_FLAG "${DEFAULT_GCC_FLAG} -Wno-invalid-offsetof")
|
2011-10-29 11:39:06 +00:00
|
|
|
|
2010-07-07 11:36:54 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
# Allow user to set some default flags
|
2010-07-13 09:16:13 +00:00
|
|
|
# Note: string STRIP must be used to remove trailing and leading spaces.
|
|
|
|
# See policy CMP0004
|
2010-07-07 11:36:54 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
2014-07-05 12:54:56 +00:00
|
|
|
# TODO: once we completely clean all flags management, this mess could be cleaned ;)
|
2010-07-13 09:16:13 +00:00
|
|
|
### 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)
|
2014-07-05 13:08:39 +00:00
|
|
|
else()
|
2010-07-13 09:16:13 +00:00
|
|
|
set(USER_CMAKE_LD_FLAGS "")
|
2014-07-05 13:08:39 +00:00
|
|
|
endif()
|
2010-07-13 09:16:13 +00:00
|
|
|
|
|
|
|
# ask the linker to strip the binary
|
2014-07-05 12:54:56 +00:00
|
|
|
if(CMAKE_BUILD_STRIP)
|
2010-07-13 09:16:13 +00:00
|
|
|
string(STRIP "${USER_CMAKE_LD_FLAGS} -s" USER_CMAKE_LD_FLAGS)
|
2014-07-05 13:08:39 +00:00
|
|
|
endif()
|
2010-07-13 09:16:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
### c flags
|
|
|
|
# Note CMAKE_C_FLAGS is also send to the linker.
|
|
|
|
# By default allow build on amd64 machine
|
2010-07-07 11:36:54 +00:00
|
|
|
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 !!!")
|
2010-08-09 19:05:02 +00:00
|
|
|
string(STRIP "${USER_CMAKE_C_FLAGS}" CMAKE_C_FLAGS)
|
2014-07-05 13:08:39 +00:00
|
|
|
endif()
|
2010-08-09 19:05:02 +00:00
|
|
|
# Use some default machine flags
|
2011-10-29 11:39:06 +00:00
|
|
|
string(STRIP "${CMAKE_C_FLAGS} ${DEFAULT_GCC_FLAG}" CMAKE_C_FLAGS)
|
2010-07-07 11:36:54 +00:00
|
|
|
|
2010-07-13 09:16:13 +00:00
|
|
|
|
|
|
|
### C++ flags
|
|
|
|
# Note CMAKE_CXX_FLAGS is also send to the linker.
|
|
|
|
# By default allow build on amd64 machine
|
2010-07-07 11:36:54 +00:00
|
|
|
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 !!!")
|
2010-07-13 09:16:13 +00:00
|
|
|
string(STRIP "${USER_CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS)
|
2014-07-05 13:08:39 +00:00
|
|
|
endif()
|
2010-08-09 19:05:02 +00:00
|
|
|
# Use some default machine flags
|
2011-10-30 00:32:22 +00:00
|
|
|
string(STRIP "${CMAKE_CXX_FLAGS} ${DEFAULT_CPP_FLAG}" CMAKE_CXX_FLAGS)
|
2014-12-21 09:46:33 +00:00
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
# Too much user/packager use experimental flags as release flags
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
if(CMAKE_BUILD_TYPE MATCHES "Release" OR PACKAGE_MODE)
|
|
|
|
if (64BIT_BUILD_DONT_WORK)
|
|
|
|
message(FATAL_ERROR "64 bit is not suitable for end users. It will only crash and it will be 10 times slower than 32 bits !!!")
|
|
|
|
endif()
|
|
|
|
if (GTK3_API)
|
|
|
|
message(FATAL_ERROR "GTK3 is highly experimental besides it requires a wxWidget built with __WXGTK3__ support !!!")
|
|
|
|
endif()
|
|
|
|
endif()
|