mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 01:29:42 -06:00
Merge branch 'master' into wii-network
Conflicts: CMakeLists.txt Source/Core/Core/Core.vcxproj Source/Core/DolphinWX/Dolphin.vcxproj Source/Core/DolphinWX/Dolphin.vcxproj.filters Source/Dolphin_2010.sln Source/VSProps/Dolphin.Win32.props Source/VSProps/Dolphin.x64.props
This commit is contained in:
204
CMakeLists.txt
204
CMakeLists.txt
@ -7,7 +7,9 @@ option(ANDROID "Enables a build for Android" OFF)
|
||||
option(USE_EGL "Enables EGL OpenGL Interface" OFF)
|
||||
option(USE_X11 "Enables X11 Support" ON)
|
||||
option(USE_WAYLAND "Enables Wayland Support" OFF)
|
||||
option(USE_GLES "Enables GLES And EGL, disables OGL" OFF)
|
||||
option(USE_GLES "Enables GLES2 And EGL, disables OGL" OFF)
|
||||
option(USE_GLES3 "Enables GLES3 and EGL" OFF)
|
||||
option(USE_UPNP "Enables UPnP port mapping support" ON)
|
||||
option(DISABLE_WX "Disable wxWidgets (use CLI interface)" OFF)
|
||||
|
||||
option(FASTLOG "Enable all logs" OFF)
|
||||
@ -83,22 +85,22 @@ endfunction(enable_precompiled_headers)
|
||||
# for revision info
|
||||
include(FindGit OPTIONAL)
|
||||
if(GIT_FOUND AND NOT DOLPHIN_WC_REVISION)
|
||||
# defines DOLPHIN_WC_REVISION
|
||||
EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
|
||||
OUTPUT_VARIABLE DOLPHIN_WC_REVISION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
# defines DOLPHIN_WC_DESCRIBE
|
||||
EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} describe --always --long --dirty
|
||||
OUTPUT_VARIABLE DOLPHIN_WC_DESCRIBE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
# defines DOLPHIN_WC_REVISION
|
||||
EXECUTE_PROCESS(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
|
||||
OUTPUT_VARIABLE DOLPHIN_WC_REVISION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
# defines DOLPHIN_WC_DESCRIBE
|
||||
EXECUTE_PROCESS(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} describe --always --long --dirty
|
||||
OUTPUT_VARIABLE DOLPHIN_WC_DESCRIBE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
# remove hash from description
|
||||
# remove hash from description
|
||||
STRING(REGEX REPLACE "-[^-]+((-dirty)?)$" "\\1" DOLPHIN_WC_DESCRIBE "${DOLPHIN_WC_DESCRIBE}")
|
||||
|
||||
# defines DOLPHIN_WC_BRANCH
|
||||
EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
|
||||
OUTPUT_VARIABLE DOLPHIN_WC_BRANCH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
# defines DOLPHIN_WC_BRANCH
|
||||
EXECUTE_PROCESS(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
|
||||
OUTPUT_VARIABLE DOLPHIN_WC_BRANCH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif()
|
||||
|
||||
# version number
|
||||
@ -116,10 +118,17 @@ if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm")
|
||||
add_definitions(-marm -march=armv7-a)
|
||||
add_definitions(-D_M_ARM=1)
|
||||
add_definitions(-D_M_GENERIC=1)
|
||||
# Set generic options so you don't have to pass anything to cmake to build ARM
|
||||
# Set generic options so you don't have to pass anything to cmake to build ARM
|
||||
set(USE_GLES 1)
|
||||
endif()
|
||||
|
||||
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "mips")
|
||||
set(_M_GENERIC 1)
|
||||
set(_M_MIPS 1)
|
||||
add_definitions(-D_M_MIPS=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)
|
||||
@ -189,13 +198,13 @@ if(APPLE)
|
||||
set(SYSROOT_LEGACY_PATH "/Developer/SDKs/MacOSX10.7.sdk")
|
||||
set(SYSROOT_PATH "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk")
|
||||
if(EXISTS "${SYSROOT_PATH}/")
|
||||
set(TARGET_SYSROOT ${SYSROOT_PATH})
|
||||
set(TARGET_SYSROOT ${SYSROOT_PATH})
|
||||
elseif(EXISTS "${SYSROOT_LEGACY_PATH}/")
|
||||
set(TARGET_SYSROOT ${SYSROOT_LEGACY_PATH})
|
||||
set(TARGET_SYSROOT ${SYSROOT_LEGACY_PATH})
|
||||
endif()
|
||||
if(${TARGET_SYSROOT})
|
||||
set(TARGET_FLAGS "${TARGET_FLAGS} -isysroot ${TARGET_SYSROOT}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-syslibroot,${TARGET_SYSROOT}")
|
||||
set(TARGET_FLAGS "${TARGET_FLAGS} -isysroot ${TARGET_SYSROOT}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-syslibroot,${TARGET_SYSROOT}")
|
||||
endif()
|
||||
# Do not warn about frameworks that are not available on all architectures.
|
||||
# This avoids a warning when linking with QuickTime.
|
||||
@ -266,19 +275,35 @@ if(FASTLOG)
|
||||
add_definitions(-DDEBUGFAST)
|
||||
endif()
|
||||
|
||||
|
||||
option(GDBSTUB "Enable gdb stub for remote debugging." OFF)
|
||||
if(GDBSTUB)
|
||||
add_definitions(-DUSE_GDBSTUB)
|
||||
endif(GDBSTUB)
|
||||
|
||||
if(ANDROID)
|
||||
message("Building for Android")
|
||||
add_definitions(-DANDROID)
|
||||
set(USE_X11 0)
|
||||
set(USE_WAYLAND 0)
|
||||
set(USE_UPNP 0)
|
||||
set(USE_GLES3 1)
|
||||
endif()
|
||||
|
||||
# For now GLES and EGL are tied to each other.
|
||||
# Enabling GLES also disables the OpenGL plugin.
|
||||
if(USE_GLES)
|
||||
message("GLES rendering enabled")
|
||||
add_definitions(-DUSE_GLES=1)
|
||||
add_definitions(-DUSE_EGL=1)
|
||||
if(USE_GLES3)
|
||||
message("GLES3 rendering enabled")
|
||||
add_definitions(-DUSE_GLES=1 -DUSE_EGL=1 -DUSE_GLES3=1)
|
||||
include_directories(Externals/GLES3)
|
||||
set(USE_EGL True)
|
||||
set(USE_GLES True)
|
||||
else()
|
||||
if(USE_GLES)
|
||||
message("GLES2 rendering enabled. OpenGL disabled")
|
||||
add_definitions(-DUSE_GLES=1)
|
||||
add_definitions(-DUSE_EGL=1)
|
||||
set(USE_EGL True)
|
||||
endif()
|
||||
endif()
|
||||
# For now Wayland and EGL are tied to each other.
|
||||
# The alternative would be an shm path
|
||||
@ -291,18 +316,12 @@ if(USE_EGL)
|
||||
message("EGL OpenGL interface enabled")
|
||||
add_definitions(-DUSE_EGL=1)
|
||||
else()
|
||||
# Using GLX
|
||||
# Using GLX
|
||||
set(USE_X11 1)
|
||||
set(USE_WAYLAND 0)
|
||||
endif()
|
||||
add_definitions(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE)
|
||||
|
||||
if(ANDROID)
|
||||
message("Building for Android")
|
||||
add_definitions(-DANDROID)
|
||||
set(USE_X11 0)
|
||||
set(USE_WAYLAND 0)
|
||||
endif()
|
||||
########################################
|
||||
# Dependency checking
|
||||
#
|
||||
@ -378,8 +397,8 @@ if(NOT ANDROID)
|
||||
endif(OPENAL_FOUND)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
# Note: The convention is to check USE_X11 or USE_WAYLAND where needed.
|
||||
# This is where we detect platforms and set the variables accordingly.
|
||||
# Note: The convention is to check USE_X11 or USE_WAYLAND where needed.
|
||||
# This is where we detect platforms and set the variables accordingly.
|
||||
pkg_check_modules(WAYLAND wayland-egl wayland-client wayland-cursor)
|
||||
if(USE_WAYLAND AND WAYLAND_FOUND)
|
||||
pkg_check_modules(XKBCOMMON xkbcommon)
|
||||
@ -395,8 +414,8 @@ if(NOT ANDROID)
|
||||
add_definitions(-DHAVE_WAYLAND=0)
|
||||
endif(USE_WAYLAND AND WAYLAND_FOUND)
|
||||
|
||||
# Note: We do not need to explicitly check for X11 as it is done in the cmake
|
||||
# FindOpenGL module on linux.
|
||||
# Note: We do not need to explicitly check for X11 as it is done in the cmake
|
||||
# FindOpenGL module on linux.
|
||||
if(USE_X11 AND X11_FOUND)
|
||||
set(USE_X11 1)
|
||||
add_definitions(-DHAVE_X11=1)
|
||||
@ -408,11 +427,11 @@ if(NOT ANDROID)
|
||||
message("X11 support disabled")
|
||||
add_definitions(-DHAVE_X11=0)
|
||||
endif(USE_X11 AND X11_FOUND)
|
||||
|
||||
|
||||
if (NOT USE_WAYLAND AND NOT USE_X11)
|
||||
message(FATAL_ERROR "\n"
|
||||
"No suitable display platform found\n"
|
||||
"Requires wayland or x11 to run")
|
||||
"No suitable display platform found\n"
|
||||
"Requires wayland or x11 to run")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -423,6 +442,13 @@ if(NOT ANDROID)
|
||||
else()
|
||||
add_definitions(-DHAVE_XRANDR=0)
|
||||
endif(XRANDR_FOUND)
|
||||
|
||||
pkg_check_modules(XINPUT2 xi>=1.5.0)
|
||||
if(XINPUT2_FOUND)
|
||||
add_definitions(-DHAVE_X11_XINPUT2=1)
|
||||
else()
|
||||
add_definitions(-DHAVE_X11_XINPUT2=0)
|
||||
endif(XINPUT2_FOUND)
|
||||
endif()
|
||||
if(ENCODE_FRAMEDUMPS)
|
||||
check_libav()
|
||||
@ -526,17 +552,17 @@ if(NOT ANDROID)
|
||||
else(SDL2_FOUND)
|
||||
# SDL2 not found, try SDL
|
||||
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
include(FindSDL OPTIONAL)
|
||||
endif()
|
||||
if(SDL_FOUND)
|
||||
message("Using shared SDL")
|
||||
include_directories(${SDL_INCLUDE_DIR})
|
||||
else(SDL_FOUND)
|
||||
# TODO: Use the prebuilt one on Windows
|
||||
message("Using static SDL from Externals")
|
||||
include_directories(Externals/SDL/SDL Externals/SDL Externals/SDL/include)
|
||||
add_subdirectory(Externals/SDL)
|
||||
endif(SDL_FOUND)
|
||||
include(FindSDL OPTIONAL)
|
||||
endif()
|
||||
if(SDL_FOUND)
|
||||
message("Using shared SDL")
|
||||
include_directories(${SDL_INCLUDE_DIR})
|
||||
else(SDL_FOUND)
|
||||
# TODO: Use the prebuilt one on Windows
|
||||
message("Using static SDL from Externals")
|
||||
include_directories(Externals/SDL/SDL Externals/SDL Externals/SDL/include)
|
||||
add_subdirectory(Externals/SDL)
|
||||
endif(SDL_FOUND)
|
||||
endif(SDL2_FOUND)
|
||||
endif()
|
||||
|
||||
@ -557,11 +583,26 @@ 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
|
||||
message("Using shared SFML")
|
||||
message("Using shared SFML")
|
||||
else()
|
||||
message("Using static SFML ${SFML_FIND_VERSION_MAJOR}.${SFML_FIND_VERSION_MINOR} from Externals")
|
||||
add_subdirectory(Externals/SFML)
|
||||
include_directories(Externals/SFML/include)
|
||||
message("Using static SFML ${SFML_FIND_VERSION_MAJOR}.${SFML_FIND_VERSION_MINOR} from Externals")
|
||||
add_subdirectory(Externals/SFML)
|
||||
include_directories(Externals/SFML/include)
|
||||
endif()
|
||||
|
||||
if(USE_UPNP)
|
||||
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT ANDROID)
|
||||
include(FindMiniupnpc)
|
||||
endif()
|
||||
if(MINIUPNP_FOUND AND MINIUPNPC_VERSION_1_7_OR_HIGHER)
|
||||
message("Using shared miniupnpc")
|
||||
include_directories(${MINIUPNP_INCLUDE_DIR})
|
||||
else()
|
||||
message("Using static miniupnpc from Externals")
|
||||
add_subdirectory(Externals/miniupnpc)
|
||||
include_directories(Externals/miniupnpc/src)
|
||||
endif()
|
||||
add_definitions(-DUSE_UPNP)
|
||||
endif()
|
||||
|
||||
|
||||
@ -624,24 +665,9 @@ if(NOT DISABLE_WX AND NOT ANDROID)
|
||||
FIND_PACKAGE(wxWidgets COMPONENTS core aui adv)
|
||||
|
||||
if(wxWidgets_FOUND)
|
||||
EXECUTE_PROCESS(
|
||||
EXECUTE_PROCESS(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
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}"
|
||||
${wxWidgets_CONFIG_OPTIONS} --version
|
||||
${wxWidgets_CONFIG_OPTIONS} --version
|
||||
OUTPUT_VARIABLE wxWidgets_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET
|
||||
@ -658,26 +684,26 @@ if(NOT DISABLE_WX AND NOT ANDROID)
|
||||
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})
|
||||
endif()
|
||||
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()
|
||||
|
||||
if(wxWidgets_FOUND)
|
||||
include(${wxWidgets_USE_FILE})
|
||||
@ -700,7 +726,7 @@ if(NOT DISABLE_WX AND NOT ANDROID)
|
||||
else()
|
||||
message(FATAL_ERROR "wxWidgets in Externals is not compatible with your platform")
|
||||
endif()
|
||||
|
||||
|
||||
include_directories(
|
||||
Externals/wxWidgets3
|
||||
Externals/wxWidgets3/include)
|
||||
|
Reference in New Issue
Block a user