diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e1a9d1d98..2547e5c220 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,17 +42,17 @@ set(DISTRIBUTOR "None" CACHE STRING "Name of the distributor.") # Enable SDL for default on operating systems that aren't OSX, Android, Linux or Windows. if(NOT APPLE AND NOT ANDROID AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND NOT MSVC) - option(ENABLE_SDL "Enables SDL as a generic controller backend" ON) + option(ENABLE_SDL "Enables SDL as a generic controller backend" ON) else() - option(ENABLE_SDL "Enables SDL as a generic controller backend" OFF) + option(ENABLE_SDL "Enables SDL as a generic controller backend" OFF) endif() if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND NOT ANDROID) - option(ENABLE_EVDEV "Enables the evdev controller backend" ON) + option(ENABLE_EVDEV "Enables the evdev controller backend" ON) endif() if(APPLE) - option(OSX_USE_DEFAULT_SEARCH_PATH "Don't prioritize system library paths" OFF) + option(OSX_USE_DEFAULT_SEARCH_PATH "Don't prioritize system library paths" OFF) endif() option(ENCODE_FRAMEDUMPS "Encode framedumps in AVI format" ON) @@ -61,11 +61,11 @@ option(FASTLOG "Enable all logs" OFF) option(OPROFILING "Enable profiling" OFF) option(GDBSTUB "Enable gdb stub for remote debugging." OFF) if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - option(VTUNE "Enable Intel VTune integration for JIT symbols." OFF) + option(VTUNE "Enable Intel VTune integration for JIT symbols." OFF) endif() if(APPLE) - option(SKIP_POSTPROCESS_BUNDLE "Skip postprocessing bundle for redistributability" OFF) + option(SKIP_POSTPROCESS_BUNDLE "Skip postprocessing bundle for redistributability" OFF) endif() ######################################## # Optional Targets @@ -73,7 +73,7 @@ endif() option(DSPTOOL "Build dsptool" OFF) list(APPEND CMAKE_MODULE_PATH - ${CMAKE_SOURCE_DIR}/CMake + ${CMAKE_SOURCE_DIR}/CMake ) # Support functions @@ -94,9 +94,9 @@ set(mandir ${CMAKE_INSTALL_PREFIX}/share/man CACHE PATH "mandir") add_definitions(-DDATA_DIR="${datadir}/") if(CMAKE_SYSROOT) - # If we should use a sysroot, tell pkg-config to search for packages in there, not on the host - set(ENV{PKG_CONFIG_LIBDIR} "${CMAKE_SYSROOT}/usr/lib/pkgconfig:${CMAKE_SYSROOT}/usr/share/pkgconfig") - set(ENV{PKG_CONFIG_SYSROOT_DIR} "${CMAKE_SYSROOT}") + # If we should use a sysroot, tell pkg-config to search for packages in there, not on the host + set(ENV{PKG_CONFIG_LIBDIR} "${CMAKE_SYSROOT}/usr/lib/pkgconfig:${CMAKE_SYSROOT}/usr/share/pkgconfig") + set(ENV{PKG_CONFIG_SYSROOT_DIR} "${CMAKE_SYSROOT}") endif() # Set where the binary files will be built. The program will not execute from @@ -110,54 +110,54 @@ include(CCache) # for revision info find_package(Git) if(GIT_FOUND) - # make sure version information gets re-run when the current Git HEAD changes - execute_process(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --git-path HEAD - OUTPUT_VARIABLE dolphin_git_head_filename - OUTPUT_STRIP_TRAILING_WHITESPACE) - set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${dolphin_git_head_filename}") + # make sure version information gets re-run when the current Git HEAD changes + execute_process(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --git-path HEAD + OUTPUT_VARIABLE dolphin_git_head_filename + OUTPUT_STRIP_TRAILING_WHITESPACE) + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${dolphin_git_head_filename}") - execute_process(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --symbolic-full-name HEAD - OUTPUT_VARIABLE dolphin_git_head_symbolic - OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - COMMAND ${GIT_EXECUTABLE} rev-parse --git-path ${dolphin_git_head_symbolic} - OUTPUT_VARIABLE dolphin_git_head_symbolic_filename - OUTPUT_STRIP_TRAILING_WHITESPACE) - set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${dolphin_git_head_symbolic_filename}") + execute_process(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --symbolic-full-name HEAD + OUTPUT_VARIABLE dolphin_git_head_symbolic + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + COMMAND ${GIT_EXECUTABLE} rev-parse --git-path ${dolphin_git_head_symbolic} + OUTPUT_VARIABLE dolphin_git_head_symbolic_filename + OUTPUT_STRIP_TRAILING_WHITESPACE) + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${dolphin_git_head_symbolic_filename}") - # 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) + # 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 (and trailing "-0" if needed) from description - STRING(REGEX REPLACE "(-0)?-[^-]+((-dirty)?)$" "\\2" DOLPHIN_WC_DESCRIBE "${DOLPHIN_WC_DESCRIBE}") + # remove hash (and trailing "-0" if needed) from description + STRING(REGEX REPLACE "(-0)?-[^-]+((-dirty)?)$" "\\2" DOLPHIN_WC_DESCRIBE "${DOLPHIN_WC_DESCRIBE}") - # 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) + # 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 set(DOLPHIN_VERSION_MAJOR "5") set(DOLPHIN_VERSION_MINOR "0") if(DOLPHIN_WC_BRANCH STREQUAL "stable") - set(DOLPHIN_VERSION_PATCH "0") + set(DOLPHIN_VERSION_PATCH "0") else() - set(DOLPHIN_VERSION_PATCH ${DOLPHIN_WC_REVISION}) + set(DOLPHIN_VERSION_PATCH ${DOLPHIN_WC_REVISION}) endif() # If Dolphin is not built from a Git repository, default the version info to # reasonable values. if(NOT DOLPHIN_WC_REVISION) - set(DOLPHIN_WC_DESCRIBE "${DOLPHIN_VERSION_MAJOR}.${DOLPHIN_VERSION_MINOR}") - set(DOLPHIN_WC_REVISION "${DOLPHIN_WC_DESCRIBE} (no further info)") - set(DOLPHIN_WC_BRANCH "master") + set(DOLPHIN_WC_DESCRIBE "${DOLPHIN_VERSION_MAJOR}.${DOLPHIN_VERSION_MINOR}") + set(DOLPHIN_WC_REVISION "${DOLPHIN_WC_DESCRIBE} (no further info)") + set(DOLPHIN_WC_BRANCH "master") endif() # Architecture detection and arch specific settings @@ -168,163 +168,163 @@ message(STATUS "Detected architecture: ${CMAKE_SYSTEM_PROCESSOR}") # If we ever support a architecture that is 64bit with 32bit pointers then this'll break # Of course the chances of that are slim(x32?) so who cares if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(_ARCH_64 1) - add_definitions(-D_ARCH_64=1) + set(_ARCH_64 1) + add_definitions(-D_ARCH_64=1) else() - set(_ARCH_32 1) - add_definitions(-D_ARCH_32=1) + set(_ARCH_32 1) + add_definitions(-D_ARCH_32=1) endif() if(ENABLE_GENERIC) - message(STATUS "Warning! Building generic build!") - set(_M_GENERIC 1) - add_definitions(-D_M_GENERIC=1) + message(STATUS "Warning! Building generic build!") + set(_M_GENERIC 1) + add_definitions(-D_M_GENERIC=1) elseif(_ARCH_64 AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64") - set(_M_X86 1) - set(_M_X86_64 1) - add_definitions(-D_M_X86=1) - add_definitions(-D_M_X86_64=1) - check_and_add_flag(HAVE_SSE2 -msse2) + set(_M_X86 1) + set(_M_X86_64 1) + add_definitions(-D_M_X86=1) + add_definitions(-D_M_X86_64=1) + check_and_add_flag(HAVE_SSE2 -msse2) elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") - set(_M_ARM 1) - set(_M_ARM_64 1) - add_definitions(-D_M_ARM=1) - add_definitions(-D_M_ARM_64=1) - # CRC instruction set is used in the CRC32 hash function - check_and_add_flag(HAVE_ARCH_ARMV8 -march=armv8-a+crc) + set(_M_ARM 1) + set(_M_ARM_64 1) + add_definitions(-D_M_ARM=1) + add_definitions(-D_M_ARM_64=1) + # CRC instruction set is used in the CRC32 hash function + check_and_add_flag(HAVE_ARCH_ARMV8 -march=armv8-a+crc) else() - message(FATAL_ERROR "You're building on an unsupported platform: " - "'${CMAKE_SYSTEM_PROCESSOR}' with ${CMAKE_SIZEOF_VOID_P}-byte pointers." - " Enable generic build if you really want a JIT-less binary.") + message(FATAL_ERROR "You're building on an unsupported platform: " + "'${CMAKE_SYSTEM_PROCESSOR}' with ${CMAKE_SIZEOF_VOID_P}-byte pointers." + " Enable generic build if you really want a JIT-less binary.") endif() # Enforce minimum GCC version if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) - message(FATAL_ERROR "Dolphin requires at least GCC 5.0 (found ${CMAKE_CXX_COMPILER_VERSION})") + message(FATAL_ERROR "Dolphin requires at least GCC 5.0 (found ${CMAKE_CXX_COMPILER_VERSION})") endif() if(CMAKE_C_COMPILER_ID MATCHES "MSVC") - check_and_add_flag(EXCEPTIONS /EHsc) - dolphin_compile_definitions(-D_DEBUG DEBUG_ONLY) + check_and_add_flag(EXCEPTIONS /EHsc) + dolphin_compile_definitions(-D_DEBUG DEBUG_ONLY) - string(APPEND CMAKE_EXE_LINKER_FLAGS " /NXCOMPAT") - string(APPEND CMAKE_EXE_LINKER_FLAGS " /BASE:0x00400000") - string(APPEND CMAKE_EXE_LINKER_FLAGS " /DYNAMICBASE:NO") - string(APPEND CMAKE_EXE_LINKER_FLAGS " /FIXED") + string(APPEND CMAKE_EXE_LINKER_FLAGS " /NXCOMPAT") + string(APPEND CMAKE_EXE_LINKER_FLAGS " /BASE:0x00400000") + string(APPEND CMAKE_EXE_LINKER_FLAGS " /DYNAMICBASE:NO") + string(APPEND CMAKE_EXE_LINKER_FLAGS " /FIXED") - # Only MSBuild needs this, other generators will compile one file at a time - if(CMAKE_GENERATOR MATCHES "Visual Studio") - add_compile_options("/MP") - endif() + # Only MSBuild needs this, other generators will compile one file at a time + if(CMAKE_GENERATOR MATCHES "Visual Studio") + add_compile_options("/MP") + endif() else() - add_definitions(-D_DEFAULT_SOURCE) - check_and_add_flag(HAVE_WALL -Wall) - # TODO: would like these but they produce overwhelming amounts of warnings - #check_and_add_flag(EXTRA -Wextra) - #check_and_add_flag(MISSING_FIELD_INITIALIZERS -Wmissing-field-initializers) - #check_and_add_flag(SWITCH_DEFAULT -Wswitch-default) - #check_and_add_flag(FLOAT_EQUAL -Wfloat-equal) - #check_and_add_flag(CONVERSION -Wconversion) - #check_and_add_flag(ZERO_AS_NULL_POINTER_CONSTANT -Wzero-as-null-pointer-constant) - check_and_add_flag(TYPE_LIMITS -Wtype-limits) - check_and_add_flag(SIGN_COMPARE -Wsign-compare) - check_and_add_flag(IGNORED_QUALIFIERS -Wignored-qualifiers) - check_and_add_flag(UNINITIALIZED -Wuninitialized) - check_and_add_flag(LOGICAL_OP -Wlogical-op) - check_and_add_flag(SHADOW -Wshadow) - check_and_add_flag(INIT_SELF -Winit-self) - check_and_add_flag(MISSING_DECLARATIONS -Wmissing-declarations) - check_and_add_flag(MISSING_VARIABLE_DECLARATIONS -Wmissing-variable-declarations) + add_definitions(-D_DEFAULT_SOURCE) + check_and_add_flag(HAVE_WALL -Wall) + # TODO: would like these but they produce overwhelming amounts of warnings + #check_and_add_flag(EXTRA -Wextra) + #check_and_add_flag(MISSING_FIELD_INITIALIZERS -Wmissing-field-initializers) + #check_and_add_flag(SWITCH_DEFAULT -Wswitch-default) + #check_and_add_flag(FLOAT_EQUAL -Wfloat-equal) + #check_and_add_flag(CONVERSION -Wconversion) + #check_and_add_flag(ZERO_AS_NULL_POINTER_CONSTANT -Wzero-as-null-pointer-constant) + check_and_add_flag(TYPE_LIMITS -Wtype-limits) + check_and_add_flag(SIGN_COMPARE -Wsign-compare) + check_and_add_flag(IGNORED_QUALIFIERS -Wignored-qualifiers) + check_and_add_flag(UNINITIALIZED -Wuninitialized) + check_and_add_flag(LOGICAL_OP -Wlogical-op) + check_and_add_flag(SHADOW -Wshadow) + check_and_add_flag(INIT_SELF -Winit-self) + check_and_add_flag(MISSING_DECLARATIONS -Wmissing-declarations) + check_and_add_flag(MISSING_VARIABLE_DECLARATIONS -Wmissing-variable-declarations) - # gcc uses some optimizations which might break stuff without this flag - check_and_add_flag(NO_STRICT_ALIASING -fno-strict-aliasing) - check_and_add_flag(NO_EXCEPTIONS -fno-exceptions) + # gcc uses some optimizations which might break stuff without this flag + check_and_add_flag(NO_STRICT_ALIASING -fno-strict-aliasing) + check_and_add_flag(NO_EXCEPTIONS -fno-exceptions) - check_and_add_flag(VISIBILITY_INLINES_HIDDEN -fvisibility-inlines-hidden) - check_and_add_flag(VISIBILITY_HIDDEN -fvisibility=hidden) + check_and_add_flag(VISIBILITY_INLINES_HIDDEN -fvisibility-inlines-hidden) + check_and_add_flag(VISIBILITY_HIDDEN -fvisibility=hidden) - check_and_add_flag(FOMIT_FRAME_POINTER -fomit-frame-pointer RELEASE_ONLY) + check_and_add_flag(FOMIT_FRAME_POINTER -fomit-frame-pointer RELEASE_ONLY) - dolphin_compile_definitions(_DEBUG DEBUG_ONLY) - check_and_add_flag(GGDB -ggdb DEBUG_ONLY) + dolphin_compile_definitions(_DEBUG DEBUG_ONLY) + check_and_add_flag(GGDB -ggdb DEBUG_ONLY) - if(NOT ANDROID AND _M_X86_64) - # PIE is required on Android, but not supported with the x86_64 jit currently - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fno-pie") - check_c_compiler_flag("-no-pie" NO_PIE_UPSTREAM) - if(NO_PIE_UPSTREAM) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -no-pie") - endif() - endif() + if(NOT ANDROID AND _M_X86_64) + # PIE is required on Android, but not supported with the x86_64 jit currently + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fno-pie") + check_c_compiler_flag("-no-pie" NO_PIE_UPSTREAM) + if(NO_PIE_UPSTREAM) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -no-pie") + endif() + endif() endif() if(CMAKE_SYSTEM_NAME MATCHES "Darwin") - if(NOT OSX_USE_DEFAULT_SEARCH_PATH) - # Hack up the path to prioritize the path to built-in OS libraries to - # increase the chance of not depending on a bunch of copies of them - # installed by MacPorts, Fink, Homebrew, etc, and ending up copying - # them into the bundle. Since we optionally depend on libraries which - # are not part of OS X (ffmpeg, etc.), however, don't remove the default - # path entirely as was done in a previous version of this file. This is - # still kinda evil, since it defeats the user's path settings... - # See http://www.cmake.org/cmake/help/v3.0/command/find_program.html - list(APPEND CMAKE_PREFIX_PATH "/usr") - endif() + if(NOT OSX_USE_DEFAULT_SEARCH_PATH) + # Hack up the path to prioritize the path to built-in OS libraries to + # increase the chance of not depending on a bunch of copies of them + # installed by MacPorts, Fink, Homebrew, etc, and ending up copying + # them into the bundle. Since we optionally depend on libraries which + # are not part of OS X (ffmpeg, etc.), however, don't remove the default + # path entirely as was done in a previous version of this file. This is + # still kinda evil, since it defeats the user's path settings... + # See http://www.cmake.org/cmake/help/v3.0/command/find_program.html + list(APPEND CMAKE_PREFIX_PATH "/usr") + endif() - # Specify target CPUs. - check_and_add_flag(HAVE_MSSSE3 -mssse3) - check_and_add_flag(HAVE_ARCH_CORE2 -march=core2) + # Specify target CPUs. + check_and_add_flag(HAVE_MSSSE3 -mssse3) + check_and_add_flag(HAVE_ARCH_CORE2 -march=core2) - # Linker flags. - # Drop unreachable code and data. - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dead_strip,-dead_strip_dylibs") - # Reserve the minimum size for the zero page. - # Our JIT requires virtual memory space below 2GB, while the default zero - # page on x86_64 is 4GB in size. - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-pagezero_size,0x1000") + # Linker flags. + # Drop unreachable code and data. + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dead_strip,-dead_strip_dylibs") + # Reserve the minimum size for the zero page. + # Our JIT requires virtual memory space below 2GB, while the default zero + # page on x86_64 is 4GB in size. + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-pagezero_size,0x1000") - find_library(APPKIT_LIBRARY AppKit) - find_library(APPSERV_LIBRARY ApplicationServices) - find_library(AU_LIBRARY AudioUnit) - find_library(CARBON_LIBRARY Carbon) - find_library(COCOA_LIBRARY Cocoa) - find_library(COREAUDIO_LIBRARY CoreAudio) - find_library(COREFUND_LIBRARY CoreFoundation) - find_library(CORESERV_LIBRARY CoreServices) - find_library(FOUNDATION_LIBRARY Foundation) - find_library(IOB_LIBRARY IOBluetooth) - find_library(IOK_LIBRARY IOKit) - find_library(FORCEFEEDBACK ForceFeedback) - find_library(OPENGL_LIBRARY OpenGL) + find_library(APPKIT_LIBRARY AppKit) + find_library(APPSERV_LIBRARY ApplicationServices) + find_library(AU_LIBRARY AudioUnit) + find_library(CARBON_LIBRARY Carbon) + find_library(COCOA_LIBRARY Cocoa) + find_library(COREAUDIO_LIBRARY CoreAudio) + find_library(COREFUND_LIBRARY CoreFoundation) + find_library(CORESERV_LIBRARY CoreServices) + find_library(FOUNDATION_LIBRARY Foundation) + find_library(IOB_LIBRARY IOBluetooth) + find_library(IOK_LIBRARY IOKit) + find_library(FORCEFEEDBACK ForceFeedback) + find_library(OPENGL_LIBRARY OpenGL) - # Link against OS X system frameworks. - list(APPEND LIBS - ${APPKIT_LIBRARY} - ${AU_LIBRARY} - ${COREAUDIO_LIBRARY} - ${COREFUND_LIBRARY} - ${CORESERV_LIBRARY} - ${IOK_LIBRARY} - ${FORCEFEEDBACK} - ) + # Link against OS X system frameworks. + list(APPEND LIBS + ${APPKIT_LIBRARY} + ${AU_LIBRARY} + ${COREAUDIO_LIBRARY} + ${COREFUND_LIBRARY} + ${CORESERV_LIBRARY} + ${IOK_LIBRARY} + ${FORCEFEEDBACK} + ) endif() if(ENABLE_LTO) - check_and_add_flag(LTO -flto) - if(CMAKE_CXX_COMPILER_ID STREQUAL GNU) - set(CMAKE_AR gcc-ar) - set(CMAKE_RANLIB gcc-ranlib) - endif() + check_and_add_flag(LTO -flto) + if(CMAKE_CXX_COMPILER_ID STREQUAL GNU) + set(CMAKE_AR gcc-ar) + set(CMAKE_RANLIB gcc-ranlib) + endif() endif() # Add an option to build relocatable binaries on Linux # The Sys folder will need to be copied to the Binaries folder. if(UNIX) - option(LINUX_LOCAL_DEV "Enable relocatable binary" OFF) - if(LINUX_LOCAL_DEV) - add_definitions(-DLINUX_LOCAL_DEV) - endif() + option(LINUX_LOCAL_DEV "Enable relocatable binary" OFF) + if(LINUX_LOCAL_DEV) + add_definitions(-DLINUX_LOCAL_DEV) + endif() endif() # BSDs put packages in /usr/local instead of /usr, so we need to @@ -333,83 +333,83 @@ endif() # changes, so just setting them in the project scope via # include_directories and link_directories is not sufficient if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD|NetBSD") - set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};/usr/local") - set(CMAKE_REQUIRED_INCLUDES "/usr/local/include") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/lib") + set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};/usr/local") + set(CMAKE_REQUIRED_INCLUDES "/usr/local/include") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/lib") endif() # Dolphin requires threads. find_package(Threads) if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release" CACHE STRING - "Build type (Release/Debug/RelWithDebInfo/MinSizeRel)" FORCE) + set(CMAKE_BUILD_TYPE "Release" CACHE STRING + "Build type (Release/Debug/RelWithDebInfo/MinSizeRel)" FORCE) endif() option(ENABLE_GPROF "Enable gprof profiling (must be using Debug build)" OFF) if(ENABLE_GPROF) - check_and_add_flag(HAVE_PG -pg) - if(NOT FLAG_C_HAVE_PG) - message(FATAL_ERROR "Compiler option -pg is not supported") - endif() - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg") + check_and_add_flag(HAVE_PG -pg) + if(NOT FLAG_C_HAVE_PG) + message(FATAL_ERROR "Compiler option -pg is not supported") + endif() + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg") endif() if(FASTLOG) - add_definitions(-DDEBUGFAST) + add_definitions(-DDEBUGFAST) endif() if(GDBSTUB) - add_definitions(-DUSE_GDBSTUB) + add_definitions(-DUSE_GDBSTUB) endif() if(VTUNE) - if(EXISTS "$ENV{VTUNE_AMPLIFIER_XE_2015_DIR}") - set(VTUNE_DIR "$ENV{VTUNE_AMPLIFIER_XE_2015_DIR}") - elseif(EXISTS "$ENV{VTUNE_AMPLIFIER_XE_2013_DIR}") - set(VTUNE_DIR "$ENV{VTUNE_AMPLIFIER_XE_2013_DIR}") - else() - message(ERROR "Could find neither VTUNE_AMPLIFIER_XE_2015_DIR nor VTUNE_AMPLIFIER_XE_2013_DIR.") - endif() - add_definitions(-DUSE_VTUNE) - include_directories("${VTUNE_DIR}/include") - set(VTUNE_LIBRARIES - "${VTUNE_DIR}/lib64/libjitprofiling.a" - "${VTUNE_DIR}/lib64/libittnotify.a" - ) + if(EXISTS "$ENV{VTUNE_AMPLIFIER_XE_2015_DIR}") + set(VTUNE_DIR "$ENV{VTUNE_AMPLIFIER_XE_2015_DIR}") + elseif(EXISTS "$ENV{VTUNE_AMPLIFIER_XE_2013_DIR}") + set(VTUNE_DIR "$ENV{VTUNE_AMPLIFIER_XE_2013_DIR}") + else() + message(ERROR "Could find neither VTUNE_AMPLIFIER_XE_2015_DIR nor VTUNE_AMPLIFIER_XE_2013_DIR.") + endif() + add_definitions(-DUSE_VTUNE) + include_directories("${VTUNE_DIR}/include") + set(VTUNE_LIBRARIES + "${VTUNE_DIR}/lib64/libjitprofiling.a" + "${VTUNE_DIR}/lib64/libittnotify.a" + ) endif() if(ANDROID) - message(STATUS "Building for Android") - if(NOT ENABLE_HEADLESS) - add_definitions(-DANDROID) - else() - # Lie to cmake a bit. We are cross compiling to Android - # but not as a shared library. We want an executable. - set(ANDROID 0) - endif() - set(USE_X11 0) - set(USE_UPNP 0) - set(USE_EGL 1) - set(DISABLE_WX 1) - set(ENABLE_QT2 0) + message(STATUS "Building for Android") + if(NOT ENABLE_HEADLESS) + add_definitions(-DANDROID) + else() + # Lie to cmake a bit. We are cross compiling to Android + # but not as a shared library. We want an executable. + set(ANDROID 0) + endif() + set(USE_X11 0) + set(USE_UPNP 0) + set(USE_EGL 1) + set(DISABLE_WX 1) + set(ENABLE_QT2 0) - # We are cross compiling, search only the toolchain for libraries and includes - SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) - SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) - SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) - SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) + # We are cross compiling, search only the toolchain for libraries and includes + SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") - list(APPEND LIBS rt) + list(APPEND LIBS rt) endif() if(ENABLE_HEADLESS) - message(STATUS "Enabling Headless! Disabling GUI, force enabling EGL!") - set(USE_X11 0) - set(USE_EGL 1) - set(DISABLE_WX 1) - set(ENABLE_QT2 0) - add_definitions(-DUSE_HEADLESS) + message(STATUS "Enabling Headless! Disabling GUI, force enabling EGL!") + set(USE_X11 0) + set(USE_EGL 1) + set(DISABLE_WX 1) + set(ENABLE_QT2 0) + add_definitions(-DUSE_HEADLESS) endif() # Set file offset size to 64 bits. @@ -418,8 +418,8 @@ endif() # glibc, which may default to 32 bits. glibc allows this to be configured # by setting _FILE_OFFSET_BITS. if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows") - add_definitions(-D_FILE_OFFSET_BITS=64) - add_definitions(-D_LARGEFILE_SOURCE) + add_definitions(-D_FILE_OFFSET_BITS=64) + add_definitions(-D_LARGEFILE_SOURCE) endif() ######################################## @@ -433,115 +433,115 @@ include(CheckCXXSourceRuns) find_package(OpenGL) if (OPENGL_GL) - include_directories(${OPENGL_INCLUDE_DIR}) + include_directories(${OPENGL_INCLUDE_DIR}) endif() set(USE_X11 0) if(UNIX AND NOT APPLE AND NOT ANDROID AND NOT ENABLE_HEADLESS) - find_package(X11) - if(TRY_X11 AND X11_FOUND) - set(USE_X11 1) - add_definitions(-DHAVE_X11=1) - include_directories(${X11_INCLUDE_DIR}) - message(STATUS "X11 support enabled") - else() - set(USE_X11 0) - SET(X11_FOUND "") - message(STATUS "X11 support disabled") - add_definitions(-DHAVE_X11=0) - endif() + find_package(X11) + if(TRY_X11 AND X11_FOUND) + set(USE_X11 1) + add_definitions(-DHAVE_X11=1) + include_directories(${X11_INCLUDE_DIR}) + message(STATUS "X11 support enabled") + else() + set(USE_X11 0) + SET(X11_FOUND "") + message(STATUS "X11 support disabled") + add_definitions(-DHAVE_X11=0) + endif() - if (NOT USE_X11) - message(FATAL_ERROR "\n" - "No suitable display platform found\n" - "Requires x11 to run") - endif() + if (NOT USE_X11) + message(FATAL_ERROR "\n" + "No suitable display platform found\n" + "Requires x11 to run") + endif() endif() if(USE_X11) - check_lib(XRANDR xrandr Xrandr) - if(XRANDR_FOUND) - add_definitions(-DHAVE_XRANDR=1) - else() - add_definitions(-DHAVE_XRANDR=0) - endif() + check_lib(XRANDR xrandr Xrandr) + if(XRANDR_FOUND) + add_definitions(-DHAVE_XRANDR=1) + else() + add_definitions(-DHAVE_XRANDR=0) + endif() - pkg_check_modules(X11_INPUT REQUIRED xi>=1.5.0) + pkg_check_modules(X11_INPUT REQUIRED xi>=1.5.0) endif() if(ENCODE_FRAMEDUMPS) - check_libav() - if(LIBAV_FOUND) - LIST(APPEND LIBS ${LIBAV_LDFLAGS}) - endif() + check_libav() + if(LIBAV_FOUND) + LIST(APPEND LIBS ${LIBAV_LDFLAGS}) + endif() endif() if(NOT ANDROID) - set(PORTAUDIO_FOUND TRUE) - add_definitions(-DHAVE_PORTAUDIO=1) + set(PORTAUDIO_FOUND TRUE) + add_definitions(-DHAVE_PORTAUDIO=1) - if(NOT APPLE) - set(CMAKE_REQUIRED_LIBRARIES portaudio) - CHECK_CXX_SOURCE_RUNS( - "#include - int main(int argc, char **argv) - { if(Pa_GetVersion() >= 1890) return 0; else return 1; }" - SYSTEM_PORTAUDIO) - unset(CMAKE_REQUIRED_LIBRARIES) - endif() - if(SYSTEM_PORTAUDIO AND NOT APPLE) - message(STATUS "Using shared PortAudio for mic support") - set(PORTAUDIO_LIBRARIES portaudio) - else() - message(STATUS "Using static PortAudio from Externals for mic support") - option(PA_USE_ASIO "Enable PortAudio support for ASIO" OFF) - option(PA_USE_DS "Enable PortAudio support for DirectSound" OFF) - option(PA_USE_WDMKS "Enable PortAudio support for WDMKS" OFF) - add_subdirectory(Externals/portaudio EXCLUDE_FROM_ALL) - set(PORTAUDIO_LIBRARIES portaudio_static) - endif() + if(NOT APPLE) + set(CMAKE_REQUIRED_LIBRARIES portaudio) + CHECK_CXX_SOURCE_RUNS( + "#include + int main(int argc, char **argv) + { if(Pa_GetVersion() >= 1890) return 0; else return 1; }" + SYSTEM_PORTAUDIO) + unset(CMAKE_REQUIRED_LIBRARIES) + endif() + if(SYSTEM_PORTAUDIO AND NOT APPLE) + message(STATUS "Using shared PortAudio for mic support") + set(PORTAUDIO_LIBRARIES portaudio) + else() + message(STATUS "Using static PortAudio from Externals for mic support") + option(PA_USE_ASIO "Enable PortAudio support for ASIO" OFF) + option(PA_USE_DS "Enable PortAudio support for DirectSound" OFF) + option(PA_USE_WDMKS "Enable PortAudio support for WDMKS" OFF) + add_subdirectory(Externals/portaudio EXCLUDE_FROM_ALL) + set(PORTAUDIO_LIBRARIES portaudio_static) + endif() endif() if(OPROFILING) - find_package(OProfile) - if(OPROFILE_FOUND) - message(STATUS "OProfile found, enabling profiling support") - add_definitions(-DUSE_OPROFILE=1) - include_directories(${OPROFILE_INCLUDE_DIRS}) - else() - message(FATAL_ERROR "OProfile not found. Can't build profiling support.") - endif() + find_package(OProfile) + if(OPROFILE_FOUND) + message(STATUS "OProfile found, enabling profiling support") + add_definitions(-DUSE_OPROFILE=1) + include_directories(${OPROFILE_INCLUDE_DIRS}) + else() + message(FATAL_ERROR "OProfile not found. Can't build profiling support.") + endif() endif() if(USE_EGL) - message(STATUS "EGL OpenGL interface enabled") - add_definitions(-DUSE_EGL=1) + message(STATUS "EGL OpenGL interface enabled") + add_definitions(-DUSE_EGL=1) endif() if(ENABLE_EVDEV) - find_package(Libudev REQUIRED) - find_package(Libevdev REQUIRED) - if(LIBUDEV_FOUND AND LIBEVDEV_FOUND) - message(STATUS "libevdev/libudev found, enabling evdev controller backend") - add_definitions(-DHAVE_LIBUDEV=1) - add_definitions(-DHAVE_LIBEVDEV=1) - include_directories(${LIBUDEV_INCLUDE_DIR} ${LIBEVDEV_INCLUDE_DIR}) - else() - message(FATAL_ERROR "Couldn't find libevdev and/or libudev. Can't build evdev controller backend.\nDisable ENABLE_EVDEV if you wish to build without controller support") - endif() + find_package(Libudev REQUIRED) + find_package(Libevdev REQUIRED) + if(LIBUDEV_FOUND AND LIBEVDEV_FOUND) + message(STATUS "libevdev/libudev found, enabling evdev controller backend") + add_definitions(-DHAVE_LIBUDEV=1) + add_definitions(-DHAVE_LIBEVDEV=1) + include_directories(${LIBUDEV_INCLUDE_DIR} ${LIBEVDEV_INCLUDE_DIR}) + else() + message(FATAL_ERROR "Couldn't find libevdev and/or libudev. Can't build evdev controller backend.\nDisable ENABLE_EVDEV if you wish to build without controller support") + endif() endif() if(UNIX) - message(STATUS "Using named pipes as controller inputs") - add_definitions(-DUSE_PIPES=1) - message(STATUS "Watching game memory for changes") - add_definitions(-DUSE_MEMORYWATCHER=1) + message(STATUS "Using named pipes as controller inputs") + add_definitions(-DUSE_PIPES=1) + message(STATUS "Watching game memory for changes") + add_definitions(-DUSE_MEMORYWATCHER=1) endif() if(ENABLE_ANALYTICS) - message(STATUS "Enabling analytics collection (subject to end-user opt-in)") - add_definitions(-DUSE_ANALYTICS=1) + message(STATUS "Enabling analytics collection (subject to end-user opt-in)") + add_definitions(-DUSE_ANALYTICS=1) endif() ######################################## @@ -549,7 +549,7 @@ endif() # include_directories(Source/Core) if(ANDROID) - include_directories(Source/Android) + include_directories(Source/Android) endif() ######################################## @@ -570,306 +570,306 @@ add_subdirectory(Externals/glslang) add_subdirectory(Externals/cpp-optparse) if(USE_SHARED_ENET) - check_lib(ENET libenet enet enet/enet.h QUIET) - include(CheckSymbolExists) - if (ENET_FOUND) - set(CMAKE_REQUIRED_INCLUDES ${ENET_INCLUDE_DIRS}) - # hack: LDFLAGS already contains -lenet but all flags but the first are - # dropped; ugh, cmake - set(CMAKE_REQUIRED_FLAGS ${ENET_LDFLAGS}) - set(CMAKE_REQUIRED_LIBRARIES ${ENET_LIBRARIES}) - CHECK_SYMBOL_EXISTS(enet_socket_get_address enet/enet.h ENET_HAVE_SGA) - set(CMAKE_REQUIRED_INCLUDES) - set(CMAKE_REQUIRED_FLAGS) - set(CMAKE_REQUIRED_LIBRARIES) - if (NOT ENET_HAVE_SGA) - # enet is too old - set(ENET_FOUND FALSE) - endif() - endif() + check_lib(ENET libenet enet enet/enet.h QUIET) + include(CheckSymbolExists) + if (ENET_FOUND) + set(CMAKE_REQUIRED_INCLUDES ${ENET_INCLUDE_DIRS}) + # hack: LDFLAGS already contains -lenet but all flags but the first are + # dropped; ugh, cmake + set(CMAKE_REQUIRED_FLAGS ${ENET_LDFLAGS}) + set(CMAKE_REQUIRED_LIBRARIES ${ENET_LIBRARIES}) + CHECK_SYMBOL_EXISTS(enet_socket_get_address enet/enet.h ENET_HAVE_SGA) + set(CMAKE_REQUIRED_INCLUDES) + set(CMAKE_REQUIRED_FLAGS) + set(CMAKE_REQUIRED_LIBRARIES) + if (NOT ENET_HAVE_SGA) + # enet is too old + set(ENET_FOUND FALSE) + endif() + endif() endif() if (ENET_FOUND) - message(STATUS "Using shared enet") + message(STATUS "Using shared enet") else() - message(STATUS "Using static enet from Externals") - include_directories(Externals/enet/include) - add_subdirectory(Externals/enet) + message(STATUS "Using static enet from Externals") + include_directories(Externals/enet/include) + add_subdirectory(Externals/enet) endif() LIST(APPEND LIBS enet) if(NOT XXHASH_FOUND) - message(STATUS "Using static xxhash from Externals") - add_subdirectory(Externals/xxhash) - include_directories(Externals/xxhash) + message(STATUS "Using static xxhash from Externals") + add_subdirectory(Externals/xxhash) + include_directories(Externals/xxhash) endif() LIST(APPEND LIBS xxhash) find_package(ZLIB) if(ZLIB_FOUND) - message(STATUS "Using shared zlib") - include_directories(${ZLIB_INCLUDE_DIRS}) + message(STATUS "Using shared zlib") + include_directories(${ZLIB_INCLUDE_DIRS}) else() - message(STATUS "Shared zlib not found, falling back to the static library") - add_subdirectory(Externals/zlib) - include_directories(Externals/zlib) + message(STATUS "Shared zlib not found, falling back to the static library") + add_subdirectory(Externals/zlib) + include_directories(Externals/zlib) endif() if(NOT APPLE) - check_lib(LZO "(no .pc for lzo2)" lzo2 lzo/lzo1x.h QUIET) + check_lib(LZO "(no .pc for lzo2)" lzo2 lzo/lzo1x.h QUIET) endif() if(LZO_FOUND) - message(STATUS "Using shared lzo") + message(STATUS "Using shared lzo") else() - message(STATUS "Using static lzo from Externals") - add_subdirectory(Externals/LZO) - include_directories(Externals/LZO) - set(LZO lzo2) + message(STATUS "Using static lzo from Externals") + add_subdirectory(Externals/LZO) + include_directories(Externals/LZO) + set(LZO lzo2) endif() list(APPEND LIBS ${LZO}) if(NOT APPLE) - check_lib(PNG libpng png png.h QUIET) + check_lib(PNG libpng png png.h QUIET) endif() if (PNG_FOUND) - message(STATUS "Using shared libpng") + message(STATUS "Using shared libpng") else() - message(STATUS "Using static libpng from Externals") - add_subdirectory(Externals/libpng) - include_directories(Externals/libpng) - set(PNG png) + message(STATUS "Using static libpng from Externals") + add_subdirectory(Externals/libpng) + include_directories(Externals/libpng) + set(PNG png) endif() find_package(OpenAL) if(OPENAL_FOUND) - if(NOT APPLE) - check_lib(SOUNDTOUCH soundtouch SoundTouch soundtouch/SoundTouch.h QUIET) - endif() - if (SOUNDTOUCH_FOUND) - message(STATUS "Using shared soundtouch") - else() - message(STATUS "Using static soundtouch from Externals") - add_subdirectory(Externals/soundtouch) - include_directories(Externals) - endif() + if(NOT APPLE) + check_lib(SOUNDTOUCH soundtouch SoundTouch soundtouch/SoundTouch.h QUIET) + endif() + if (SOUNDTOUCH_FOUND) + message(STATUS "Using shared soundtouch") + else() + message(STATUS "Using static soundtouch from Externals") + add_subdirectory(Externals/soundtouch) + include_directories(Externals) + endif() endif() if(NOT ANDROID) - add_definitions(-D__LIBUSB__) - if(NOT APPLE) - find_package(LibUSB) - endif() - if(LIBUSB_FOUND AND NOT APPLE) - message(STATUS "Using shared LibUSB") - include_directories(${LIBUSB_INCLUDE_DIR}) - else() - message(STATUS "Using static LibUSB from Externals") - add_subdirectory(Externals/libusb) - set(LIBUSB_LIBRARIES usb) - endif() - set(LIBUSB_FOUND true) + add_definitions(-D__LIBUSB__) + if(NOT APPLE) + find_package(LibUSB) + endif() + if(LIBUSB_FOUND AND NOT APPLE) + message(STATUS "Using shared LibUSB") + include_directories(${LIBUSB_INCLUDE_DIR}) + else() + message(STATUS "Using static LibUSB from Externals") + add_subdirectory(Externals/libusb) + set(LIBUSB_LIBRARIES usb) + endif() + set(LIBUSB_FOUND true) endif() set(SFML_REQD_VERSION 2.1) if(NOT APPLE) - find_package(SFML ${SFML_REQD_VERSION} COMPONENTS network system) + find_package(SFML ${SFML_REQD_VERSION} COMPONENTS network system) endif() if(SFML_FOUND) - message(STATUS "Using shared SFML") + message(STATUS "Using shared SFML") else() - message(STATUS "Using static SFML ${SFML_REQD_VERSION} from Externals") - add_definitions(-DSFML_STATIC) - add_subdirectory(Externals/SFML) - include_directories(BEFORE Externals/SFML/include) + message(STATUS "Using static SFML ${SFML_REQD_VERSION} from Externals") + add_definitions(-DSFML_STATIC) + add_subdirectory(Externals/SFML) + include_directories(BEFORE Externals/SFML/include) endif() if(USE_UPNP) - if(NOT APPLE) - find_package(Miniupnpc) - endif() - if(MINIUPNPC_FOUND AND MINIUPNPC_API_VERSION GREATER 8) - message(STATUS "Using shared miniupnpc") - else() - message(STATUS "Using static miniupnpc from Externals") - add_subdirectory(Externals/miniupnpc) - set(MINIUPNPC_INCLUDE_DIRS Externals/miniupnpc/src) - set(MINIUPNPC_LIBRARIES miniupnpc) - endif() - add_definitions(-DUSE_UPNP) - include_directories(${MINIUPNPC_INCLUDE_DIRS}) - list(APPEND LIBS ${MINIUPNPC_LIBRARIES}) + if(NOT APPLE) + find_package(Miniupnpc) + endif() + if(MINIUPNPC_FOUND AND MINIUPNPC_API_VERSION GREATER 8) + message(STATUS "Using shared miniupnpc") + else() + message(STATUS "Using static miniupnpc from Externals") + add_subdirectory(Externals/miniupnpc) + set(MINIUPNPC_INCLUDE_DIRS Externals/miniupnpc/src) + set(MINIUPNPC_LIBRARIES miniupnpc) + endif() + add_definitions(-DUSE_UPNP) + include_directories(${MINIUPNPC_INCLUDE_DIRS}) + list(APPEND LIBS ${MINIUPNPC_LIBRARIES}) endif() if(NOT APPLE) - find_package(MbedTLS) + find_package(MbedTLS) endif() if(MBEDTLS_FOUND) - message(STATUS "Using shared mbed TLS") - include_directories(${MBEDTLS_INCLUDE_DIRS}) + message(STATUS "Using shared mbed TLS") + include_directories(${MBEDTLS_INCLUDE_DIRS}) else() - message(STATUS "Using static mbed TLS from Externals") - set(MBEDTLS_LIBRARIES mbedtls mbedcrypto mbedx509) - add_subdirectory(Externals/mbedtls/) - include_directories(Externals/mbedtls/include) + message(STATUS "Using static mbed TLS from Externals") + set(MBEDTLS_LIBRARIES mbedtls mbedcrypto mbedx509) + add_subdirectory(Externals/mbedtls/) + include_directories(Externals/mbedtls/include) endif() find_package(CURL) if(CURL_FOUND) - message(STATUS "Using shared libcurl") - include_directories(${CURL_INCLUDE_DIRS}) + message(STATUS "Using shared libcurl") + include_directories(${CURL_INCLUDE_DIRS}) else() - message(STATUS "Using static libcurl from Externals") - add_subdirectory(Externals/curl) - set(CURL_LIBRARIES curl) - include_directories(BEFORE Externals/curl/include) + message(STATUS "Using static libcurl from Externals") + add_subdirectory(Externals/curl) + set(CURL_LIBRARIES curl) + include_directories(BEFORE Externals/curl/include) endif() if(NOT APPLE) - check_lib(SOIL "(no .pc for SOIL)" SOIL SOIL/SOIL.h QUIET) + check_lib(SOIL "(no .pc for SOIL)" SOIL SOIL/SOIL.h QUIET) endif() if(SOIL_FOUND) - message(STATUS "Using shared SOIL") + message(STATUS "Using shared SOIL") else() - message(STATUS "Using static SOIL from Externals") - add_subdirectory(Externals/SOIL) - include_directories(Externals/SOIL) + message(STATUS "Using static SOIL from Externals") + add_subdirectory(Externals/SOIL) + include_directories(Externals/SOIL) endif() find_library(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c) find_path(ICONV_INCLUDE_DIR NAMES iconv.h) if (ICONV_LIBRARIES AND ICONV_INCLUDE_DIR) - mark_as_advanced(ICONV_INCLUDE_DIR ICONV_LIBRARIES) + mark_as_advanced(ICONV_INCLUDE_DIR ICONV_LIBRARIES) else() - message(STATUS "Using static iconv from Externals") - include_directories(Externals/libiconv-1.14/include) - add_subdirectory(Externals/libiconv-1.14) - set(ICONV_LIBRARIES iconv) + message(STATUS "Using static iconv from Externals") + include_directories(Externals/libiconv-1.14/include) + add_subdirectory(Externals/libiconv-1.14) + set(ICONV_LIBRARIES iconv) endif() list(APPEND LIBS ${ICONV_LIBRARIES}) if(NOT ANDROID) - find_package(HIDAPI) - if(HIDAPI_FOUND) - message(STATUS "Using shared ${HIDAPI_LIBRARIES} ${HIDAPI_VERSION}") - include_directories(${HIDAPI_INCLUDE_DIRS}) - list(APPEND LIBS ${HIDAPI_LIBRARIES}) - else() - include_directories(Externals/hidapi/hidapi) - if(APPLE) - message(STATUS "Using static hidapi from Externals") - add_subdirectory(Externals/hidapi/mac) - list(APPEND LIBS hidapi) - elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - message(STATUS "Using static hidapi-hidraw from Externals") - add_subdirectory(Externals/hidapi/linux) - list(APPEND LIBS hidapi-hidraw udev) - elseif(MSVC) - message(STATUS "Using static hidapi-hid from Externals") - add_subdirectory(Externals/hidapi/windows) - list(APPEND LIBS hidapi-hid) - else() - message(STATUS "Using static hidapi-libusb from Externals") - add_subdirectory(Externals/hidapi/libusb) - list(APPEND LIBS hidapi-libusb) - endif() - endif() - set(HIDAPI_FOUND 1) - add_definitions(-DHAVE_HIDAPI=1) + find_package(HIDAPI) + if(HIDAPI_FOUND) + message(STATUS "Using shared ${HIDAPI_LIBRARIES} ${HIDAPI_VERSION}") + include_directories(${HIDAPI_INCLUDE_DIRS}) + list(APPEND LIBS ${HIDAPI_LIBRARIES}) + else() + include_directories(Externals/hidapi/hidapi) + if(APPLE) + message(STATUS "Using static hidapi from Externals") + add_subdirectory(Externals/hidapi/mac) + list(APPEND LIBS hidapi) + elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + message(STATUS "Using static hidapi-hidraw from Externals") + add_subdirectory(Externals/hidapi/linux) + list(APPEND LIBS hidapi-hidraw udev) + elseif(MSVC) + message(STATUS "Using static hidapi-hid from Externals") + add_subdirectory(Externals/hidapi/windows) + list(APPEND LIBS hidapi-hid) + else() + message(STATUS "Using static hidapi-libusb from Externals") + add_subdirectory(Externals/hidapi/libusb) + list(APPEND LIBS hidapi-libusb) + endif() + endif() + set(HIDAPI_FOUND 1) + add_definitions(-DHAVE_HIDAPI=1) endif() if(NOT DISABLE_WX) - find_package(wxWidgets COMPONENTS core aui adv) + find_package(wxWidgets COMPONENTS core aui adv) - if(_ARCH_32) - add_definitions(-DwxSIZE_T_IS_UINT) - endif() + if(_ARCH_32) + add_definitions(-DwxSIZE_T_IS_UINT) + endif() - if(wxWidgets_FOUND) - 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(STATUS "Found wxWidgets version ${wxWidgets_VERSION}") - set(wxMIN_VERSION "3.1.0") - if(${wxWidgets_VERSION} VERSION_LESS ${wxMIN_VERSION}) - message(STATUS "At least ${wxMIN_VERSION} is required; ignoring found version") - unset(wxWidgets_FOUND) - endif() - endif() + if(wxWidgets_FOUND) + 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(STATUS "Found wxWidgets version ${wxWidgets_VERSION}") + set(wxMIN_VERSION "3.1.0") + if(${wxWidgets_VERSION} VERSION_LESS ${wxMIN_VERSION}) + message(STATUS "At least ${wxMIN_VERSION} is required; ignoring found version") + unset(wxWidgets_FOUND) + endif() + 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+-2.0 gtk.h REQUIRED) - else() - find_package(GTK2) - if(GTK2_FOUND) - include_directories(${GTK2_INCLUDE_DIRS}) - list(APPEND LIBS ${GTK2_LIBRARIES}) - else() - message(FATAL_ERROR "GTK is required to build the WX UI. Please install the GTK development libraries.") - endif() - endif() - 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+-2.0 gtk.h REQUIRED) + else() + find_package(GTK2) + if(GTK2_FOUND) + include_directories(${GTK2_INCLUDE_DIRS}) + list(APPEND LIBS ${GTK2_LIBRARIES}) + else() + message(FATAL_ERROR "GTK is required to build the WX UI. Please install the GTK development libraries.") + endif() + endif() + endif() - if(wxWidgets_FOUND) - include(${wxWidgets_USE_FILE}) - message(STATUS "wxWidgets found, enabling GUI build") - else() - message(STATUS "Using static wxWidgets from Externals") + if(wxWidgets_FOUND) + include(${wxWidgets_USE_FILE}) + message(STATUS "wxWidgets found, enabling GUI build") + else() + message(STATUS "Using static wxWidgets from Externals") - # These definitions and includes are used when building dolphin against wx, - # not when building wx itself (see wxw3 CMakeLists.txt for that) - if(APPLE) - elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD") - # Check for required libs - check_lib(GTHREAD2 gthread-2.0 gthread-2.0 glib/gthread.h REQUIRED) - check_lib(PANGOCAIRO pangocairo pangocairo pango/pangocairo.h REQUIRED) - # On Linux "backtrace" is part of glibc. FreeBSD has a separate library. - # Required for wxUSE_STACKWALKER in Externals/wxWidgets3/wx/wxgtk.h - find_package(Backtrace REQUIRED) - elseif(WIN32) - else() - message(FATAL_ERROR "wxWidgets in Externals is not compatible with your platform") - endif() + # These definitions and includes are used when building dolphin against wx, + # not when building wx itself (see wxw3 CMakeLists.txt for that) + if(APPLE) + elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD") + # Check for required libs + check_lib(GTHREAD2 gthread-2.0 gthread-2.0 glib/gthread.h REQUIRED) + check_lib(PANGOCAIRO pangocairo pangocairo pango/pangocairo.h REQUIRED) + # On Linux "backtrace" is part of glibc. FreeBSD has a separate library. + # Required for wxUSE_STACKWALKER in Externals/wxWidgets3/wx/wxgtk.h + find_package(Backtrace REQUIRED) + elseif(WIN32) + else() + message(FATAL_ERROR "wxWidgets in Externals is not compatible with your platform") + endif() - include_directories(SYSTEM - Externals/wxWidgets3 - Externals/wxWidgets3/include) - add_subdirectory(Externals/wxWidgets3) - set(wxWidgets_FOUND TRUE) - set(wxWidgets_LIBRARIES "wx") - endif() + include_directories(SYSTEM + Externals/wxWidgets3 + Externals/wxWidgets3/include) + add_subdirectory(Externals/wxWidgets3) + set(wxWidgets_FOUND TRUE) + set(wxWidgets_LIBRARIES "wx") + endif() endif() if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD") - set(LIBS ${LIBS} usbhid) + set(LIBS ${LIBS} usbhid) endif() ######################################## # Pre-build events: Define configuration variables and write SCM info header # if(DOLPHIN_WC_BRANCH STREQUAL "master" OR DOLPHIN_WC_BRANCH STREQUAL "stable") - set(DOLPHIN_WC_IS_STABLE "1") + set(DOLPHIN_WC_IS_STABLE "1") else() - set(DOLPHIN_WC_IS_STABLE "0") + set(DOLPHIN_WC_IS_STABLE "0") endif() configure_file( - "${PROJECT_SOURCE_DIR}/Source/Core/Common/scmrev.h.in" - "${PROJECT_BINARY_DIR}/Source/Core/Common/scmrev.h" + "${PROJECT_SOURCE_DIR}/Source/Core/Common/scmrev.h.in" + "${PROJECT_BINARY_DIR}/Source/Core/Common/scmrev.h" ) include_directories("${PROJECT_BINARY_DIR}/Source/Core") @@ -878,12 +878,12 @@ include_directories("${PROJECT_BINARY_DIR}/Source/Core") # find_package(GTest) if(GTEST_FOUND AND USE_SHARED_GTEST) - message(STATUS "Using shared gtest") - include_directories(${GTEST_INCLUDE_DIRS}) + message(STATUS "Using shared gtest") + include_directories(${GTEST_INCLUDE_DIRS}) else() - message(STATUS "Using static gtest from Externals") - include_directories(Externals/gtest/include) - add_subdirectory(Externals/gtest EXCLUDE_FROM_ALL) + message(STATUS "Using static gtest from Externals") + include_directories(Externals/gtest/include) + add_subdirectory(Externals/gtest EXCLUDE_FROM_ALL) endif() enable_testing() @@ -900,21 +900,21 @@ if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows") install(DIRECTORY Data/Sys/ DESTINATION ${datadir}/sys PATTERN) endif() if(NOT CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD|OpenBSD|Darwin") - install(FILES Data/license.txt DESTINATION ${datadir}) + install(FILES Data/license.txt DESTINATION ${datadir}) endif() if(CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD|OpenBSD") - # Install the application icon and menu item - install(FILES Data/dolphin-emu.svg - DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps) - install(FILES Data/dolphin-emu.png - DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/48x48/apps) - install(FILES Data/dolphin-emu.desktop - DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications) - # Install manpages - install(FILES Data/dolphin-emu.6 - DESTINATION ${mandir}/man6) - install(FILES Data/dolphin-emu-nogui.6 - DESTINATION ${mandir}/man6) + # Install the application icon and menu item + install(FILES Data/dolphin-emu.svg + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps) + install(FILES Data/dolphin-emu.png + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/48x48/apps) + install(FILES Data/dolphin-emu.desktop + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications) + # Install manpages + install(FILES Data/dolphin-emu.6 + DESTINATION ${mandir}/man6) + install(FILES Data/dolphin-emu-nogui.6 + DESTINATION ${mandir}/man6) endif() # packaging information diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 4489c899dc..6ae6af470f 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -20,18 +20,18 @@ add_definitions(-D__STDC_LIMIT_MACROS) add_definitions(-D__STDC_CONSTANT_MACROS) macro(add_dolphin_library lib srcs libs) - add_library(${lib} STATIC ${srcs}) - target_link_libraries(${lib} PUBLIC ${libs}) + add_library(${lib} STATIC ${srcs}) + target_link_libraries(${lib} PUBLIC ${libs}) endmacro() add_subdirectory(Core) if (ANDROID) - add_subdirectory(Android/jni) + add_subdirectory(Android/jni) endif() add_subdirectory(UnitTests) if (DSPTOOL) - add_subdirectory(DSPTool) + add_subdirectory(DSPTool) endif() # TODO: Add DSPSpy. Preferably make it option() and cpack component diff --git a/Source/Core/CMakeLists.txt b/Source/Core/CMakeLists.txt index efc04e1f43..8c1ad903e9 100644 --- a/Source/Core/CMakeLists.txt +++ b/Source/Core/CMakeLists.txt @@ -9,5 +9,5 @@ add_subdirectory(VideoCommon) add_subdirectory(VideoBackends) if(ENABLE_QT2) - add_subdirectory(DolphinQt2) + add_subdirectory(DolphinQt2) endif() diff --git a/Source/Core/Common/CMakeLists.txt b/Source/Core/Common/CMakeLists.txt index fbb5961e2e..c894a297c3 100644 --- a/Source/Core/Common/CMakeLists.txt +++ b/Source/Core/Common/CMakeLists.txt @@ -1,117 +1,123 @@ -set(SRCS Analytics.cpp - CDUtils.cpp - ColorUtil.cpp - Config/Config.cpp - Config/Layer.cpp - Config/Section.cpp - ENetUtil.cpp - FileSearch.cpp - FileUtil.cpp - GekkoDisassembler.cpp - Hash.cpp - IniFile.cpp - JitRegister.cpp - MathUtil.cpp - MemArena.cpp - MemoryUtil.cpp - Misc.cpp - MsgHandler.cpp - NandPaths.cpp - Network.cpp - PcapFile.cpp - PerformanceCounter.cpp - Profiler.cpp - SettingsHandler.cpp - SDCardUtil.cpp - StringUtil.cpp - SymbolDB.cpp - SysConf.cpp - Thread.cpp - Timer.cpp - TraversalClient.cpp - Version.cpp - x64ABI.cpp - x64Emitter.cpp - MD5.cpp - Crypto/AES.cpp - Crypto/bn.cpp - Crypto/ec.cpp - Logging/LogManager.cpp) +set(SRCS + Analytics.cpp + CDUtils.cpp + ColorUtil.cpp + Config/Config.cpp + Config/Layer.cpp + Config/Section.cpp + ENetUtil.cpp + FileSearch.cpp + FileUtil.cpp + GekkoDisassembler.cpp + Hash.cpp + IniFile.cpp + JitRegister.cpp + MathUtil.cpp + MemArena.cpp + MemoryUtil.cpp + Misc.cpp + MsgHandler.cpp + NandPaths.cpp + Network.cpp + PcapFile.cpp + PerformanceCounter.cpp + Profiler.cpp + SettingsHandler.cpp + SDCardUtil.cpp + StringUtil.cpp + SymbolDB.cpp + SysConf.cpp + Thread.cpp + Timer.cpp + TraversalClient.cpp + Version.cpp + x64ABI.cpp + x64Emitter.cpp + MD5.cpp + Crypto/AES.cpp + Crypto/bn.cpp + Crypto/ec.cpp + Logging/LogManager.cpp +) if(LIBUSB_FOUND) - set(LIBS ${LIBS} ${LIBUSB_LIBRARIES}) - set(SRCS ${SRCS} LibusbContext.cpp) + set(LIBS ${LIBS} ${LIBUSB_LIBRARIES}) + set(SRCS ${SRCS} LibusbContext.cpp) endif(LIBUSB_FOUND) if(ANDROID) - set(SRCS ${SRCS} - Logging/ConsoleListenerDroid.cpp) + set(SRCS ${SRCS} + Logging/ConsoleListenerDroid.cpp) elseif(WIN32) - set(SRCS ${SRCS} - Logging/ConsoleListenerWin.cpp) + set(SRCS ${SRCS} + Logging/ConsoleListenerWin.cpp) else() - set(SRCS ${SRCS} - Logging/ConsoleListenerNix.cpp) + set(SRCS ${SRCS} + Logging/ConsoleListenerNix.cpp) endif() list(APPEND LIBS enet ${CURL_LIBRARIES}) if(_M_ARM_64) - set(SRCS ${SRCS} - Arm64Emitter.cpp - ArmCPUDetect.cpp - GenericFPURoundMode.cpp) + set(SRCS ${SRCS} + Arm64Emitter.cpp + ArmCPUDetect.cpp + GenericFPURoundMode.cpp + ) else() - if(_M_X86) #X86 - set(SRCS ${SRCS} - x64FPURoundMode.cpp - x64CPUDetect.cpp) - else() # Generic - set(SRCS ${SRCS} - GenericFPURoundMode.cpp - GenericCPUDetect.cpp) - endif() + if(_M_X86) #X86 + set(SRCS ${SRCS} + x64FPURoundMode.cpp + x64CPUDetect.cpp + ) + else() # Generic + set(SRCS ${SRCS} + GenericFPURoundMode.cpp + GenericCPUDetect.cpp + ) + endif() endif() list(APPEND LIBS "${CMAKE_THREAD_LIBS_INIT}" ${VTUNE_LIBRARIES}) # OpenGL Interface set(SRCS ${SRCS} - GL/GLUtil.cpp - GL/GLExtensions/GLExtensions.cpp - GL/GLInterface/GLInterface.cpp) + GL/GLUtil.cpp + GL/GLExtensions/GLExtensions.cpp + GL/GLInterface/GLInterface.cpp +) if(USE_EGL) - set(SRCS ${SRCS} GL/GLInterface/EGL.cpp) - if(ANDROID) - set(SRCS ${SRCS} GL/GLInterface/EGLAndroid.cpp) - elseif(USE_X11) - set(SRCS ${SRCS} GL/GLInterface/EGLX11.cpp) - endif() - set(LIBS ${LIBS} EGL) + set(SRCS ${SRCS} GL/GLInterface/EGL.cpp) + if(ANDROID) + set(SRCS ${SRCS} GL/GLInterface/EGLAndroid.cpp) + elseif(USE_X11) + set(SRCS ${SRCS} GL/GLInterface/EGLX11.cpp) + endif() + set(LIBS ${LIBS} EGL) endif() if(WIN32) - set(SRCS ${SRCS} GL/GLInterface/WGL.cpp) + set(SRCS ${SRCS} GL/GLInterface/WGL.cpp) elseif(APPLE) - set(SRCS ${SRCS} GL/GLInterface/AGL.mm) + set(SRCS ${SRCS} GL/GLInterface/AGL.mm) elseif(USE_X11) - if (NOT USE_EGL) - set(SRCS ${SRCS} GL/GLInterface/GLX.cpp) - # GLX has a hard dependency on libGL. - # Make sure to link to it if using GLX. - set(LIBS ${LIBS} ${OPENGL_LIBRARIES}) - endif() - set(SRCS ${SRCS} GL/GLInterface/X11_Util.cpp) - set(LIBS ${LIBS} ${XRANDR_LIBRARIES}) + if (NOT USE_EGL) + set(SRCS ${SRCS} GL/GLInterface/GLX.cpp) + # GLX has a hard dependency on libGL. + # Make sure to link to it if using GLX. + set(LIBS ${LIBS} ${OPENGL_LIBRARIES}) + endif() + set(SRCS ${SRCS} GL/GLInterface/X11_Util.cpp) + set(LIBS ${LIBS} ${XRANDR_LIBRARIES}) endif() if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - set(LIBS ${LIBS} dl) + set(LIBS ${LIBS} dl) endif() add_dolphin_library(common "${SRCS}" "${LIBS}") if(UNIX) - # Posix networking code needs to be fixed for Windows - add_executable(traversal_server TraversalServer.cpp) + # Posix networking code needs to be fixed for Windows + add_executable(traversal_server TraversalServer.cpp) endif() diff --git a/Source/Core/Core/CMakeLists.txt b/Source/Core/Core/CMakeLists.txt index 72019ec25c..fad4464f90 100644 --- a/Source/Core/Core/CMakeLists.txt +++ b/Source/Core/Core/CMakeLists.txt @@ -1,343 +1,347 @@ -set(SRCS ActionReplay.cpp - Analytics.cpp - ARDecrypt.cpp - BootManager.cpp - ConfigManager.cpp - Core.cpp - CoreTiming.cpp - DSPEmulator.cpp - ec_wii.cpp - GeckoCodeConfig.cpp - GeckoCode.cpp - HotkeyManager.cpp - MemTools.cpp - Movie.cpp - NetPlayClient.cpp - NetPlayServer.cpp - PatchEngine.cpp - State.cpp - WiiRoot.cpp - Boot/Boot_BS2Emu.cpp - Boot/Boot.cpp - Boot/Boot_DOL.cpp - Boot/Boot_ELF.cpp - Boot/Boot_WiiWAD.cpp - Boot/ElfReader.cpp - Debugger/Debugger_SymbolMap.cpp - Debugger/Dump.cpp - Debugger/PPCDebugInterface.cpp - DSP/DSPAssembler.cpp - DSP/DSPDisassembler.cpp - DSP/DSPAccelerator.cpp - DSP/DSPCaptureLogger.cpp - DSP/DSPHWInterface.cpp - DSP/DSPMemoryMap.cpp - DSP/DSPStacks.cpp - DSP/DSPAnalyzer.cpp - DSP/DSPCodeUtil.cpp - DSP/LabelMap.cpp - DSP/DSPCore.cpp - DSP/DSPTables.cpp - DSP/Interpreter/DSPIntArithmetic.cpp - DSP/Interpreter/DSPIntBranch.cpp - DSP/Interpreter/DSPIntCCUtil.cpp - DSP/Interpreter/DSPInterpreter.cpp - DSP/Interpreter/DSPIntExtOps.cpp - DSP/Interpreter/DSPIntLoadStore.cpp - DSP/Interpreter/DSPIntMisc.cpp - DSP/Interpreter/DSPIntMultiplier.cpp - DSP/Jit/DSPEmitter.cpp - DSP/Jit/DSPJitRegCache.cpp - DSP/Jit/DSPJitExtOps.cpp - DSP/Jit/DSPJitBranch.cpp - DSP/Jit/DSPJitCCUtil.cpp - DSP/Jit/DSPJitArithmetic.cpp - DSP/Jit/DSPJitLoadStore.cpp - DSP/Jit/DSPJitMultiplier.cpp - DSP/Jit/DSPJitUtil.cpp - DSP/Jit/DSPJitMisc.cpp - FifoPlayer/FifoAnalyzer.cpp - FifoPlayer/FifoDataFile.cpp - FifoPlayer/FifoPlaybackAnalyzer.cpp - FifoPlayer/FifoPlayer.cpp - FifoPlayer/FifoRecordAnalyzer.cpp - FifoPlayer/FifoRecorder.cpp - HLE/HLE.cpp - HLE/HLE_Misc.cpp - HLE/HLE_OS.cpp - HW/AudioInterface.cpp - HW/CPU.cpp - HW/DSP.cpp - HW/DSPHLE/UCodes/AX.cpp - HW/DSPHLE/UCodes/AXWii.cpp - HW/DSPHLE/UCodes/CARD.cpp - HW/DSPHLE/UCodes/GBA.cpp - HW/DSPHLE/UCodes/INIT.cpp - HW/DSPHLE/UCodes/ROM.cpp - HW/DSPHLE/UCodes/UCodes.cpp - HW/DSPHLE/UCodes/Zelda.cpp - HW/DSPHLE/MailHandler.cpp - HW/DSPHLE/DSPHLE.cpp - HW/DSPLLE/DSPDebugInterface.cpp - HW/DSPLLE/DSPHost.cpp - HW/DSPLLE/DSPSymbols.cpp - HW/DSPLLE/DSPLLEGlobals.cpp - HW/DSPLLE/DSPLLE.cpp - HW/DSPLLE/DSPLLETools.cpp - HW/DVDInterface.cpp - HW/DVDThread.cpp - HW/EXI/EXI_Channel.cpp - HW/EXI/EXI.cpp - HW/EXI/EXI_Device.cpp - HW/EXI/EXI_DeviceAD16.cpp - HW/EXI/EXI_DeviceAGP.cpp - HW/EXI/EXI_DeviceDummy.cpp - HW/EXI/EXI_DeviceEthernet.cpp - HW/EXI/EXI_DeviceGecko.cpp - HW/EXI/EXI_DeviceIPL.cpp - HW/EXI/EXI_DeviceMemoryCard.cpp - HW/EXI/EXI_DeviceMic.cpp - HW/GCKeyboard.cpp - HW/GCKeyboardEmu.cpp - HW/GCMemcard.cpp - HW/GCMemcardDirectory.cpp - HW/GCMemcardRaw.cpp - HW/GCPad.cpp - HW/GCPadEmu.cpp - HW/GPFifo.cpp - HW/HW.cpp - HW/Memmap.cpp - HW/MemoryInterface.cpp - HW/MMIO.cpp - HW/ProcessorInterface.cpp - HW/SI/SI.cpp - HW/SI/SI_Device.cpp - HW/SI/SI_DeviceDanceMat.cpp - HW/SI/SI_DeviceGBA.cpp - HW/SI/SI_DeviceGCAdapter.cpp - HW/SI/SI_DeviceGCController.cpp - HW/SI/SI_DeviceGCSteeringWheel.cpp - HW/SI/SI_DeviceKeyboard.cpp - HW/SI/SI_DeviceNull.cpp - HW/Sram.cpp - HW/StreamADPCM.cpp - HW/SystemTimers.cpp - HW/VideoInterface.cpp - HW/WII_IPC.cpp - HW/Wiimote.cpp - HW/WiimoteEmu/WiimoteEmu.cpp - HW/WiimoteEmu/Attachment/Classic.cpp - HW/WiimoteEmu/Attachment/Attachment.cpp - HW/WiimoteEmu/Attachment/Nunchuk.cpp - HW/WiimoteEmu/Attachment/Drums.cpp - HW/WiimoteEmu/Attachment/Guitar.cpp - HW/WiimoteEmu/Attachment/Turntable.cpp - HW/WiimoteEmu/EmuSubroutines.cpp - HW/WiimoteEmu/Encryption.cpp - HW/WiimoteEmu/Speaker.cpp - HW/WiimoteReal/WiimoteReal.cpp - HW/WiiSaveCrypted.cpp - IOS/Device.cpp - IOS/DeviceStub.cpp - IOS/IPC.cpp - IOS/MIOS.cpp - IOS/DI/DI.cpp - IOS/ES/ES.cpp - IOS/ES/Formats.cpp - IOS/FS/FileIO.cpp - IOS/FS/FS.cpp - IOS/Network/ICMPLin.cpp - IOS/Network/MACUtils.cpp - IOS/Network/Socket.cpp - IOS/Network/SSL.cpp - IOS/Network/IP/Top.cpp - IOS/Network/KD/NetKDRequest.cpp - IOS/Network/KD/NetKDTime.cpp - IOS/Network/KD/NWC24Config.cpp - IOS/Network/NCD/Config.cpp - IOS/Network/NCD/Manage.cpp - IOS/Network/WD/Command.cpp - IOS/SDIO/SDIOSlot0.cpp - IOS/STM/STM.cpp - IOS/USB/Common.cpp - IOS/USB/Host.cpp - IOS/USB/OH0/OH0.cpp - IOS/USB/OH0/OH0Device.cpp - IOS/USB/USB_HID/HIDv4.cpp - IOS/USB/USB_VEN/VEN.cpp - IOS/USB/USBV0.cpp - IOS/USB/USBV4.cpp - IOS/USB/USBV5.cpp - IOS/USB/USB_KBD.cpp - IOS/USB/Bluetooth/BTBase.cpp - IOS/USB/Bluetooth/BTEmu.cpp - IOS/USB/Bluetooth/BTStub.cpp - IOS/USB/Bluetooth/WiimoteDevice.cpp - IOS/USB/Bluetooth/WiimoteHIDAttr.cpp - IOS/WFS/WFSSRV.cpp - IOS/WFS/WFSI.cpp - PowerPC/BreakPoints.cpp - PowerPC/MMU.cpp - PowerPC/PowerPC.cpp - PowerPC/PPCAnalyst.cpp - PowerPC/PPCCache.cpp - PowerPC/PPCSymbolDB.cpp - PowerPC/PPCTables.cpp - PowerPC/Profiler.cpp - PowerPC/SignatureDB/CSVSignatureDB.cpp - PowerPC/SignatureDB/DSYSignatureDB.cpp - PowerPC/SignatureDB/SignatureDB.cpp - PowerPC/JitInterface.cpp - PowerPC/CachedInterpreter/CachedInterpreter.cpp - PowerPC/CachedInterpreter/InterpreterBlockCache.cpp - PowerPC/Interpreter/Interpreter_Branch.cpp - PowerPC/Interpreter/Interpreter.cpp - PowerPC/Interpreter/Interpreter_FloatingPoint.cpp - PowerPC/Interpreter/Interpreter_Integer.cpp - PowerPC/Interpreter/Interpreter_LoadStore.cpp - PowerPC/Interpreter/Interpreter_LoadStorePaired.cpp - PowerPC/Interpreter/Interpreter_Paired.cpp - PowerPC/Interpreter/Interpreter_SystemRegisters.cpp - PowerPC/Interpreter/Interpreter_Tables.cpp - PowerPC/JitCommon/JitAsmCommon.cpp - PowerPC/JitCommon/JitBase.cpp - PowerPC/JitCommon/JitCache.cpp - PowerPC/JitILCommon/IR.cpp - PowerPC/JitILCommon/JitILBase_Branch.cpp - PowerPC/JitILCommon/JitILBase_LoadStore.cpp - PowerPC/JitILCommon/JitILBase_SystemRegisters.cpp - PowerPC/JitILCommon/JitILBase_LoadStoreFloating.cpp - PowerPC/JitILCommon/JitILBase_LoadStorePaired.cpp - PowerPC/JitILCommon/JitILBase_Paired.cpp - PowerPC/JitILCommon/JitILBase_FloatingPoint.cpp - PowerPC/JitILCommon/JitILBase_Integer.cpp - ) +set(SRCS + ActionReplay.cpp + Analytics.cpp + ARDecrypt.cpp + BootManager.cpp + ConfigManager.cpp + Core.cpp + CoreTiming.cpp + DSPEmulator.cpp + ec_wii.cpp + GeckoCodeConfig.cpp + GeckoCode.cpp + HotkeyManager.cpp + MemTools.cpp + Movie.cpp + NetPlayClient.cpp + NetPlayServer.cpp + PatchEngine.cpp + State.cpp + WiiRoot.cpp + Boot/Boot_BS2Emu.cpp + Boot/Boot.cpp + Boot/Boot_DOL.cpp + Boot/Boot_ELF.cpp + Boot/Boot_WiiWAD.cpp + Boot/ElfReader.cpp + Debugger/Debugger_SymbolMap.cpp + Debugger/Dump.cpp + Debugger/PPCDebugInterface.cpp + DSP/DSPAssembler.cpp + DSP/DSPDisassembler.cpp + DSP/DSPAccelerator.cpp + DSP/DSPCaptureLogger.cpp + DSP/DSPHWInterface.cpp + DSP/DSPMemoryMap.cpp + DSP/DSPStacks.cpp + DSP/DSPAnalyzer.cpp + DSP/DSPCodeUtil.cpp + DSP/LabelMap.cpp + DSP/DSPCore.cpp + DSP/DSPTables.cpp + DSP/Interpreter/DSPIntArithmetic.cpp + DSP/Interpreter/DSPIntBranch.cpp + DSP/Interpreter/DSPIntCCUtil.cpp + DSP/Interpreter/DSPInterpreter.cpp + DSP/Interpreter/DSPIntExtOps.cpp + DSP/Interpreter/DSPIntLoadStore.cpp + DSP/Interpreter/DSPIntMisc.cpp + DSP/Interpreter/DSPIntMultiplier.cpp + DSP/Jit/DSPEmitter.cpp + DSP/Jit/DSPJitRegCache.cpp + DSP/Jit/DSPJitExtOps.cpp + DSP/Jit/DSPJitBranch.cpp + DSP/Jit/DSPJitCCUtil.cpp + DSP/Jit/DSPJitArithmetic.cpp + DSP/Jit/DSPJitLoadStore.cpp + DSP/Jit/DSPJitMultiplier.cpp + DSP/Jit/DSPJitUtil.cpp + DSP/Jit/DSPJitMisc.cpp + FifoPlayer/FifoAnalyzer.cpp + FifoPlayer/FifoDataFile.cpp + FifoPlayer/FifoPlaybackAnalyzer.cpp + FifoPlayer/FifoPlayer.cpp + FifoPlayer/FifoRecordAnalyzer.cpp + FifoPlayer/FifoRecorder.cpp + HLE/HLE.cpp + HLE/HLE_Misc.cpp + HLE/HLE_OS.cpp + HW/AudioInterface.cpp + HW/CPU.cpp + HW/DSP.cpp + HW/DSPHLE/UCodes/AX.cpp + HW/DSPHLE/UCodes/AXWii.cpp + HW/DSPHLE/UCodes/CARD.cpp + HW/DSPHLE/UCodes/GBA.cpp + HW/DSPHLE/UCodes/INIT.cpp + HW/DSPHLE/UCodes/ROM.cpp + HW/DSPHLE/UCodes/UCodes.cpp + HW/DSPHLE/UCodes/Zelda.cpp + HW/DSPHLE/MailHandler.cpp + HW/DSPHLE/DSPHLE.cpp + HW/DSPLLE/DSPDebugInterface.cpp + HW/DSPLLE/DSPHost.cpp + HW/DSPLLE/DSPSymbols.cpp + HW/DSPLLE/DSPLLEGlobals.cpp + HW/DSPLLE/DSPLLE.cpp + HW/DSPLLE/DSPLLETools.cpp + HW/DVDInterface.cpp + HW/DVDThread.cpp + HW/EXI/EXI_Channel.cpp + HW/EXI/EXI.cpp + HW/EXI/EXI_Device.cpp + HW/EXI/EXI_DeviceAD16.cpp + HW/EXI/EXI_DeviceAGP.cpp + HW/EXI/EXI_DeviceDummy.cpp + HW/EXI/EXI_DeviceEthernet.cpp + HW/EXI/EXI_DeviceGecko.cpp + HW/EXI/EXI_DeviceIPL.cpp + HW/EXI/EXI_DeviceMemoryCard.cpp + HW/EXI/EXI_DeviceMic.cpp + HW/GCKeyboard.cpp + HW/GCKeyboardEmu.cpp + HW/GCMemcard.cpp + HW/GCMemcardDirectory.cpp + HW/GCMemcardRaw.cpp + HW/GCPad.cpp + HW/GCPadEmu.cpp + HW/GPFifo.cpp + HW/HW.cpp + HW/Memmap.cpp + HW/MemoryInterface.cpp + HW/MMIO.cpp + HW/ProcessorInterface.cpp + HW/SI/SI.cpp + HW/SI/SI_Device.cpp + HW/SI/SI_DeviceDanceMat.cpp + HW/SI/SI_DeviceGBA.cpp + HW/SI/SI_DeviceGCAdapter.cpp + HW/SI/SI_DeviceGCController.cpp + HW/SI/SI_DeviceGCSteeringWheel.cpp + HW/SI/SI_DeviceKeyboard.cpp + HW/SI/SI_DeviceNull.cpp + HW/Sram.cpp + HW/StreamADPCM.cpp + HW/SystemTimers.cpp + HW/VideoInterface.cpp + HW/WII_IPC.cpp + HW/Wiimote.cpp + HW/WiimoteEmu/WiimoteEmu.cpp + HW/WiimoteEmu/Attachment/Classic.cpp + HW/WiimoteEmu/Attachment/Attachment.cpp + HW/WiimoteEmu/Attachment/Nunchuk.cpp + HW/WiimoteEmu/Attachment/Drums.cpp + HW/WiimoteEmu/Attachment/Guitar.cpp + HW/WiimoteEmu/Attachment/Turntable.cpp + HW/WiimoteEmu/EmuSubroutines.cpp + HW/WiimoteEmu/Encryption.cpp + HW/WiimoteEmu/Speaker.cpp + HW/WiimoteReal/WiimoteReal.cpp + HW/WiiSaveCrypted.cpp + IOS/Device.cpp + IOS/DeviceStub.cpp + IOS/IPC.cpp + IOS/MIOS.cpp + IOS/DI/DI.cpp + IOS/ES/ES.cpp + IOS/ES/Formats.cpp + IOS/FS/FileIO.cpp + IOS/FS/FS.cpp + IOS/Network/ICMPLin.cpp + IOS/Network/MACUtils.cpp + IOS/Network/Socket.cpp + IOS/Network/SSL.cpp + IOS/Network/IP/Top.cpp + IOS/Network/KD/NetKDRequest.cpp + IOS/Network/KD/NetKDTime.cpp + IOS/Network/KD/NWC24Config.cpp + IOS/Network/NCD/Config.cpp + IOS/Network/NCD/Manage.cpp + IOS/Network/WD/Command.cpp + IOS/SDIO/SDIOSlot0.cpp + IOS/STM/STM.cpp + IOS/USB/Common.cpp + IOS/USB/Host.cpp + IOS/USB/OH0/OH0.cpp + IOS/USB/OH0/OH0Device.cpp + IOS/USB/USB_HID/HIDv4.cpp + IOS/USB/USB_VEN/VEN.cpp + IOS/USB/USBV0.cpp + IOS/USB/USBV4.cpp + IOS/USB/USBV5.cpp + IOS/USB/USB_KBD.cpp + IOS/USB/Bluetooth/BTBase.cpp + IOS/USB/Bluetooth/BTEmu.cpp + IOS/USB/Bluetooth/BTStub.cpp + IOS/USB/Bluetooth/WiimoteDevice.cpp + IOS/USB/Bluetooth/WiimoteHIDAttr.cpp + IOS/WFS/WFSSRV.cpp + IOS/WFS/WFSI.cpp + PowerPC/BreakPoints.cpp + PowerPC/MMU.cpp + PowerPC/PowerPC.cpp + PowerPC/PPCAnalyst.cpp + PowerPC/PPCCache.cpp + PowerPC/PPCSymbolDB.cpp + PowerPC/PPCTables.cpp + PowerPC/Profiler.cpp + PowerPC/SignatureDB/CSVSignatureDB.cpp + PowerPC/SignatureDB/DSYSignatureDB.cpp + PowerPC/SignatureDB/SignatureDB.cpp + PowerPC/JitInterface.cpp + PowerPC/CachedInterpreter/CachedInterpreter.cpp + PowerPC/CachedInterpreter/InterpreterBlockCache.cpp + PowerPC/Interpreter/Interpreter_Branch.cpp + PowerPC/Interpreter/Interpreter.cpp + PowerPC/Interpreter/Interpreter_FloatingPoint.cpp + PowerPC/Interpreter/Interpreter_Integer.cpp + PowerPC/Interpreter/Interpreter_LoadStore.cpp + PowerPC/Interpreter/Interpreter_LoadStorePaired.cpp + PowerPC/Interpreter/Interpreter_Paired.cpp + PowerPC/Interpreter/Interpreter_SystemRegisters.cpp + PowerPC/Interpreter/Interpreter_Tables.cpp + PowerPC/JitCommon/JitAsmCommon.cpp + PowerPC/JitCommon/JitBase.cpp + PowerPC/JitCommon/JitCache.cpp + PowerPC/JitILCommon/IR.cpp + PowerPC/JitILCommon/JitILBase_Branch.cpp + PowerPC/JitILCommon/JitILBase_LoadStore.cpp + PowerPC/JitILCommon/JitILBase_SystemRegisters.cpp + PowerPC/JitILCommon/JitILBase_LoadStoreFloating.cpp + PowerPC/JitILCommon/JitILBase_LoadStorePaired.cpp + PowerPC/JitILCommon/JitILBase_Paired.cpp + PowerPC/JitILCommon/JitILBase_FloatingPoint.cpp + PowerPC/JitILCommon/JitILBase_Integer.cpp +) if(_M_X86) - set(SRCS ${SRCS} - PowerPC/Jit64IL/IR_X86.cpp - PowerPC/Jit64IL/JitIL.cpp - PowerPC/Jit64IL/JitIL_Tables.cpp - PowerPC/Jit64/FPURegCache.cpp - PowerPC/Jit64/GPRRegCache.cpp - PowerPC/Jit64/Jit64_Tables.cpp - PowerPC/Jit64/JitAsm.cpp - PowerPC/Jit64/Jit_Branch.cpp - PowerPC/Jit64/Jit.cpp - PowerPC/Jit64/Jit_FloatingPoint.cpp - PowerPC/Jit64/Jit_Integer.cpp - PowerPC/Jit64/Jit_LoadStore.cpp - PowerPC/Jit64/Jit_LoadStoreFloating.cpp - PowerPC/Jit64/Jit_LoadStorePaired.cpp - PowerPC/Jit64/Jit_Paired.cpp - PowerPC/Jit64/JitRegCache.cpp - PowerPC/Jit64/Jit_SystemRegisters.cpp - PowerPC/Jit64Common/BlockCache.cpp - PowerPC/Jit64Common/EmuCodeBlock.cpp - PowerPC/Jit64Common/FarCodeCache.cpp - PowerPC/Jit64Common/Jit64AsmCommon.cpp - PowerPC/Jit64Common/Jit64Base.cpp - PowerPC/Jit64Common/TrampolineCache.cpp) + set(SRCS ${SRCS} + PowerPC/Jit64IL/IR_X86.cpp + PowerPC/Jit64IL/JitIL.cpp + PowerPC/Jit64IL/JitIL_Tables.cpp + PowerPC/Jit64/FPURegCache.cpp + PowerPC/Jit64/GPRRegCache.cpp + PowerPC/Jit64/Jit64_Tables.cpp + PowerPC/Jit64/JitAsm.cpp + PowerPC/Jit64/Jit_Branch.cpp + PowerPC/Jit64/Jit.cpp + PowerPC/Jit64/Jit_FloatingPoint.cpp + PowerPC/Jit64/Jit_Integer.cpp + PowerPC/Jit64/Jit_LoadStore.cpp + PowerPC/Jit64/Jit_LoadStoreFloating.cpp + PowerPC/Jit64/Jit_LoadStorePaired.cpp + PowerPC/Jit64/Jit_Paired.cpp + PowerPC/Jit64/JitRegCache.cpp + PowerPC/Jit64/Jit_SystemRegisters.cpp + PowerPC/Jit64Common/BlockCache.cpp + PowerPC/Jit64Common/EmuCodeBlock.cpp + PowerPC/Jit64Common/FarCodeCache.cpp + PowerPC/Jit64Common/Jit64AsmCommon.cpp + PowerPC/Jit64Common/Jit64Base.cpp + PowerPC/Jit64Common/TrampolineCache.cpp + ) elseif(_M_ARM_64) - set(SRCS ${SRCS} - PowerPC/JitArm64/Jit.cpp - PowerPC/JitArm64/JitAsm.cpp - PowerPC/JitArm64/JitArm64Cache.cpp - PowerPC/JitArm64/JitArm64_RegCache.cpp - PowerPC/JitArm64/JitArm64_BackPatch.cpp - PowerPC/JitArm64/JitArm64_Branch.cpp - PowerPC/JitArm64/JitArm64_FloatingPoint.cpp - PowerPC/JitArm64/JitArm64_Integer.cpp - PowerPC/JitArm64/JitArm64_LoadStore.cpp - PowerPC/JitArm64/JitArm64_LoadStoreFloating.cpp - PowerPC/JitArm64/JitArm64_Paired.cpp - PowerPC/JitArm64/JitArm64_LoadStorePaired.cpp - PowerPC/JitArm64/JitArm64_SystemRegisters.cpp - PowerPC/JitArm64/Jit_Util.cpp - PowerPC/JitArm64/JitArm64_Tables.cpp) + set(SRCS ${SRCS} + PowerPC/JitArm64/Jit.cpp + PowerPC/JitArm64/JitAsm.cpp + PowerPC/JitArm64/JitArm64Cache.cpp + PowerPC/JitArm64/JitArm64_RegCache.cpp + PowerPC/JitArm64/JitArm64_BackPatch.cpp + PowerPC/JitArm64/JitArm64_Branch.cpp + PowerPC/JitArm64/JitArm64_FloatingPoint.cpp + PowerPC/JitArm64/JitArm64_Integer.cpp + PowerPC/JitArm64/JitArm64_LoadStore.cpp + PowerPC/JitArm64/JitArm64_LoadStoreFloating.cpp + PowerPC/JitArm64/JitArm64_Paired.cpp + PowerPC/JitArm64/JitArm64_LoadStorePaired.cpp + PowerPC/JitArm64/JitArm64_SystemRegisters.cpp + PowerPC/JitArm64/Jit_Util.cpp + PowerPC/JitArm64/JitArm64_Tables.cpp + ) endif() set(LIBS - audiocommon - bdisasm - common - discio - enet - inputcommon - ${LZO} - sfml-network - sfml-system - videonull - videoogl - videosoftware - z - ) + audiocommon + bdisasm + common + discio + enet + inputcommon + ${LZO} + sfml-network + sfml-system + videonull + videoogl + videosoftware + z +) if(LIBUSB_FOUND) - # Using shared LibUSB - set(LIBS ${LIBS} ${LIBUSB_LIBRARIES}) - set(SRCS ${SRCS} IOS/USB/LibusbDevice.cpp - IOS/USB/Bluetooth/BTReal.cpp) + # Using shared LibUSB + set(LIBS ${LIBS} ${LIBUSB_LIBRARIES}) + set(SRCS ${SRCS} + IOS/USB/LibusbDevice.cpp + IOS/USB/Bluetooth/BTReal.cpp + ) endif() if(NOT APPLE) - set(LIBS ${LIBS} videovulkan) + set(LIBS ${LIBS} videovulkan) endif() set(LIBS ${LIBS} ${MBEDTLS_LIBRARIES}) if(WIN32) - set(SRCS ${SRCS} HW/EXI/BBA-TAP/TAP_Win32.cpp HW/WiimoteReal/IOWin.cpp) - list(APPEND LIBS - videod3d - videod3d12 - setupapi.lib - iphlpapi.lib - ) + set(SRCS ${SRCS} HW/EXI/BBA-TAP/TAP_Win32.cpp HW/WiimoteReal/IOWin.cpp) + list(APPEND LIBS + videod3d + videod3d12 + setupapi.lib + iphlpapi.lib + ) elseif(APPLE) - set(SRCS ${SRCS} HW/EXI/BBA-TAP/TAP_Apple.cpp HW/WiimoteReal/IOdarwin.mm) - set(LIBS ${LIBS} - ${IOB_LIBRARY}) + set(SRCS ${SRCS} HW/EXI/BBA-TAP/TAP_Apple.cpp HW/WiimoteReal/IOdarwin.mm) + set(LIBS ${LIBS} ${IOB_LIBRARY}) elseif(UNIX) - set(SRCS ${SRCS} HW/EXI/BBA-TAP/TAP_Unix.cpp) - if(ANDROID) - set(SRCS ${SRCS} HW/WiimoteReal/IOAndroid.cpp) - endif() + set(SRCS ${SRCS} HW/EXI/BBA-TAP/TAP_Unix.cpp) + if(ANDROID) + set(SRCS ${SRCS} HW/WiimoteReal/IOAndroid.cpp) + endif() endif() # Bluez doesn't support all the communication modes on FreeBSD, so only using it on Linux if(ENABLE_BLUEZ AND CMAKE_SYSTEM_NAME MATCHES "Linux") - find_package(BlueZ) - if(BLUEZ_FOUND) - message(STATUS "BlueZ found, enabling bluetooth support") - set(SRCS ${SRCS} HW/WiimoteReal/IOLinux.cpp) - set(LIBS ${LIBS} BlueZ::BlueZ) - add_definitions(-DHAVE_BLUEZ=1) - else() - message(STATUS "BlueZ NOT found, disabling bluetooth support") - endif() + find_package(BlueZ) + if(BLUEZ_FOUND) + message(STATUS "BlueZ found, enabling bluetooth support") + set(SRCS ${SRCS} HW/WiimoteReal/IOLinux.cpp) + set(LIBS ${LIBS} BlueZ::BlueZ) + add_definitions(-DHAVE_BLUEZ=1) + else() + message(STATUS "BlueZ NOT found, disabling bluetooth support") + endif() else() - message(STATUS "BlueZ explicitly disabled, disabling bluetooth support") + message(STATUS "BlueZ explicitly disabled, disabling bluetooth support") endif() if(HIDAPI_FOUND) - set(SRCS ${SRCS} HW/WiimoteReal/IOhidapi.cpp) + set(SRCS ${SRCS} HW/WiimoteReal/IOhidapi.cpp) endif() if(PORTAUDIO_FOUND) - set(LIBS ${LIBS} ${PORTAUDIO_LIBRARIES}) + set(LIBS ${LIBS} ${PORTAUDIO_LIBRARIES}) endif() if(OPROFILE_FOUND) - set(LIBS ${LIBS} ${OPROFILE_LIBRARIES}) + set(LIBS ${LIBS} ${OPROFILE_LIBRARIES}) endif() if(GDBSTUB) - set(SRCS ${SRCS} PowerPC/GDBStub.cpp) + set(SRCS ${SRCS} PowerPC/GDBStub.cpp) endif() if(UNIX) - set(SRCS ${SRCS} MemoryWatcher.cpp) + set(SRCS ${SRCS} MemoryWatcher.cpp) endif() add_dolphin_library(core "${SRCS}" "${LIBS}") diff --git a/Source/Core/DiscIO/CMakeLists.txt b/Source/Core/DiscIO/CMakeLists.txt index e7c88c6af0..ae15f3bd6a 100644 --- a/Source/Core/DiscIO/CMakeLists.txt +++ b/Source/Core/DiscIO/CMakeLists.txt @@ -1,22 +1,24 @@ -set(SRCS Blob.cpp - CISOBlob.cpp - WbfsBlob.cpp - CompressedBlob.cpp - DiscScrubber.cpp - DriveBlob.cpp - Enums.cpp - FileBlob.cpp - FileMonitor.cpp - FileSystemGCWii.cpp - Filesystem.cpp - NANDContentLoader.cpp - TGCBlob.cpp - Volume.cpp - VolumeCreator.cpp - VolumeDirectory.cpp - VolumeGC.cpp - VolumeWad.cpp - VolumeWiiCrypted.cpp - WiiWad.cpp) +set(SRCS + Blob.cpp + CISOBlob.cpp + WbfsBlob.cpp + CompressedBlob.cpp + DiscScrubber.cpp + DriveBlob.cpp + Enums.cpp + FileBlob.cpp + FileMonitor.cpp + FileSystemGCWii.cpp + Filesystem.cpp + NANDContentLoader.cpp + TGCBlob.cpp + Volume.cpp + VolumeCreator.cpp + VolumeDirectory.cpp + VolumeGC.cpp + VolumeWad.cpp + VolumeWiiCrypted.cpp + WiiWad.cpp +) add_dolphin_library(discio "${SRCS}" "") diff --git a/Source/Core/DolphinQt2/CMakeLists.txt b/Source/Core/DolphinQt2/CMakeLists.txt index ce59f8b243..fb1ee4b824 100644 --- a/Source/Core/DolphinQt2/CMakeLists.txt +++ b/Source/Core/DolphinQt2/CMakeLists.txt @@ -7,33 +7,33 @@ add_definitions(-DQT_USE_QSTRINGBUILDER -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ set(CMAKE_AUTOMOC ON) set(SRCS - AboutDialog.cpp - Host.cpp - InDevelopmentWarning.cpp - Main.cpp - MainWindow.cpp - MenuBar.cpp - RenderWidget.cpp - Resources.cpp - Settings.cpp - ToolBar.cpp - Config/FilesystemWidget.cpp - Config/InfoWidget.cpp - Config/PathDialog.cpp - Config/PropertiesDialog.cpp - Config/SettingsWindow.cpp - GameList/GameFile.cpp - GameList/GameList.cpp - GameList/GameListModel.cpp - GameList/GameTracker.cpp - GameList/ListProxyModel.cpp - GameList/TableDelegate.cpp - ) + AboutDialog.cpp + Host.cpp + InDevelopmentWarning.cpp + Main.cpp + MainWindow.cpp + MenuBar.cpp + RenderWidget.cpp + Resources.cpp + Settings.cpp + ToolBar.cpp + Config/FilesystemWidget.cpp + Config/InfoWidget.cpp + Config/PathDialog.cpp + Config/PropertiesDialog.cpp + Config/SettingsWindow.cpp + GameList/GameFile.cpp + GameList/GameList.cpp + GameList/GameListModel.cpp + GameList/GameTracker.cpp + GameList/ListProxyModel.cpp + GameList/TableDelegate.cpp +) list(APPEND LIBS core uicommon) if(WIN32) - list(APPEND SRCS DolphinQt2.manifest) + list(APPEND SRCS DolphinQt2.manifest) endif() set(DOLPHINQT2_BINARY dolphin-emu-qt2) @@ -42,40 +42,40 @@ add_executable(${DOLPHINQT2_BINARY} ${SRCS} ${UI_HEADERS}) target_link_libraries(${DOLPHINQT2_BINARY} ${LIBS} Qt5::Widgets) if(APPLE) - # Note: This is copied from DolphinQt, based on the DolphinWX version. + # Note: This is copied from DolphinQt, based on the DolphinWX version. - include(BundleUtilities) - set(BUNDLE_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${DOLPHINQT2_BINARY}.app) + include(BundleUtilities) + set(BUNDLE_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${DOLPHINQT2_BINARY}.app) - # Ask for an application bundle. - set_target_properties(${DOLPHINQT2_BINARY} PROPERTIES - MACOSX_BUNDLE true - MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in - ) + # Ask for an application bundle. + set_target_properties(${DOLPHINQT2_BINARY} PROPERTIES + MACOSX_BUNDLE true + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in + ) - # Copy qt.conf into the bundle - target_sources(${DOLPHINQT2_BINARY} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/qt.conf") - set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/qt.conf" PROPERTIES MACOSX_PACKAGE_LOCATION Resources) + # Copy qt.conf into the bundle + target_sources(${DOLPHINQT2_BINARY} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/qt.conf") + set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/qt.conf" PROPERTIES MACOSX_PACKAGE_LOCATION Resources) - # Copy Qt plugins into the bundle - get_target_property(qtcocoa_location Qt5::QCocoaIntegrationPlugin LOCATION) - target_sources(${DOLPHINQT2_BINARY} PRIVATE "${qtcocoa_location}") - set_source_files_properties("${qtcocoa_location}" PROPERTIES MACOSX_PACKAGE_LOCATION MacOS/platforms) + # Copy Qt plugins into the bundle + get_target_property(qtcocoa_location Qt5::QCocoaIntegrationPlugin LOCATION) + target_sources(${DOLPHINQT2_BINARY} PRIVATE "${qtcocoa_location}") + set_source_files_properties("${qtcocoa_location}" PROPERTIES MACOSX_PACKAGE_LOCATION MacOS/platforms) - # Copy resources into the bundle - set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/Data/Sys") - file(GLOB_RECURSE resources RELATIVE "${CMAKE_SOURCE_DIR}/Data" "${CMAKE_SOURCE_DIR}/Data/Sys/*") - foreach(res ${resources}) - target_sources(${DOLPHINQT2_BINARY} PRIVATE "${CMAKE_SOURCE_DIR}/Data/${res}") - get_filename_component(resdir "${res}" DIRECTORY) - set_source_files_properties("${CMAKE_SOURCE_DIR}/Data/${res}" PROPERTIES - MACOSX_PACKAGE_LOCATION "Resources/${resdir}") - source_group("Resources" FILES "${CMAKE_SOURCE_DIR}/Data/${res}") - endforeach() + # Copy resources into the bundle + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/Data/Sys") + file(GLOB_RECURSE resources RELATIVE "${CMAKE_SOURCE_DIR}/Data" "${CMAKE_SOURCE_DIR}/Data/Sys/*") + foreach(res ${resources}) + target_sources(${DOLPHINQT2_BINARY} PRIVATE "${CMAKE_SOURCE_DIR}/Data/${res}") + get_filename_component(resdir "${res}" DIRECTORY) + set_source_files_properties("${CMAKE_SOURCE_DIR}/Data/${res}" PROPERTIES + MACOSX_PACKAGE_LOCATION "Resources/${resdir}") + source_group("Resources" FILES "${CMAKE_SOURCE_DIR}/Data/${res}") + endforeach() - # Update library references to make the bundle portable - include(DolphinPostprocessBundle) - dolphin_postprocess_bundle(${DOLPHINQT2_BINARY}) + # Update library references to make the bundle portable + include(DolphinPostprocessBundle) + dolphin_postprocess_bundle(${DOLPHINQT2_BINARY}) else() - install(TARGETS ${DOLPHINQT2_BINARY} RUNTIME DESTINATION ${bindir}) + install(TARGETS ${DOLPHINQT2_BINARY} RUNTIME DESTINATION ${bindir}) endif() diff --git a/Source/Core/DolphinWX/CMakeLists.txt b/Source/Core/DolphinWX/CMakeLists.txt index 47bd895aa8..bfdc71ef92 100644 --- a/Source/Core/DolphinWX/CMakeLists.txt +++ b/Source/Core/DolphinWX/CMakeLists.txt @@ -1,209 +1,210 @@ set(GUI_SRCS - AboutDolphin.cpp - ControllerConfigDiag.cpp - Cheats/ActionReplayCodesPanel.cpp - Cheats/ARCodeAddEdit.cpp - Cheats/CheatSearchTab.cpp - Cheats/CheatsWindow.cpp - Cheats/CreateCodeDialog.cpp - Cheats/GeckoCodeDiag.cpp - Config/AddUSBDeviceDiag.cpp - Config/AdvancedConfigPane.cpp - Config/AudioConfigPane.cpp - Config/ConfigMain.cpp - Config/GameCubeConfigPane.cpp - Config/GCAdapterConfigDiag.cpp - Config/GeneralConfigPane.cpp - Config/InterfaceConfigPane.cpp - Config/PathConfigPane.cpp - Config/WiiConfigPane.cpp - Debugger/BreakpointDlg.cpp - Debugger/BreakpointView.cpp - Debugger/BreakpointWindow.cpp - Debugger/CodeView.cpp - Debugger/CodeWindow.cpp - Debugger/CodeWindowFunctions.cpp - Debugger/DSPDebugWindow.cpp - Debugger/DSPRegisterView.cpp - Debugger/DebuggerPanel.cpp - Debugger/DebuggerUIUtil.cpp - Debugger/JitWindow.cpp - Debugger/MemoryCheckDlg.cpp - Debugger/MemoryView.cpp - Debugger/MemoryWindow.cpp - Debugger/RegisterView.cpp - Debugger/RegisterWindow.cpp - Debugger/WatchView.cpp - Debugger/WatchWindow.cpp - ISOProperties/FilesystemPanel.cpp - ISOProperties/InfoPanel.cpp - ISOProperties/ISOProperties.cpp - NetPlay/ChangeGameDialog.cpp - NetPlay/MD5Dialog.cpp - NetPlay/NetPlayLauncher.cpp - NetPlay/NetPlaySetupFrame.cpp - NetPlay/NetWindow.cpp - NetPlay/PadMapDialog.cpp - Input/InputConfigDiag.cpp - Input/InputConfigDiagBitmaps.cpp - Input/HotkeyInputConfigDiag.cpp - Input/GCPadInputConfigDiag.cpp - Input/MicButtonConfigDiag.cpp - Input/GCKeyboardInputConfigDiag.cpp - Input/WiimoteInputConfigDiag.cpp - Input/NunchukInputConfigDiag.cpp - Input/ClassicInputConfigDiag.cpp - Input/GuitarInputConfigDiag.cpp - Input/DrumsInputConfigDiag.cpp - Input/TurntableInputConfigDiag.cpp - DolphinSlider.cpp - FifoPlayerDlg.cpp - Frame.cpp - FrameAui.cpp - FrameTools.cpp - GameListCtrl.cpp - ISOFile.cpp - LogConfigWindow.cpp - LogWindow.cpp - Main.cpp - MainMenuBar.cpp - MainToolBar.cpp - MemcardManager.cpp - PatchAddEdit.cpp - PostProcessingConfigDiag.cpp - SoftwareVideoConfigDialog.cpp - TASInputDlg.cpp - VideoConfigDiag.cpp - WxEventUtils.cpp - WXInputBase.cpp - WxUtils.cpp) + AboutDolphin.cpp + ControllerConfigDiag.cpp + Cheats/ActionReplayCodesPanel.cpp + Cheats/ARCodeAddEdit.cpp + Cheats/CheatSearchTab.cpp + Cheats/CheatsWindow.cpp + Cheats/CreateCodeDialog.cpp + Cheats/GeckoCodeDiag.cpp + Config/AddUSBDeviceDiag.cpp + Config/AdvancedConfigPane.cpp + Config/AudioConfigPane.cpp + Config/ConfigMain.cpp + Config/GameCubeConfigPane.cpp + Config/GCAdapterConfigDiag.cpp + Config/GeneralConfigPane.cpp + Config/InterfaceConfigPane.cpp + Config/PathConfigPane.cpp + Config/WiiConfigPane.cpp + Debugger/BreakpointDlg.cpp + Debugger/BreakpointView.cpp + Debugger/BreakpointWindow.cpp + Debugger/CodeView.cpp + Debugger/CodeWindow.cpp + Debugger/CodeWindowFunctions.cpp + Debugger/DSPDebugWindow.cpp + Debugger/DSPRegisterView.cpp + Debugger/DebuggerPanel.cpp + Debugger/DebuggerUIUtil.cpp + Debugger/JitWindow.cpp + Debugger/MemoryCheckDlg.cpp + Debugger/MemoryView.cpp + Debugger/MemoryWindow.cpp + Debugger/RegisterView.cpp + Debugger/RegisterWindow.cpp + Debugger/WatchView.cpp + Debugger/WatchWindow.cpp + ISOProperties/FilesystemPanel.cpp + ISOProperties/InfoPanel.cpp + ISOProperties/ISOProperties.cpp + NetPlay/ChangeGameDialog.cpp + NetPlay/MD5Dialog.cpp + NetPlay/NetPlayLauncher.cpp + NetPlay/NetPlaySetupFrame.cpp + NetPlay/NetWindow.cpp + NetPlay/PadMapDialog.cpp + Input/InputConfigDiag.cpp + Input/InputConfigDiagBitmaps.cpp + Input/HotkeyInputConfigDiag.cpp + Input/GCPadInputConfigDiag.cpp + Input/MicButtonConfigDiag.cpp + Input/GCKeyboardInputConfigDiag.cpp + Input/WiimoteInputConfigDiag.cpp + Input/NunchukInputConfigDiag.cpp + Input/ClassicInputConfigDiag.cpp + Input/GuitarInputConfigDiag.cpp + Input/DrumsInputConfigDiag.cpp + Input/TurntableInputConfigDiag.cpp + DolphinSlider.cpp + FifoPlayerDlg.cpp + Frame.cpp + FrameAui.cpp + FrameTools.cpp + GameListCtrl.cpp + ISOFile.cpp + LogConfigWindow.cpp + LogWindow.cpp + Main.cpp + MainMenuBar.cpp + MainToolBar.cpp + MemcardManager.cpp + PatchAddEdit.cpp + PostProcessingConfigDiag.cpp + SoftwareVideoConfigDialog.cpp + TASInputDlg.cpp + VideoConfigDiag.cpp + WxEventUtils.cpp + WXInputBase.cpp + WxUtils.cpp +) set(NOGUI_SRCS MainNoGUI.cpp) if(USE_X11) - set(GUI_SRCS ${GUI_SRCS} X11Utils.cpp) - set(NOGUI_SRCS ${NOGUI_SRCS} X11Utils.cpp) + set(GUI_SRCS ${GUI_SRCS} X11Utils.cpp) + set(NOGUI_SRCS ${NOGUI_SRCS} X11Utils.cpp) endif() set(WXLIBS ${wxWidgets_LIBRARIES}) if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - set(WXLIBS ${WXLIBS} dl) + set(WXLIBS ${WXLIBS} dl) endif() list(APPEND LIBS core uicommon cpp-optparse) if(APPLE) - if(wxWidgets_FOUND) - list(APPEND WXLIBS - ${APPSERV_LIBRARY} - ${COCOA_LIBRARY} - ) - endif() - # Add resource files to application bundle. - set(RESOURCES resources/Dolphin.icns) - list(APPEND SRCS ${RESOURCES}) - set_source_files_properties(${RESOURCES} PROPERTIES - MACOSX_PACKAGE_LOCATION Resources) + if(wxWidgets_FOUND) + list(APPEND WXLIBS + ${APPSERV_LIBRARY} + ${COCOA_LIBRARY} + ) + endif() + # Add resource files to application bundle. + set(RESOURCES resources/Dolphin.icns) + list(APPEND SRCS ${RESOURCES}) + set_source_files_properties(${RESOURCES} PROPERTIES + MACOSX_PACKAGE_LOCATION Resources) endif() if(WIN32) - list(APPEND SRCS - DolphinWX.manifest - DolphinWX.rc - ) + list(APPEND SRCS + DolphinWX.manifest + DolphinWX.rc + ) endif() if(APPLE) - set(DOLPHIN_EXE_BASE Dolphin) + set(DOLPHIN_EXE_BASE Dolphin) else() - set(DOLPHIN_EXE_BASE dolphin-emu) + set(DOLPHIN_EXE_BASE dolphin-emu) endif() set(DOLPHIN_EXE ${DOLPHIN_EXE_BASE}) if(wxWidgets_FOUND) - add_executable(${DOLPHIN_EXE} ${SRCS} ${GUI_SRCS}) - target_link_libraries(${DOLPHIN_EXE} ${LIBS} ${WXLIBS}) + add_executable(${DOLPHIN_EXE} ${SRCS} ${GUI_SRCS}) + target_link_libraries(${DOLPHIN_EXE} ${LIBS} ${WXLIBS}) - # Handle localization - find_package(Gettext) - if(GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE) - set(pot_file "${CMAKE_SOURCE_DIR}/Languages/po/dolphin-emu.pot") - file(GLOB LINGUAS ${CMAKE_SOURCE_DIR}/Languages/po/*.po) + # Handle localization + find_package(Gettext) + if(GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE) + set(pot_file "${CMAKE_SOURCE_DIR}/Languages/po/dolphin-emu.pot") + file(GLOB LINGUAS ${CMAKE_SOURCE_DIR}/Languages/po/*.po) - target_sources(${DOLPHIN_EXE} PRIVATE ${pot_file} ${LINGUAS}) - source_group("Localization" FILES ${LINGUAS}) - source_group("Localization\\\\Generated" FILES ${pot_file}) + target_sources(${DOLPHIN_EXE} PRIVATE ${pot_file} ${LINGUAS}) + source_group("Localization" FILES ${LINGUAS}) + source_group("Localization\\\\Generated" FILES ${pot_file}) - foreach(po ${LINGUAS}) - get_filename_component(lang ${po} NAME_WE) - set(mo_dir ${CMAKE_CURRENT_BINARY_DIR}/${lang}) - set(mo ${mo_dir}/dolphin-emu.mo) + foreach(po ${LINGUAS}) + get_filename_component(lang ${po} NAME_WE) + set(mo_dir ${CMAKE_CURRENT_BINARY_DIR}/${lang}) + set(mo ${mo_dir}/dolphin-emu.mo) - target_sources(${DOLPHIN_EXE} PRIVATE ${mo}) - source_group("Localization\\\\Generated" FILES ${mo}) + target_sources(${DOLPHIN_EXE} PRIVATE ${mo}) + source_group("Localization\\\\Generated" FILES ${mo}) - if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - set_source_files_properties(${mo} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/${lang}.lproj") - else() - install(FILES ${mo} DESTINATION share/locale/${lang}/LC_MESSAGES) - endif() + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set_source_files_properties(${mo} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/${lang}.lproj") + else() + install(FILES ${mo} DESTINATION share/locale/${lang}/LC_MESSAGES) + endif() - add_custom_command(OUTPUT ${mo} - COMMAND mkdir -p ${mo_dir} - COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${po} ${pot_file} - COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${mo} ${po} - DEPENDS ${po} - ) - endforeach() - endif() + add_custom_command(OUTPUT ${mo} + COMMAND mkdir -p ${mo_dir} + COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${po} ${pot_file} + COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${mo} ${po} + DEPENDS ${po} + ) + endforeach() + endif() - if(APPLE) - set(BUNDLE_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${DOLPHIN_EXE}.app) + if(APPLE) + set(BUNDLE_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${DOLPHIN_EXE}.app) - # Ask for an application bundle. - set_target_properties(${DOLPHIN_EXE} PROPERTIES - MACOSX_BUNDLE true - MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in - ) + # Ask for an application bundle. + set_target_properties(${DOLPHIN_EXE} PROPERTIES + MACOSX_BUNDLE true + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in + ) - # Copy resources in the bundle - set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/Data/Sys") - file(GLOB_RECURSE resources RELATIVE "${CMAKE_SOURCE_DIR}/Data" "${CMAKE_SOURCE_DIR}/Data/Sys/*") - foreach(res ${resources}) - target_sources(${DOLPHIN_EXE} PRIVATE "${CMAKE_SOURCE_DIR}/Data/${res}") - get_filename_component(resdir "${res}" DIRECTORY) - set_source_files_properties("${CMAKE_SOURCE_DIR}/Data/${res}" PROPERTIES - MACOSX_PACKAGE_LOCATION "Resources/${resdir}") - source_group("Resources" FILES "${CMAKE_SOURCE_DIR}/Data/${res}") - endforeach() + # Copy resources in the bundle + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/Data/Sys") + file(GLOB_RECURSE resources RELATIVE "${CMAKE_SOURCE_DIR}/Data" "${CMAKE_SOURCE_DIR}/Data/Sys/*") + foreach(res ${resources}) + target_sources(${DOLPHIN_EXE} PRIVATE "${CMAKE_SOURCE_DIR}/Data/${res}") + get_filename_component(resdir "${res}" DIRECTORY) + set_source_files_properties("${CMAKE_SOURCE_DIR}/Data/${res}" PROPERTIES + MACOSX_PACKAGE_LOCATION "Resources/${resdir}") + source_group("Resources" FILES "${CMAKE_SOURCE_DIR}/Data/${res}") + endforeach() - # Update library references to make the bundle portable - include(DolphinPostprocessBundle) - dolphin_postprocess_bundle(${DOLPHIN_EXE}) + # Update library references to make the bundle portable + include(DolphinPostprocessBundle) + dolphin_postprocess_bundle(${DOLPHIN_EXE}) - # Install bundle into systemwide /Applications directory. - install(TARGETS ${DOLPHIN_EXE} DESTINATION /Applications) - elseif(WIN32) - set_target_properties(${DOLPHIN_EXE} PROPERTIES - WIN32_EXECUTABLE ON - ) - add_custom_command(TARGET ${DOLPHIN_EXE} - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/Data/Sys $/Sys - ) - else() - install(TARGETS ${DOLPHIN_EXE} RUNTIME DESTINATION ${bindir}) - endif() + # Install bundle into systemwide /Applications directory. + install(TARGETS ${DOLPHIN_EXE} DESTINATION /Applications) + elseif(WIN32) + set_target_properties(${DOLPHIN_EXE} PROPERTIES + WIN32_EXECUTABLE ON + ) + add_custom_command(TARGET ${DOLPHIN_EXE} + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/Data/Sys $/Sys + ) + else() + install(TARGETS ${DOLPHIN_EXE} RUNTIME DESTINATION ${bindir}) + endif() - set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} ${DOLPHIN_EXE}) + set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} ${DOLPHIN_EXE}) endif() if(USE_X11 OR ENABLE_HEADLESS) - set(DOLPHIN_NOGUI_EXE ${DOLPHIN_EXE_BASE}-nogui) - add_executable(${DOLPHIN_NOGUI_EXE} ${SRCS} ${NOGUI_SRCS}) - target_link_libraries(${DOLPHIN_NOGUI_EXE} ${LIBS}) - set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} ${DOLPHIN_NOGUI_EXE}) - install(TARGETS ${DOLPHIN_NOGUI_EXE} RUNTIME DESTINATION ${bindir}) + set(DOLPHIN_NOGUI_EXE ${DOLPHIN_EXE_BASE}-nogui) + add_executable(${DOLPHIN_NOGUI_EXE} ${SRCS} ${NOGUI_SRCS}) + target_link_libraries(${DOLPHIN_NOGUI_EXE} ${LIBS}) + set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} ${DOLPHIN_NOGUI_EXE}) + install(TARGETS ${DOLPHIN_NOGUI_EXE} RUNTIME DESTINATION ${bindir}) endif() diff --git a/Source/Core/InputCommon/CMakeLists.txt b/Source/Core/InputCommon/CMakeLists.txt index b86c0500de..697845c494 100644 --- a/Source/Core/InputCommon/CMakeLists.txt +++ b/Source/Core/InputCommon/CMakeLists.txt @@ -1,54 +1,58 @@ set(SRCS InputConfig.cpp - ControllerEmu/ControllerEmu.cpp - ControllerEmu/Control/Control.cpp - ControllerEmu/Control/Input.cpp - ControllerEmu/Control/Output.cpp - ControllerEmu/ControlGroup/AnalogStick.cpp - ControllerEmu/ControlGroup/Buttons.cpp - ControllerEmu/ControlGroup/ControlGroup.cpp - ControllerEmu/ControlGroup/Cursor.cpp - ControllerEmu/ControlGroup/Extension.cpp - ControllerEmu/ControlGroup/Force.cpp - ControllerEmu/ControlGroup/MixedTriggers.cpp - ControllerEmu/ControlGroup/ModifySettingsButton.cpp - ControllerEmu/ControlGroup/Slider.cpp - ControllerEmu/ControlGroup/Tilt.cpp - ControllerEmu/ControlGroup/Triggers.cpp - ControllerInterface/ControllerInterface.cpp - ControllerInterface/Device.cpp - ControlReference/ControlReference.cpp - ControlReference/ExpressionParser.cpp + ControllerEmu/ControllerEmu.cpp + ControllerEmu/Control/Control.cpp + ControllerEmu/Control/Input.cpp + ControllerEmu/Control/Output.cpp + ControllerEmu/ControlGroup/AnalogStick.cpp + ControllerEmu/ControlGroup/Buttons.cpp + ControllerEmu/ControlGroup/ControlGroup.cpp + ControllerEmu/ControlGroup/Cursor.cpp + ControllerEmu/ControlGroup/Extension.cpp + ControllerEmu/ControlGroup/Force.cpp + ControllerEmu/ControlGroup/MixedTriggers.cpp + ControllerEmu/ControlGroup/ModifySettingsButton.cpp + ControllerEmu/ControlGroup/Slider.cpp + ControllerEmu/ControlGroup/Tilt.cpp + ControllerEmu/ControlGroup/Triggers.cpp + ControllerInterface/ControllerInterface.cpp + ControllerInterface/Device.cpp + ControlReference/ControlReference.cpp + ControlReference/ExpressionParser.cpp ) set(LIBS common) if(WIN32) set(SRCS ${SRCS} - ControllerInterface/DInput/DInput.cpp - ControllerInterface/DInput/DInputJoystick.cpp - ControllerInterface/DInput/DInputKeyboardMouse.cpp - ControllerInterface/DInput/XInputFilter.cpp - ControllerInterface/XInput/XInput.cpp - ControllerInterface/ForceFeedback/ForceFeedbackDevice.cpp) + ControllerInterface/DInput/DInput.cpp + ControllerInterface/DInput/DInputJoystick.cpp + ControllerInterface/DInput/DInputKeyboardMouse.cpp + ControllerInterface/DInput/XInputFilter.cpp + ControllerInterface/XInput/XInput.cpp + ControllerInterface/ForceFeedback/ForceFeedbackDevice.cpp + ) elseif(APPLE) find_library(COREFOUNDATION_LIBRARY CoreFoundation) find_library(CARBON_LIBRARY Carbon) find_library(COCOA_LIBRARY Cocoa) set(SRCS ${SRCS} - ControllerInterface/OSX/OSX.mm - ControllerInterface/OSX/OSXKeyboard.mm - ControllerInterface/OSX/OSXJoystick.mm - ControllerInterface/Quartz/Quartz.mm - ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm - ControllerInterface/ForceFeedback/ForceFeedbackDevice.cpp) + ControllerInterface/OSX/OSX.mm + ControllerInterface/OSX/OSXKeyboard.mm + ControllerInterface/OSX/OSXJoystick.mm + ControllerInterface/Quartz/Quartz.mm + ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm + ControllerInterface/ForceFeedback/ForceFeedbackDevice.cpp + ) set(LIBS ${LIBS} ${COREFOUNDATION_LIBRARY} ${CARBON_LIBRARY} ${COCOA_LIBRARY}) elseif(X11_FOUND) set(SRCS ${SRCS} - ControllerInterface/Xlib/XInput2.cpp) + ControllerInterface/Xlib/XInput2.cpp + ) set(LIBS ${LIBS} ${X11_LIBRARIES} ${X11_INPUT_LIBRARIES}) elseif(ANDROID) add_definitions(-DCIFACE_USE_ANDROID) set(SRCS ${SRCS} - ControllerInterface/Android/Android.cpp) + ControllerInterface/Android/Android.cpp + ) endif() if(ANDROID) diff --git a/Source/Core/UICommon/CMakeLists.txt b/Source/Core/UICommon/CMakeLists.txt index 0f9a25e80a..e25ad9abf9 100644 --- a/Source/Core/UICommon/CMakeLists.txt +++ b/Source/Core/UICommon/CMakeLists.txt @@ -1,7 +1,9 @@ -set(SRCS CommandLineParse.cpp - Disassembler.cpp - UICommon.cpp - USBUtils.cpp) +set(SRCS + CommandLineParse.cpp + Disassembler.cpp + UICommon.cpp + USBUtils.cpp +) set(LIBS common cpp-optparse) if(LIBUSB_FOUND) diff --git a/Source/Core/VideoBackends/Null/CMakeLists.txt b/Source/Core/VideoBackends/Null/CMakeLists.txt index f186da0067..5182a86c4e 100644 --- a/Source/Core/VideoBackends/Null/CMakeLists.txt +++ b/Source/Core/VideoBackends/Null/CMakeLists.txt @@ -1,13 +1,13 @@ set(SRCS - NullBackend.cpp - Render.cpp - VertexManager.cpp - ShaderCache.cpp + NullBackend.cpp + Render.cpp + VertexManager.cpp + ShaderCache.cpp ) set(LIBS - videocommon - common + videocommon + common ) add_dolphin_library(videonull "${SRCS}" "${LIBS}") diff --git a/Source/Core/VideoBackends/OGL/CMakeLists.txt b/Source/Core/VideoBackends/OGL/CMakeLists.txt index 2927253d30..486d6a017f 100644 --- a/Source/Core/VideoBackends/OGL/CMakeLists.txt +++ b/Source/Core/VideoBackends/OGL/CMakeLists.txt @@ -1,27 +1,29 @@ set(SRCS - BoundingBox.cpp - FramebufferManager.cpp - main.cpp - NativeVertexFormat.cpp - PerfQuery.cpp - PostProcessing.cpp - ProgramShaderCache.cpp - RasterFont.cpp - Render.cpp - SamplerCache.cpp - StreamBuffer.cpp - TextureCache.cpp - TextureConverter.cpp - VertexManager.cpp) + BoundingBox.cpp + FramebufferManager.cpp + main.cpp + NativeVertexFormat.cpp + PerfQuery.cpp + PostProcessing.cpp + ProgramShaderCache.cpp + RasterFont.cpp + Render.cpp + SamplerCache.cpp + StreamBuffer.cpp + TextureCache.cpp + TextureConverter.cpp + VertexManager.cpp +) -set(LIBS ${LIBS} - videocommon - SOIL - common - ${X11_LIBRARIES}) +set(LIBS ${LIBS} + videocommon + SOIL + common + ${X11_LIBRARIES} +) if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD") - set(LIBS ${LIBS} usbhid) + set(LIBS ${LIBS} usbhid) endif() add_dolphin_library(videoogl "${SRCS}" "${LIBS}") diff --git a/Source/Core/VideoBackends/Software/CMakeLists.txt b/Source/Core/VideoBackends/Software/CMakeLists.txt index 5706726770..d2b34188ad 100644 --- a/Source/Core/VideoBackends/Software/CMakeLists.txt +++ b/Source/Core/VideoBackends/Software/CMakeLists.txt @@ -1,21 +1,25 @@ -set(SRCS Clipper.cpp - DebugUtil.cpp - EfbCopy.cpp - EfbInterface.cpp - Rasterizer.cpp - SWOGLWindow.cpp - SWRenderer.cpp - SWVertexLoader.cpp - SWmain.cpp - SetupUnit.cpp - Tev.cpp - TextureEncoder.cpp - TextureSampler.cpp - TransformUnit.cpp) +set(SRCS + Clipper.cpp + DebugUtil.cpp + EfbCopy.cpp + EfbInterface.cpp + Rasterizer.cpp + SWOGLWindow.cpp + SWRenderer.cpp + SWVertexLoader.cpp + SWmain.cpp + SetupUnit.cpp + Tev.cpp + TextureEncoder.cpp + TextureSampler.cpp + TransformUnit.cpp +) -set(LIBS videocommon - SOIL - common - ${X11_LIBRARIES}) +set(LIBS + videocommon + SOIL + common + ${X11_LIBRARIES} +) add_dolphin_library(videosoftware "${SRCS}" "${LIBS}") diff --git a/Source/Core/VideoBackends/Vulkan/CMakeLists.txt b/Source/Core/VideoBackends/Vulkan/CMakeLists.txt index 5df1876bfd..8d9f980dd9 100644 --- a/Source/Core/VideoBackends/Vulkan/CMakeLists.txt +++ b/Source/Core/VideoBackends/Vulkan/CMakeLists.txt @@ -1,31 +1,31 @@ set(SRCS - BoundingBox.cpp - CommandBufferManager.cpp - FramebufferManager.cpp - ObjectCache.cpp - PerfQuery.cpp - RasterFont.cpp - Renderer.cpp - ShaderCompiler.cpp - StateTracker.cpp - StagingBuffer.cpp - StagingTexture2D.cpp - StreamBuffer.cpp - SwapChain.cpp - Texture2D.cpp - TextureCache.cpp - TextureConverter.cpp - Util.cpp - VertexFormat.cpp - VertexManager.cpp - VulkanContext.cpp - VulkanLoader.cpp - main.cpp + BoundingBox.cpp + CommandBufferManager.cpp + FramebufferManager.cpp + ObjectCache.cpp + PerfQuery.cpp + RasterFont.cpp + Renderer.cpp + ShaderCompiler.cpp + StateTracker.cpp + StagingBuffer.cpp + StagingTexture2D.cpp + StreamBuffer.cpp + SwapChain.cpp + Texture2D.cpp + TextureCache.cpp + TextureConverter.cpp + Util.cpp + VertexFormat.cpp + VertexManager.cpp + VulkanContext.cpp + VulkanLoader.cpp + main.cpp ) set(LIBS - videocommon - common + videocommon + common ) # Only include the Vulkan headers when building the Vulkan backend diff --git a/Source/Core/VideoCommon/CMakeLists.txt b/Source/Core/VideoCommon/CMakeLists.txt index b7138ec6df..7651798e05 100644 --- a/Source/Core/VideoCommon/CMakeLists.txt +++ b/Source/Core/VideoCommon/CMakeLists.txt @@ -1,66 +1,72 @@ -set(SRCS AsyncRequests.cpp - BoundingBox.cpp - BPFunctions.cpp - BPMemory.cpp - BPStructs.cpp - CPMemory.cpp - CommandProcessor.cpp - Debugger.cpp - DriverDetails.cpp - Fifo.cpp - FPSCounter.cpp - FramebufferManagerBase.cpp - GeometryShaderGen.cpp - GeometryShaderManager.cpp - HiresTextures.cpp - ImageWrite.cpp - IndexGenerator.cpp - LightingShaderGen.cpp - MainBase.cpp - OnScreenDisplay.cpp - OpcodeDecoding.cpp - PerfQueryBase.cpp - PixelEngine.cpp - PixelShaderGen.cpp - PixelShaderManager.cpp - PostProcessing.cpp - RenderBase.cpp - RenderState.cpp - Statistics.cpp - TextureCacheBase.cpp - TextureConversionShader.cpp - TextureDecoder_Common.cpp - VertexLoader.cpp - VertexLoaderBase.cpp - VertexLoaderManager.cpp - VertexLoader_Color.cpp - VertexLoader_Normal.cpp - VertexLoader_Position.cpp - VertexLoader_TextCoord.cpp - VertexManagerBase.cpp - VertexShaderGen.cpp - VertexShaderManager.cpp - VideoBackendBase.cpp - VideoConfig.cpp - VideoState.cpp - XFMemory.cpp - XFStructs.cpp) -set(LIBS core png) +set(SRCS + AsyncRequests.cpp + BoundingBox.cpp + BPFunctions.cpp + BPMemory.cpp + BPStructs.cpp + CPMemory.cpp + CommandProcessor.cpp + Debugger.cpp + DriverDetails.cpp + Fifo.cpp + FPSCounter.cpp + FramebufferManagerBase.cpp + GeometryShaderGen.cpp + GeometryShaderManager.cpp + HiresTextures.cpp + ImageWrite.cpp + IndexGenerator.cpp + LightingShaderGen.cpp + MainBase.cpp + OnScreenDisplay.cpp + OpcodeDecoding.cpp + PerfQueryBase.cpp + PixelEngine.cpp + PixelShaderGen.cpp + PixelShaderManager.cpp + PostProcessing.cpp + RenderBase.cpp + RenderState.cpp + Statistics.cpp + TextureCacheBase.cpp + TextureConversionShader.cpp + TextureDecoder_Common.cpp + VertexLoader.cpp + VertexLoaderBase.cpp + VertexLoaderManager.cpp + VertexLoader_Color.cpp + VertexLoader_Normal.cpp + VertexLoader_Position.cpp + VertexLoader_TextCoord.cpp + VertexManagerBase.cpp + VertexShaderGen.cpp + VertexShaderManager.cpp + VideoBackendBase.cpp + VideoConfig.cpp + VideoState.cpp + XFMemory.cpp + XFStructs.cpp +) + +set(LIBS + core + png +) if(_M_X86) - set(SRCS ${SRCS} TextureDecoder_x64.cpp VertexLoaderX64.cpp) + set(SRCS ${SRCS} TextureDecoder_x64.cpp VertexLoaderX64.cpp) elseif(_M_ARM_64) - set(SRCS ${SRCS} VertexLoaderARM64.cpp TextureDecoder_Generic.cpp) + set(SRCS ${SRCS} VertexLoaderARM64.cpp TextureDecoder_Generic.cpp) else() - set(SRCS ${SRCS} TextureDecoder_Generic.cpp) + set(SRCS ${SRCS} TextureDecoder_Generic.cpp) endif() if(LIBAV_FOUND OR WIN32) - set(SRCS ${SRCS} AVIDump.cpp) + set(SRCS ${SRCS} AVIDump.cpp) endif() add_dolphin_library(videocommon "${SRCS}" "${LIBS}") if(LIBAV_FOUND) - target_link_libraries(videocommon PRIVATE ${LIBS} ${LIBAV_LIBRARIES}) + target_link_libraries(videocommon PRIVATE ${LIBS} ${LIBAV_LIBRARIES}) endif() diff --git a/Source/DSPTool/CMakeLists.txt b/Source/DSPTool/CMakeLists.txt index d18ed8def0..bb89639b6b 100644 --- a/Source/DSPTool/CMakeLists.txt +++ b/Source/DSPTool/CMakeLists.txt @@ -1,5 +1,5 @@ add_executable(dsptool DSPTool.cpp) target_link_libraries(dsptool core) if(NOT APPLE) - install(TARGETS dsptool RUNTIME DESTINATION ${bindir}) + install(TARGETS dsptool RUNTIME DESTINATION ${bindir}) endif() diff --git a/Source/UnitTests/CMakeLists.txt b/Source/UnitTests/CMakeLists.txt index 1a7c5223b0..98910be7db 100644 --- a/Source/UnitTests/CMakeLists.txt +++ b/Source/UnitTests/CMakeLists.txt @@ -1,25 +1,25 @@ set(LIBS core gtest_main) if(APPLE) - list(APPEND LIBS ${FOUNDATION_LIBRARY} ${CORESERV_LIBRARY}) + list(APPEND LIBS ${FOUNDATION_LIBRARY} ${CORESERV_LIBRARY}) endif() if(ANDROID) - set(LIBS ${LIBS} android log) + set(LIBS ${LIBS} android log) endif() file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Tests) macro(add_dolphin_test target srcs) - # Since this is a Core dependency, it can't be linked as a library and has - # to be linked as an object file. Otherwise CMake inserts the library after - # core, but before other core dependencies like videocommon which also use - # Host_ functions. - set(srcs2 ${srcs} ${CMAKE_SOURCE_DIR}/Source/UnitTests/TestUtils/StubHost.cpp) - add_executable(Test_${target} EXCLUDE_FROM_ALL ${srcs2}) - set_target_properties(Test_${target} PROPERTIES - OUTPUT_NAME Tests/${target} - FOLDER Tests - ) - target_link_libraries(Test_${target} ${LIBS}) - add_dependencies(unittests Test_${target}) - add_test(NAME ${target} COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Tests/${target}) + # Since this is a Core dependency, it can't be linked as a library and has + # to be linked as an object file. Otherwise CMake inserts the library after + # core, but before other core dependencies like videocommon which also use + # Host_ functions. + set(srcs2 ${srcs} ${CMAKE_SOURCE_DIR}/Source/UnitTests/TestUtils/StubHost.cpp) + add_executable(Test_${target} EXCLUDE_FROM_ALL ${srcs2}) + set_target_properties(Test_${target} PROPERTIES + OUTPUT_NAME Tests/${target} + FOLDER Tests + ) + target_link_libraries(Test_${target} ${LIBS}) + add_dependencies(unittests Test_${target}) + add_test(NAME ${target} COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Tests/${target}) endmacro() add_subdirectory(TestUtils)