Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/dolphin-emu/dolphin
Browse files Browse the repository at this point in the history
  • Loading branch information
ElGHT committed May 9, 2021
2 parents 50cb09c + eb5cd9b commit 65522f7
Show file tree
Hide file tree
Showing 8,597 changed files with 1,279,047 additions and 1,304,131 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
27 changes: 27 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
root = true

[*]
charset = utf-8
indent_size = 2
trim_trailing_whitespace = true

[*.{c,cpp,h,java}]
indent_style = space
insert_final_newline = true
max_line_length = 100

[{CMakeLists.txt,*.cmake}]
indent_style = tab

[.editorconfig]
insert_final_newline = true

[*.gradle]
indent_size = 4
indent_style = space
insert_final_newline = false

[*.xml]
indent_size = 4
indent_style = space
insert_final_newline = true
49 changes: 49 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This file can be used for git blame using --ignore-revs-file
# or by setting blame.ignoreRevsFile in the git config.

# Remove unnecessary Src/ folders
34692ab826abc8f8faa61bdb2280b742424528f1

# Reformat C++ code
3570c7f03a2aa90aa634f96c0af1969af610f14d

# Reformat Android code
248ee12aed057acd0bdd310359c328e8d4fd5e5a

# Enum and struct indentation cleanup
40182a48a56b8e294e126c64f5f37910a40c67cd
ebb48d019eec1c29a37a406e2db16d7565367faa

# SVN line-ending conversion
30c883bcfc65761dc9fb61fea16a25fb61a7e220
4a0c8fc0c9b6666e7933683260e2befbc81917ff
4b5b9ad05c10d95c9af43502ecc6877d6e680c4d
8fca9a8e8d547653581ecb4aac12a09a4311eba3
a41c1b2d0a9fab51f8a75ccdb7dba0890f766820

# Trailing whitespace
c579637eafb9e9eb7f83711569254bd8da6d09d2
664c8d30a055f4762a2a60be77c1c8eaec1a5d85
84ae817c180556badd1a810fceff4c4168672541
8da425b008b46ef90d649e55c6c0d4a0bc2b556b
8f7c6286f4d4b3e1dccc7076012fe6e593e78c8b

# Additional reformatting
40bb9974f21878e64fb03d70e717cb996bf13a29

# Tabs vs spaces
0e3d8e2e9f1b3eab593b09be986c4ff12a0221e2
16a74a9557779cd15890b0a3bb2924cb4b00ad6f
1db10b139cb1f9b92b2e90eb86f236dcd30333b4
1de39a4a6e6b5ef3ec55bd717d4ba02c02ff8d29
2316cb6876e6d79584ce0cc50771d2fb8495fe45
2d4c3c7c918877c844babaa5ac4c23f8a441fb64
31f037b187525d72c10b83695f780ede1ad9db68
3c6d0fc7106131098fe1a79d2deb0f39671c5252
3fd87a7636ff434118a5d7f7334550be8db55c0b
71ef0a02451393b32fc2304008f87d5b29b61444
7ab0cca6455830a838b1b1e38e2c3f265e4e5d0b
d800b5fb74c077522ef7a0752e49968df46e745e
edd9d0e0ef6898a0528ac6389e93e9fca6132ff6
ee61bd6f2e4db8df8e92be6f92c02b808aa92234
ef85b9af45922c6ca364930d40f8aacf1a6dfe64
12 changes: 7 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ Thumbs.db
Source/Core/Common/scmrev.h
# Ignore files output by build
/[Bb]uild*/
/[Bb]inary/
/[Bb]inary*/
/obj/
# Android cmake builds to here then copies to Source/Android.
# Ignore files output by Android cmake build
/Source/Android/app/.cxx/
/libs/
# Ignore various files created by visual studio/msbuild
*.ipch
Expand All @@ -20,7 +21,8 @@ Source/Core/Common/scmrev.h
*.tlog
*.VC.opendb
*.VC.db
.vs/
.vs*/
/Source/enc_temp_folder/
# Ignore build info file created by QtCreator
CMakeLists.txt.user
# Ignore files created by posix people
Expand All @@ -30,9 +32,9 @@ CMakeLists.txt.user
# Ignore emacs temp files
\#*\#
.\#*
# Ignore transifex configuration directory
.tx
# Ignore kdevelop files/dirs
*.kdev4
# Ignore IDEA/Clion files/dirs
/.idea/
# Ignore Visual Studio Code's working dir
/.vscode/
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
path = Externals/Qt
url = https://github.com/dolphin-emu/ext-win-qt.git
branch = master
shallow = true
8 changes: 8 additions & 0 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[main]
host = https://www.transifex.com

[dolphin-emu.emulator]
file_filter = Languages/po/<lang>.po
source_file = Languages/po/dolphin-emu.pot
source_lang = en-US
type = PO
28 changes: 5 additions & 23 deletions AndroidSetup.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,10 @@ If you'd like to contribute to the Android project, but do not currently have a

## Prerequisites

* A Linux VM or host, or a Mac.
* JDK 7 for your platform.
* CMake
* [Android NDK](https://developer.android.com/tools/sdk/ndk/index.html)
* [Android Studio](http://developer.android.com/tools/studio/index.html) **OR**
* [Android SDK Tools](http://developer.android.com/sdk/index.html#Other) (for command-line usage)
* [Android Studio](http://developer.android.com/tools/studio/index.html)

If you downloaded Android Studio, extract it and then see [Setting up Android Studio](#setting-up-android-studio).

If you instead chose to download the commoand-line SDK tools, see [Setting up the SDK Tools](#setting-up-the-sdk-tools).

## Setting up Android Studio

1. Launch Android Studio, which will start a first-launch wizard.
Expand All @@ -26,12 +19,6 @@ If you instead chose to download the commoand-line SDK tools, see [Setting up th
7. Use the SDK Manager to get necessary dependencies, as described in [Getting Dependencies](#getting-dependencies).
8. When done, follow the steps in [Readme.md](Readme.md#installation-on-android) to compile and deploy the application.

## Setting up the SDK Tools

1. In `Source/Android`, create a file called `local.properties`.
2. Add a single line: `sdk.dir=<sdk-path>`, where `<sdk-path>` is the path where you extracted the SDK Tools package.
3. Follow the steps in [Readme.md](Readme.md#installation-on-android) to compile and deploy the application.

## Executing Gradle Tasks

In Android Studio, you can find a list of possible Gradle tasks in a tray at the top right of the screen:
Expand All @@ -50,19 +37,14 @@ For command-line users, any task may be executed with `Source/Android/gradlew <t

Most dependencies for the Android project are supplied by Gradle automatically. However, Android platform libraries (and a few Google-supplied supplementary libraries) must be downloaded through the Android package manager.

1. Launch the Android SDK Manager from the commandline by executing `<sdk-path>/tools/android`, or by clicking on its icon in Android Studio's main toolbar:
1. Launch the Android SDK Manager by clicking on its icon in Android Studio's main toolbar:
![Android Studio Package Icon][package-icon]
2. At the bottom of the window, click "Deselect All", and then "Updates".
3. Install or update the following packages:

* SDK Platform, under "Android 5.0.1 (API 21)". This will allow compiling apps that target Lollipop.
* Android Support Repository
* Android Support Library
* Google Repository
2. Install or update the SDK Platform. Choose the API level selected as [compileSdkVersion](Source/Android/app/build.gradle#L5).
3. Install or update the SDK Tools. CMake, LLDB and NDK. If you don't use android-studio, please check out https://github.com/Commit451/android-cmake-installer.

In the future, if the project targets a newer version of Android, or use newer versions of the tools/build-tools packages, it will be necessary to use this tool to download updates.

[components]: http://i.imgur.com/Oo1Fs93.png
[package-icon]: http://i.imgur.com/NUpkAH8.png
[gradle]: http://i.imgur.com/dXIH6o3.png
[shortcut]: http://i.imgur.com/eCWP4Yy.png
[shortcut]: http://i.imgur.com/eCWP4Yy.png
10 changes: 10 additions & 0 deletions CMake/CCache.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
find_program(CCACHE_BIN NAMES ccache sccache)
if(CCACHE_BIN)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE_BIN})

# ccache uses -I when compiling without preprocessor, which makes clang complain.
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -fcolor-diagnostics")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qunused-arguments -fcolor-diagnostics")
endif()
endif()
56 changes: 56 additions & 0 deletions CMake/CheckAndAddFlag.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)

# check_add_add_flag(<variable> <flag> [DEBUG_ONLY | RELEASE_ONLY])
#
# Add a C or C++ compilation flag to the current scope
#
# Can optionally add the flag to Debug or Release configurations only, use this when
# targeting multi-configuration generators like Visual Studio or Xcode.
# Release configurations means NOT Debug, so it will work for RelWithDebInfo or MinSizeRel too.
#
# If the flag is added successfully, the variables FLAG_C_<variable> and FLAG_CXX_<variable>
# may be set to ON.
#
# Examples:
# check_and_add_flag(FOO -foo)
# check_and_add_flag(ONLYDEBUG -onlydebug DEBUG_ONLY)
# check_and_add_flag(OPTMAX -O9001 RELEASE_ONLY)

function(check_and_add_flag var flag)
set(genexp_config_test "1")
if(ARGV2 STREQUAL "DEBUG_ONLY")
set(genexp_config_test "$<CONFIG:Debug>")
elseif(ARGV2 STREQUAL "RELEASE_ONLY")
set(genexp_config_test "$<NOT:$<CONFIG:Debug>>")
elseif(ARGV2)
message(FATAL_ERROR "check_and_add_flag called with incorrect arguments: ${ARGN}")
endif()

set(is_c "$<COMPILE_LANGUAGE:C>")
set(is_cxx "$<COMPILE_LANGUAGE:CXX>")
set(test_flags_c)
set(test_flags_cxx)

# The Visual Studio generators don't support COMPILE_LANGUAGE
# So we fail all the C flags and only actually test CXX ones
if(CMAKE_GENERATOR MATCHES "Visual Studio")
set(is_c "0")
set(is_cxx "1")
else()
# Otherwise assume the compile follows GCC syntax
# and fail when the option is known but invalid.
set(test_flags_c "${test_flags_c}-Werror ")
set(test_flags_cxx "${test_flags_cxx}-Werror ")
endif()

check_c_compiler_flag("${test_flags_c}${flag}" FLAG_C_${var})
if(FLAG_C_${var})
add_compile_options("$<$<AND:${is_c},${genexp_config_test}>:${flag}>")
endif()

check_cxx_compiler_flag("${test_flags_cxx}${flag}" FLAG_CXX_${var})
if(FLAG_CXX_${var})
add_compile_options("$<$<AND:${is_cxx},${genexp_config_test}>:${flag}>")
endif()
endfunction()
58 changes: 58 additions & 0 deletions CMake/CheckLib.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
find_package(PkgConfig)

macro(_internal_message msg)
if(NOT ${_is_quiet})
message(STATUS "${msg}")
endif()
endmacro()

macro(check_lib var pc lib)
set(_is_required 0)
set(_is_quiet 0)
set(_arg_list ${ARGN})
foreach(_arg ${ARGN})
if(_arg STREQUAL "REQUIRED")
list(REMOVE_ITEM _arg_list "REQUIRED")
set(_is_required 1)
endif()
if(_arg STREQUAL "QUIET")
list(REMOVE_ITEM _arg_list "QUIET")
set(_is_quiet 1)
endif()
endforeach()

if(PKG_CONFIG_FOUND AND NOT ${var}_FOUND)
pkg_search_module(${var} QUIET ${pc})
endif()

if(${var}_FOUND)
if(${var}_INCLUDE_DIRS)
include_directories(${${var}_INCLUDE_DIRS})
endif()
# Make sure include directories for headers found using find_path below
# are re-added when reconfiguring
if(${var}_INCLUDE)
include_directories(${${var}_INCLUDE})
endif()
_internal_message("${lib} found")
else()
find_library(${var} ${lib})
if(_arg_list)
find_path(${var}_INCLUDE ${_arg_list})
else()
set(${var}_INCLUDE FALSE)
endif()
if(${var} AND ${var}_INCLUDE)
include_directories(${${var}_INCLUDE})
_internal_message("${lib} found")
set(${var}_FOUND 1 CACHE INTERNAL "")
else()
if(_is_required)
message(FATAL_ERROR "${lib} is required but not found")
else()
_internal_message("${lib} not found")
endif()
endif()
endif()
endmacro()

29 changes: 29 additions & 0 deletions CMake/CheckVendoringApproved.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# When packaging Dolphin for an OS distribution, distro vendors usually prefer
# to limit vendored ("Externals") dependencies as much as possible, in favor of
# using system provided libraries. This modules provides an option to allow
# only specific vendored dependencies and error-out at configuration time for
# non-approved ones.
#
# Usage:
# $ cmake -D APPROVED_VENDORED_DEPENDENCIES="a;b;c;..."
#
# Unless the option is explicitly used, vendored dependencies control is
# disabled.
#
# If you want to disallow all vendored dependencies, put "none" in the approved
# dependencies list.

set(APPROVED_VENDORED_DEPENDENCIES "" CACHE STRING "\
Semicolon separated list of approved vendored dependencies. See docstring in \
CMake/CheckVendoringApproved.cmake.")

function(check_vendoring_approved dep)
if(APPROVED_VENDORED_DEPENDENCIES)
if(NOT dep IN_LIST APPROVED_VENDORED_DEPENDENCIES)
message(SEND_ERROR "\
Library ${dep} was not found systemwide and was not approved for vendoring. \
Vendored dependencies control is enabled. Add \"${dep}\" to the \
APPROVED_VENDORED_DEPENDENCIES list to bypass this error.")
endif()
endif()
endfunction()
34 changes: 34 additions & 0 deletions CMake/DolphinCompileDefinitions.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Add C or C++ compile definitions to the current scope
#
# dolphin_compile_definitions(def [def ...] [DEBUG_ONLY | RELEASE_ONLY])
#
# Can optionally add the definitions to Debug or Release configurations only, use this so we can
# target multi-configuration generators like Visual Studio or Xcode.
# Release configurations means NOT Debug, so it will work for RelWithDebInfo or MinSizeRel too.
# The definitions are added to the COMPILE_DEFINITIONS folder property.
# Supports generator expressions, unlike add_definitions()
#
# Examples:
# dolphin_compile_definitions(FOO) -> -DFOO
# dolphin_compile_definitions(_DEBUG DEBUG_ONLY) -> -D_DEBUG
# dolphin_compile_definitions(NDEBUG RELEASE_ONLY) -> -DNDEBUG
# dolphin_compile_definitions($<$<COMPILE_LANGUAGE:C>:THISISONLYFORC>)

function(dolphin_compile_definitions)
set(defs ${ARGN})

list(GET defs -1 last_def)
list(REMOVE_AT defs -1)

set(genexp_config_test "1")
if(last_def STREQUAL "DEBUG_ONLY")
set(genexp_config_test "$<CONFIG:Debug>")
elseif(last_def STREQUAL "RELEASE_ONLY")
set(genexp_config_test "$<NOT:$<CONFIG:Debug>>")
else()
list(APPEND defs ${last_def})
endif()

set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
"$<${genexp_config_test}:${defs}>")
endfunction()
Loading

0 comments on commit 65522f7

Please sign in to comment.