1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 10:42:36 +01:00

CMake: Improve to support build type. Default to release.

This commit is contained in:
Sacha 2014-07-11 02:46:10 +10:00
parent ab7a45aede
commit 6b148d1d4c
4 changed files with 24 additions and 18 deletions

View File

@ -2,5 +2,14 @@ cmake_minimum_required(VERSION 2.8)
set(ASMJIT_STATIC TRUE) set(ASMJIT_STATIC TRUE)
if (NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE "Release")
endif()
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
message( FATAL_ERROR "RPCS3 can only be compiled on 64-bit platforms." )
endif()
add_subdirectory( asmjit ) add_subdirectory( asmjit )
add_subdirectory( rpcs3 ) add_subdirectory( rpcs3 )

View File

@ -7,22 +7,28 @@ project(rpcs3)
if (CMAKE_COMPILER_IS_GNUCXX) if (CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7.0) if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7.0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") message(FATAL_ERROR "GCC ${CMAKE_CXX_COMPILER_VERSION} is too old.")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif() endif()
add_definitions(-DwxGUI)
#add_definitions(-D__WXGTK__) #add_definitions(-D__WXGTK__)
#add_definitions(-Wfatal-errors) #add_definitions(-Wfatal-errors)
add_definitions(-w) # TODO: remove me add_definitions(-w) # TODO: remove me
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
add_definitions(-fpermissive) # TODO: remove me add_definitions(-fpermissive) # TODO: remove me
add_definitions(-g) # Debugging!!
add_definitions(-msse2)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# TODO: stdlib?
endif()
if (NOT MSVC)
add_definitions(-DwxGUI) add_definitions(-DwxGUI)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fexceptions")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -D_DEBUG")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os -D_NDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O1 -D_NDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O1 -g -D_NDEBUG")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -D_DEBUG")
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -Os -D_NDEBUG")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O1 -D_NDEBUG")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O1 -g -D_NDEBUG")
add_definitions(-msse2)
endif() endif()
If( NOT RPCS3_SRC_DIR) If( NOT RPCS3_SRC_DIR)
@ -48,11 +54,6 @@ find_package(OpenAL REQUIRED)
include("${wxWidgets_USE_FILE}") include("${wxWidgets_USE_FILE}")
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
message( FATAL_ERROR "RPCS3 can only be compiled on 64-bit platforms." )
endif()
if(APPLE) if(APPLE)
set(PLATFORM_ARCH "macosx/x86_64") set(PLATFORM_ARCH "macosx/x86_64")
elseif(WIN32) elseif(WIN32)

View File

@ -1,7 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "rpcs3/Ini.h" #include "rpcs3/Ini.h"
#include "OpenALThread.h" #include "OpenALThread.h"

View File

@ -3,8 +3,6 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Memory.h" #include "Memory.h"
#include "MemoryBlock.h"
#include "Emu/System.h"
MemoryBase Memory; MemoryBase Memory;