Merge branch 'master' into wii-network

# By Ryan Houdek (185) and others
# Via degasus (12) and others
* master: (625 commits)
  Revert "Don't open/close file for every file operation." as it was crashing PokePark in Windows builds.
  Array overrun fixed in VertexShaderCache for the DX11 plugin.
  Fixed DSPTool build.
  Windows build fix
  Go back to assuming every HID device is a wiimote on Windows. Fixed issue 6117. Unfixed issue 6031.
  VideoSoftware: Improve fog range adjustment by using less magic and more comments.
  revert RasterFont for VideoSoftware
  ogl: fix virtual xfb
  Windows build fix from web interface...
  Adjusted the audio loop criteria, using >= on the Wii and == on GC.  This fixes the audio static that occurred in Wii games after hours of play.
  Forced the exception check only for ARAM DMA transfers. Removed the Eternal Darkness boot hack and replaced it with an exception check.
  VideoSoftware: Implement fog range adjustment, fixing issue 6147.
  implement 4xSSAA for OGL
  move ogl-only settings into backend
  Fix description of disable fog, and move it to enhancements tab.
  Reverted rd76ca5783743 as it was made obsolete by r1d550f4496e4.
  Removed the tracking of the FIFO Writes as it was made obsolete by r1d550f4496e4.
  Forced the external exception check to occur sooner by changing the downcount.
  Mark the Direct3D9 backend deprecated.
  Prefer D3D11 and OpenGL over D3D9 by default.
  ...

Conflicts:
	CMakeLists.txt
	Source/Core/Common/Common.vcxproj.filters
	Source/Core/Common/Src/CommonPaths.h
	Source/Core/Core/Core.vcxproj.filters
	Source/Core/Core/Src/Core.cpp
	Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp
	Source/VSProps/Dolphin.Win32.props
	Source/VSProps/Dolphin.x64.props
This commit is contained in:
skidau
2013-03-27 13:19:23 +11:00
615 changed files with 96239 additions and 97463 deletions

View File

@ -3,8 +3,9 @@
#
cmake_minimum_required(VERSION 2.6)
option(USE_GLES "Enables GLES And EGL, disables OGL" OFF)
option(ANDROID "Enables a build for Android" OFF)
option(USE_EGL "Enables EGL OpenGL Interface" OFF)
option(USE_GLES "Enables GLES And EGL, disables OGL" OFF)
option(DISABLE_WX "Disable wxWidgets (use CLI interface)" OFF)
option(FASTLOG "Enable all logs" OFF)
@ -106,9 +107,22 @@ if(DOLPHIN_IS_STABLE)
else()
set(DOLPHIN_VERSION_PATCH ${DOLPHIN_WC_REVISION})
endif()
message(${CMAKE_SYSTEM_PROCESSOR})
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm")
set(_M_GENERIC 1)
set(_M_ARM 1)
add_definitions(-marm -march=armv7-a)
add_definitions(-D_M_ARM=1)
add_definitions(-D_M_GENERIC=1)
endif()
# Set these next two lines to test generic
#set(_M_GENERIC 1)
#add_definitions(-D_M_GENERIC=1)
# Various compile flags
add_definitions(-msse2)
if(NOT _M_GENERIC)
add_definitions(-msse2)
endif()
include(CheckCXXCompilerFlag)
macro(check_and_add_flag var flag)
@ -160,8 +174,8 @@ if(APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -x none")
# Identify the target system:
# Ask for 32/64-bit fat binary.
set(TARGET_FLAGS "-arch x86_64 -arch i386")
# Ask for 64-bit binary.
set(TARGET_FLAGS "-arch x86_64")
# Minimum OS X version.
# This is inserted into the Info.plist as well.
# Note that the SDK determines the maximum version of which optional
@ -183,8 +197,6 @@ if(APPLE)
# This avoids a warning when linking with QuickTime.
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-no_arch_warnings")
# Specify target CPUs.
set(TARGET_FLAGS "${TARGET_FLAGS} -Xarch_i386 -msse3")
set(TARGET_FLAGS "${TARGET_FLAGS} -Xarch_i386 -march=prescott")
set(TARGET_FLAGS "${TARGET_FLAGS} -Xarch_x86_64 -mssse3")
set(TARGET_FLAGS "${TARGET_FLAGS} -Xarch_x86_64 -march=core2")
# Target flags apply to both C and C++ compilation.
@ -271,135 +283,139 @@ if(USE_EGL)
endif()
add_definitions(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE)
if(ANDROID)
message("Building for Android")
add_definitions(-DANDROID)
endif()
########################################
# Dependency checking
#
# TODO: We should have options for dependencies included in the externals to
# override autodetection of system libraries and force the usage of the
# externals.
if(NOT ANDROID)
include(CheckLib)
include(CheckLib)
include(FindOpenGL)
include_directories(${OPENGL_INCLUDE_DIR})
if(NOT OPENGL_GLU_FOUND)
message(FATAL_ERROR "GLU is required but not found")
endif()
if(OPENMP)
include(FindOpenMP OPTIONAL)
if(OPENMP_FOUND)
message("OpenMP parallelization enabled")
add_definitions("${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_CXX_FLAGS}")
include(FindOpenGL)
include_directories(${OPENGL_INCLUDE_DIR})
if(NOT OPENGL_GLU_FOUND)
message(FATAL_ERROR "GLU is required but not found")
endif()
endif()
if(NOT OPENMP_FOUND)
add_definitions(-Wno-unknown-pragmas)
message("OpenMP parallelization disabled")
endif()
include(FindALSA OPTIONAL)
if(ALSA_FOUND)
add_definitions(-DHAVE_ALSA=1)
message("ALSA found, enabling ALSA sound backend")
else()
add_definitions(-DHAVE_ALSA=0)
message("ALSA NOT found, disabling ALSA sound backend")
endif(ALSA_FOUND)
if(OPENMP)
include(FindOpenMP OPTIONAL)
if(OPENMP_FOUND)
message("OpenMP parallelization enabled")
add_definitions("${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
endif()
if(NOT OPENMP_FOUND)
add_definitions(-Wno-unknown-pragmas)
message("OpenMP parallelization disabled")
endif()
check_lib(AO ao QUIET)
if(AO_FOUND)
add_definitions(-DHAVE_AO=1)
message("ao found, enabling ao sound backend")
else()
add_definitions(-DHAVE_AO=0)
message("ao NOT found, disabling ao sound backend")
endif(AO_FOUND)
include(FindALSA OPTIONAL)
if(ALSA_FOUND)
add_definitions(-DHAVE_ALSA=1)
message("ALSA found, enabling ALSA sound backend")
else()
add_definitions(-DHAVE_ALSA=0)
message("ALSA NOT found, disabling ALSA sound backend")
endif(ALSA_FOUND)
check_lib(BLUEZ bluez QUIET)
if(BLUEZ_FOUND)
add_definitions(-DHAVE_BLUEZ=1)
message("bluez found, enabling bluetooth support")
else()
add_definitions(-DHAVE_BLUEZ=0)
message("bluez NOT found, disabling bluetooth support")
endif(BLUEZ_FOUND)
check_lib(AO ao QUIET)
if(AO_FOUND)
add_definitions(-DHAVE_AO=1)
message("ao found, enabling ao sound backend")
else()
add_definitions(-DHAVE_AO=0)
message("ao NOT found, disabling ao sound backend")
endif(AO_FOUND)
check_lib(PULSEAUDIO libpulse-simple QUIET)
if(PULSEAUDIO_FOUND)
add_definitions(-DHAVE_PULSEAUDIO=1)
message("PulseAudio found, enabling PulseAudio sound backend")
else()
add_definitions(-DHAVE_PULSEAUDIO=0)
message("PulseAudio NOT found, disabling PulseAudio sound backend")
endif(PULSEAUDIO_FOUND)
check_lib(BLUEZ bluez QUIET)
if(BLUEZ_FOUND)
add_definitions(-DHAVE_BLUEZ=1)
message("bluez found, enabling bluetooth support")
else()
add_definitions(-DHAVE_BLUEZ=0)
message("bluez NOT found, disabling bluetooth support")
endif(BLUEZ_FOUND)
include(FindOpenAL OPTIONAL)
if(OPENAL_FOUND)
add_definitions(-DHAVE_OPENAL=1)
include_directories(${OPENAL_INCLUDE_DIR})
message("OpenAL found, enabling OpenAL sound backend")
else()
add_definitions(-DHAVE_OPENAL=0)
message("OpenAL NOT found, disabling OpenAL sound backend")
endif(OPENAL_FOUND)
check_lib(PULSEAUDIO libpulse-simple QUIET)
if(PULSEAUDIO_FOUND)
add_definitions(-DHAVE_PULSEAUDIO=1)
message("PulseAudio found, enabling PulseAudio sound backend")
else()
add_definitions(-DHAVE_PULSEAUDIO=0)
message("PulseAudio NOT found, disabling PulseAudio sound backend")
endif(PULSEAUDIO_FOUND)
include(FindOpenAL OPTIONAL)
if(OPENAL_FOUND)
add_definitions(-DHAVE_OPENAL=1)
include_directories(${OPENAL_INCLUDE_DIR})
message("OpenAL found, enabling OpenAL sound backend")
else()
add_definitions(-DHAVE_OPENAL=0)
message("OpenAL NOT found, disabling OpenAL sound backend")
endif(OPENAL_FOUND)
# Note: We do not need to explicitly check for X11 as it is done in the cmake
# FindOpenGL module on linux.
if(UNIX AND NOT APPLE)
if(UNIX AND NOT APPLE)
if(X11_FOUND)
add_definitions(-DHAVE_X11=1)
include_directories(${X11_INCLUDE_DIR})
message("X11 found")
else()
message(FATAL_ERROR "X11 is required but not found")
endif(X11_FOUND)
else()
add_definitions(-DHAVE_X11=0)
endif()
if(X11_FOUND)
add_definitions(-DHAVE_X11=1)
include_directories(${X11_INCLUDE_DIR})
message("X11 found")
check_lib(XRANDR Xrandr)
endif()
if(XRANDR_FOUND)
add_definitions(-DHAVE_XRANDR=1)
else()
message(FATAL_ERROR "X11 is required but not found")
endif(X11_FOUND)
else()
add_definitions(-DHAVE_X11=0)
endif()
add_definitions(-DHAVE_XRANDR=0)
endif(XRANDR_FOUND)
if(X11_FOUND)
check_lib(XRANDR Xrandr)
endif()
if(XRANDR_FOUND)
add_definitions(-DHAVE_XRANDR=1)
else()
add_definitions(-DHAVE_XRANDR=0)
endif(XRANDR_FOUND)
if(ENCODE_FRAMEDUMPS)
check_libav()
endif()
if(ENCODE_FRAMEDUMPS)
check_libav()
endif()
include(CheckCXXSourceRuns)
set(CMAKE_REQUIRED_LIBRARIES portaudio)
CHECK_CXX_SOURCE_RUNS(
"#include <portaudio.h>
int main(int argc, char **argv)
{ if(Pa_GetVersion() >= 1890) return 0; else return 1; }"
PORTAUDIO)
if(PORTAUDIO)
message("PortAudio found, enabling mic support")
add_definitions(-DHAVE_PORTAUDIO=1)
set(PORTAUDIO_FOUND TRUE)
else()
message("PortAudio not found, disabling mic support")
add_definitions(-DHAVE_PORTAUDIO=0)
set(PORTAUDIO_FOUND FALSE)
endif(PORTAUDIO)
if(OPROFILING)
check_lib(OPROFILE opagent opagent.h)
check_lib(BFD bfd bfd.h)
if(OPROFILE_FOUND AND BFD_FOUND)
message("oprofile found, enabling profiling support")
add_definitions(-DUSE_OPROFILE=1)
include(CheckCXXSourceRuns)
set(CMAKE_REQUIRED_LIBRARIES portaudio)
CHECK_CXX_SOURCE_RUNS(
"#include <portaudio.h>
int main(int argc, char **argv)
{ if(Pa_GetVersion() >= 1890) return 0; else return 1; }"
PORTAUDIO)
if(PORTAUDIO)
message("PortAudio found, enabling mic support")
add_definitions(-DHAVE_PORTAUDIO=1)
set(PORTAUDIO_FOUND TRUE)
else()
message(FATAL_ERROR "oprofile or bfd not found. Can't build profiling support.")
message("PortAudio not found, disabling mic support")
add_definitions(-DHAVE_PORTAUDIO=0)
set(PORTAUDIO_FOUND FALSE)
endif(PORTAUDIO)
if(OPROFILING)
check_lib(OPROFILE opagent opagent.h)
check_lib(BFD bfd bfd.h)
if(OPROFILE_FOUND AND BFD_FOUND)
message("oprofile found, enabling profiling support")
add_definitions(-DUSE_OPROFILE=1)
else()
message(FATAL_ERROR "oprofile or bfd not found. Can't build profiling support.")
endif()
endif()
endif()
include(FindOpenSSL REQUIRED)
########################################
@ -416,7 +432,6 @@ include_directories(Source/Core/InputCommon/Src)
include_directories(Source/Core/VideoCommon/Src)
include_directories(Source/Core/VideoUICommon/Src)
########################################
# Process externals and setup their include directories
#
@ -430,7 +445,7 @@ include_directories(Source/Core/VideoUICommon/Src)
add_subdirectory(Externals/Bochs_disasm)
include_directories(Externals/Bochs_disasm)
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT ANDROID)
check_lib(LZO lzo2 lzo/lzo1x.h QUIET)
endif()
if(LZO_FOUND)
@ -455,15 +470,16 @@ if(OPENAL_FOUND)
endif()
endif()
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
include(FindSDL2 OPTIONAL)
endif()
if(SDL2_FOUND)
message("Using shared SDL2")
include_directories(${SDL2_INCLUDE_DIR})
else(SDL2_FOUND)
# SDL2 not found, try SDL
if(NOT ANDROID)
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
include(FindSDL2 OPTIONAL)
endif()
if(SDL2_FOUND)
message("Using shared SDL2")
include_directories(${SDL2_INCLUDE_DIR})
else(SDL2_FOUND)
# SDL2 not found, try SDL
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
include(FindSDL OPTIONAL)
endif()
if(SDL_FOUND)
@ -475,7 +491,8 @@ else(SDL2_FOUND)
include_directories(Externals/SDL/SDL Externals/SDL Externals/SDL/include)
add_subdirectory(Externals/SDL)
endif(SDL_FOUND)
endif(SDL2_FOUND)
endif(SDL2_FOUND)
endif()
include(FindLibUSB OPTIONAL)
if(LIBUSB_FOUND)
@ -490,7 +507,7 @@ endif(LIBUSB_FOUND)
set(SFML_FIND_VERSION TRUE)
set(SFML_FIND_VERSION_MAJOR 1)
set(SFML_FIND_VERSION_MINOR 5)
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT ANDROID)
include(FindSFML OPTIONAL)
endif()
if(SFML_FOUND AND NOT SFML_VERSION_MAJOR) # SFML 1.x doesn't define SFML_VERSION_MAJOR
@ -501,7 +518,7 @@ else()
include_directories(Externals/SFML/include)
endif()
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT ANDROID)
check_lib(SOIL SOIL SOIL/SOIL.h QUIET)
endif()
if(SOIL_FOUND)
@ -531,26 +548,19 @@ if(WIN32)
find_library(GLEW glew32s PATHS Externals/GLew)
include_directories(Externals/GLew/include)
else()
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
check_lib(GLEW GLEW GL/glew.h)
if(NOT ANDROID)
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
check_lib(GLEW GLEW GL/glew.h)
endif()
if(NOT GLEW_FOUND)
message("Using static GLEW from Externals")
add_subdirectory(Externals/GLew)
include_directories(Externals/GLew/include)
endif(NOT GLEW_FOUND)
endif()
if(NOT GLEW_FOUND)
message("Using static GLEW from Externals")
add_subdirectory(Externals/GLew)
include_directories(Externals/GLew/include)
endif(NOT GLEW_FOUND)
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
check_lib(CG Cg Cg/cg.h)
endif()
if(NOT CG_FOUND)
message("Using static Cg from Externals")
include_directories(Externals)
endif(NOT CG_FOUND)
check_lib(CGGL CgGL Cg/cgGL.h)
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT ANDROID)
find_library(CL OpenCL)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-weak_framework,OpenCL")
else()
@ -558,10 +568,25 @@ else()
add_subdirectory(Externals/CLRun)
endif()
if(NOT DISABLE_WX)
if(NOT DISABLE_WX AND NOT ANDROID)
include(FindwxWidgets OPTIONAL)
FIND_PACKAGE(wxWidgets COMPONENTS core aui adv)
if(wxWidgets_FOUND)
EXECUTE_PROCESS(
COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
${wxWidgets_CONFIG_OPTIONS} --version
OUTPUT_VARIABLE wxWidgets_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
message("Found wxWidgets version ${wxWidgets_VERSION}")
if(${wxWidgets_VERSION} VERSION_LESS "2.8.9")
message("At least 2.8.9 is required; ignoring found version")
unset(wxWidgets_FOUND)
endif()
endif(wxWidgets_FOUND)
if(wxWidgets_FOUND)
EXECUTE_PROCESS(
COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
@ -582,26 +607,26 @@ if(NOT DISABLE_WX)
endif()
endif(wxWidgets_FOUND)
if(UNIX AND NOT APPLE)
# There is a bug in the FindGTK module in cmake version 2.8.2 that
# does not find gdk-pixbuf-2.0. On the other hand some 2.8.3
# users have complained that pkg-config does not find
# gdk-pixbuf-2.0. On yet another hand, cmake version 2.8.3 in
# Ubuntu Natty does not find the glib libraries correctly.
# Ugly!!!
execute_process(COMMAND lsb_release -c -s
OUTPUT_VARIABLE DIST_NAME
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}
VERSION_EQUAL 2.8.2 OR "${DIST_NAME}" STREQUAL "natty")
check_lib(GTK2 gtk+-2.0 gtk.h REQUIRED)
else()
include(FindGTK2)
if(GTK2_FOUND)
include_directories(${GTK2_INCLUDE_DIRS})
if(UNIX AND NOT APPLE)
# There is a bug in the FindGTK module in cmake version 2.8.2 that
# does not find gdk-pixbuf-2.0. On the other hand some 2.8.3
# users have complained that pkg-config does not find
# gdk-pixbuf-2.0. On yet another hand, cmake version 2.8.3 in
# Ubuntu Natty does not find the glib libraries correctly.
# Ugly!!!
execute_process(COMMAND lsb_release -c -s
OUTPUT_VARIABLE DIST_NAME
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}
VERSION_EQUAL 2.8.2 OR "${DIST_NAME}" STREQUAL "natty")
check_lib(GTK2 gtk+-2.0 gtk.h REQUIRED)
else()
include(FindGTK2)
if(GTK2_FOUND)
include_directories(${GTK2_INCLUDE_DIRS})
endif()
endif()
endif()
endif()
if(wxWidgets_FOUND)
include(${wxWidgets_USE_FILE})
@ -633,7 +658,7 @@ if(NOT DISABLE_WX)
set(wxWidgets_LIBRARIES "wx")
endif(wxWidgets_FOUND)
add_definitions(-DHAVE_WX=1)
endif(NOT DISABLE_WX)
endif(NOT DISABLE_WX AND NOT ANDROID)
########################################
@ -653,6 +678,7 @@ file(WRITE ${PROJECT_BINARY_DIR}/Source/Core/Common/Src/scmrev.h
)
include_directories("${PROJECT_BINARY_DIR}/Source/Core/Common/Src")
########################################
# Start compiling our code
#
@ -707,4 +733,4 @@ list(APPEND CPACK_SOURCE_IGNORE_FILES "${CMAKE_BINARY_DIR}")
# CPack must be included after the CPACK_* variables are set in order for those
# variables to take effect.
include(CPack)
Include(CPack)