39 Commits

Author SHA1 Message Date
c55481882f Merge pull request #2687 from AdmiralCurtiss/temp-settings-ini-hotfix
Config Hotfix: Prevent per-game settings (ie. GameINI) being stored to the global user configuration.
2015-12-02 15:34:28 +01:00
110ec72cff Merge pull request #2816 from comex/huh-where-did-this-go
Make the LLVM detect script verify that the dynamic library actually exists.
2015-10-28 21:37:36 +01:00
452a0f8042 Merge pull request #2717 from phire/fix-reordering
PPCAnalyst: Don't swap instruction which might cause interrupts.
2015-10-03 16:21:13 +02:00
bfd5c6c69d Merge pull request #3066 from degasus/master
GLInterface: Fix VideoSW on linux + OSX (v2)

Conflicts:
	Source/Core/VideoBackends/OGL/GLInterface/GLX.cpp
2015-09-23 21:09:03 +02:00
2814aa20c8 Merge pull request #2829 from JosJuice/fix-wii-fst-size-2
Fix reading Wii FST size (for real this time)
2015-09-23 21:09:02 +02:00
bfdbace69b Merge pull request #3025 from Tilka/fixfix
VertexLoaderX64: fix 2GB warnings
2015-09-23 21:09:02 +02:00
3556bc0bed Merge pull request #2995 from endrift/tasinputdlg-threading
DolphinWX: TAS fixes, take three
2015-09-23 21:09:01 +02:00
2cd05f2225 Merge pull request #2968 from t27duck/lost_levels_missing_ini
Add missing INI file for SMB: The Lost Levels
2015-09-23 21:09:01 +02:00
31584057a3 Merge pull request #2933 from t27duck/mm5_missing_ini
Added missing Mega Man 5 INI file
2015-09-23 21:09:00 +02:00
4120102305 Merge pull request #2996 from jcowgill/stable
Fix build error with -Werror=format-security
2015-09-07 15:29:41 +02:00
8c8a2ab248 Reinstate format string.
Avoid the consequences in the unlikely event the path includes a %.
2015-09-07 14:15:54 +01:00
4f0e2f6b62 Merge pull request #2885 from endrift/tasinputdlg-threading
DolphinWX: Finish removing bandaid from 704f787
2015-09-02 20:14:37 +02:00
de5b14444b Merge pull request #2834 from endrift/tasinputdlg-threading
DolphinWX: Ensure TASInputDlg only gets modified on the main thread
2015-09-02 20:14:13 +02:00
7efd9fd56c Merge pull request #2696 from RisingFog/tasinput
Fix random hangs when loading savestates with TAS Input
2015-09-01 22:20:36 +02:00
a522aa5bfc Merge pull request #2689 from RisingFog/patch-1
Fix TASInput Crash When Stick Bitmap Is Null
2015-09-01 22:20:01 +02:00
cc8380ee65 Merge pull request #2914 from JosJuice/fix-volumedirectory
Fix VolumeDirectory
2015-09-01 22:19:14 +02:00
994d13af83 Merge pull request #2894 from Sonicadvance1/no_more_eaten_canary
Fix the shader overrunning our max shader size.
2015-09-01 22:12:35 +02:00
2dd7702af0 Merge pull request #2830 from JosJuice/disc-scrubber-nullptr
DiscScrubber: Add another nullptr check
2015-08-19 04:53:04 -04:00
20081a98f6 DiscScrubber: Add another nullptr check 2015-08-18 14:15:01 +02:00
d01356d312 Merge pull request #2828 from JosJuice/sonic-riders-sudtr
Set Speed Up Disc Transfer rate in the Sonic Riders INI
2015-08-17 17:05:11 +02:00
2edace65b5 Merge pull request #2857 from Danbsky/gameini
Gameini: Add ZTP Hyrule Field Speed Hack to GC NTSC-J version
2015-08-16 23:51:39 +02:00
8759d82b8a Merge pull request #2858 from lioncash/leak
DolphinWX: Fix memory leaks occurring in ISOProperties
2015-08-16 23:51:17 +02:00
83f0ae9ab7 Merge pull request #2763 from endrift/update-gtest
Externals: Update gtest to r733
2015-08-16 10:12:08 +02:00
7c0b81f9a5 Merge pull request #2794 from randomstuff/evdev-stable
Stable device identifier for evdev
2015-08-16 10:06:26 +02:00
24d8cc5c07 Merge pull request #2856 from mathieui/netplay-free
[netplay] Fix a crash
2015-08-16 10:03:49 +02:00
7950c77332 Merge pull request #2854 from Tilka/valgrind
Fix some small stuff found with Valgrind

Conflicts:
	Source/Core/Core/PowerPC/CachedInterpreter.cpp
2015-08-16 10:03:47 +02:00
da832d9671 Merge pull request #2852 from aserna3/master
Changed GC adapter "Direct Connect" to false by default

Conflicts:
	Source/Core/Core/ConfigManager.cpp
2015-08-16 09:52:23 +02:00
48898803c0 Merge pull request #2817 from comex/clientca-typo
Forgot to add a slash in one bit of code I switched from D_WIIUSER_IDX to D_SESSION_WIIROOT_IDX.
2015-08-15 12:10:21 +02:00
f801ccc9b2 Merge pull request #2024 from RisingFog/irgui
Add UI Support for up to 8x Internal Resolutions
2015-08-13 12:37:31 +02:00
6911e2470a Merge pull request #2835 from degasus/master
Wiimotes: Initialize all atomic<bool> globally.
2015-08-12 21:47:03 +02:00
44e918e213 Set Speed Up Disc Transfer rate in the Sonic Riders INI
091db36 added a new delay for disc commands in an attempt to fix issues.
It fixed Sonic Riders crashing after the third level... or so we thought.
091db36 also happened changed the order disc reads happen in so that the
data is copied to memory before the emulated delay is finished. This was
inaccurate and caused an audio problem in Resident Evil 3, leading to the
old order being restored in 8cc6e5c. Now that the order is correct,
Sonic Riders is broken again, despite 091db36's delay still existing.
We're more or less back to square one - nobody knows what's broken, and
nobody knows how to fix it. This commit restores SUDTR to Sonic Rider's
game INI so that it'll work out of the box in 5.0 just like in 4.0.
2015-08-10 16:05:04 +02:00
d431525292 Merge pull request #2818 from endrift/fix-gdbstub-build-stable
PowerPC: Fix GDBStub build (stable)
2015-08-09 03:21:19 -04:00
417c592a41 PowerPC: Fix GDBStub build 2015-08-08 22:18:36 -07:00
e99e8c51cd Merge pull request #2815 from JosJuice/fix-elf-crash
Fix GC software crashing at boot if no disc is inserted
2015-08-08 23:27:56 -04:00
1d48a2f179 Fix GC software crashing at boot if no disc is inserted
Same fix as 0b44d7c, plus a way to skip loading the apploader
just like EmulatedBS2_Wii has been able to do for a long time.
2015-08-08 22:31:51 +02:00
837cbfa4e3 CMakeLists: Update version number. 2015-07-31 19:12:37 +02:00
cd56661573 Automatic translation resources update from Transifex 2015-07-31 10:04:05 +00:00
0778cc42ee Automatic translation template update 2015-07-28 10:01:32 +00:00
4881ad2282 Config: Hotfix to prevent per-game settings from ie. GameINIs being stored to the global user configuration. 2015-07-02 22:27:01 +02:00
10703 changed files with 1510246 additions and 1588604 deletions

View File

@ -1,27 +0,0 @@
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

View File

@ -1,67 +0,0 @@
# 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
3b36e0657140a8f54729f55f94ad108547362ed5
473cd01181be6c8160ce477f25ca6bd39f8cc083
49cfded60bb5b444d1828190eacc52bbb49a9cb8
4a0c8fc0c9b6666e7933683260e2befbc81917ff
4b5b9ad05c10d95c9af43502ecc6877d6e680c4d
4b68a543ba30ec18e79c93b742bc6f110ccd4561
4f889ca1a3cb66ff78f11aa6864edf8ce51b8c93
578c402d2ce5e6a7b6e42a4c7449d9aeac61e5e2
5e81298ef0147bf36c4aaafa35accc2700777bd3
7efbc879e544cba7f205b3eeaeff050f46fd9607
7f4ebed1ddb7ca9aaa49172946fc1f7dc2dc3c75
8151b21ec75107b73a5863177f29d6f69b7174fc
8fca9a8e8d547653581ecb4aac12a09a4311eba3
901fe7c00fec5e2aaf55d184edbcb6d092345d52
90bac5731cc4b15f40be9cf3a51a2c88ca6b53bf
9146b9b261c34f476c9f83934e6da6a463ad51c7
a41c1b2d0a9fab51f8a75ccdb7dba0890f766820
a524cecfabbd4e321485e0cbac9325efde2123ef
ab76cbf2fcf31b059edf10c220800150313ddf18
bbb98d8e2e8259213cc231041eba922471555eb9
e6fe5ec42f025a710918c1aaf8643da36a13bb3e
fc1c7c31a08d55be4c756a1ed599d6afeedd9a11
# 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

1
.gitattributes vendored
View File

@ -1 +0,0 @@
*.sln text eol=crlf

23
.gitignore vendored
View File

@ -3,16 +3,12 @@ Thumbs.db
# Ignore Finder view option files created by OS X # Ignore Finder view option files created by OS X
.DS_Store .DS_Store
# Ignore autogenerated source files # Ignore autogenerated source files
Externals/mGBA/version.c
Source/Core/Common/scmrev.h Source/Core/Common/scmrev.h
# Ignore files output by build # Ignore files output by build
/cmake-build-debug
/cmake-build-release
/[Bb]uild*/ /[Bb]uild*/
/[Bb]inary*/ /[Bb]inary/
/obj/ /obj/
# Ignore files output by Android cmake build # Android cmake builds to here then copies to Source/Android.
/Source/Android/app/.cxx/
/libs/ /libs/
# Ignore various files created by visual studio/msbuild # Ignore various files created by visual studio/msbuild
*.ipch *.ipch
@ -22,24 +18,15 @@ Source/Core/Common/scmrev.h
*.vcxproj.user *.vcxproj.user
*.obj *.obj
*.tlog *.tlog
*.VC.opendb
*.VC.db
.vs*/
/Source/enc_temp_folder/
# Ignore build info file created by QtCreator # Ignore build info file created by QtCreator
CMakeLists.txt.user CMakeLists.txt.user
# Ignore files created by posix people # Ignore files created by posix people
*~ *~
# Ignore vim swapfiles # Ignore vim swapfiles
*.swp *.swp
# Ignore emacs temp files # Ignore transifex configuration directory
\#*\# .tx
.\#*
# Ignore kdevelop files/dirs # Ignore kdevelop files/dirs
*.kdev4 *.kdev4
# Ignore IDEA/Clion files/dirs # Ignore IDEA/Clion files/dirs
.idea/ /.idea/
# Ignore Visual Studio Code's working dir
/.vscode/
# Ignore flatpak-builder's cache dir
.flatpak-builder

106
.gitmodules vendored
View File

@ -1,108 +1,4 @@
[submodule "Externals/Qt"] [submodule "Externals/Qt"]
path = Externals/Qt path = Externals/Qt
url = https://github.com/dolphin-emu/ext-win-qt.git url = https://github.com/dolphin-emu/ext-win-qt.git
shallow = true branch = master
[submodule "Externals/mGBA/mgba"]
path = Externals/mGBA/mgba
url = https://github.com/mgba-emu/mgba.git
shallow = true
[submodule "Externals/FFmpeg-bin"]
path = Externals/FFmpeg-bin
url = https://github.com/dolphin-emu/ext-win-ffmpeg.git
shallow = true
[submodule "libusb"]
path = Externals/libusb/libusb
url = https://github.com/libusb/libusb.git
shallow = true
[submodule "Externals/spirv_cross/SPIRV-Cross"]
path = Externals/spirv_cross/SPIRV-Cross
url = https://github.com/KhronosGroup/SPIRV-Cross.git
shallow = true
[submodule "SDL"]
path = Externals/SDL/SDL
url = https://github.com/libsdl-org/SDL.git
shallow = true
[submodule "Externals/zlib-ng/zlib-ng"]
path = Externals/zlib-ng/zlib-ng
url = https://github.com/zlib-ng/zlib-ng.git
shallow = true
[submodule "Externals/libspng/libspng"]
path = Externals/libspng/libspng
url = https://github.com/randy408/libspng.git
shallow = true
[submodule "Externals/VulkanMemoryAllocator"]
path = Externals/VulkanMemoryAllocator
url = https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
shallow = true
[submodule "Externals/cubeb/cubeb"]
path = Externals/cubeb/cubeb
url = https://github.com/mozilla/cubeb.git
shallow = true
[submodule "Externals/implot/implot"]
path = Externals/implot/implot
url = https://github.com/epezent/implot.git
shallow = true
[submodule "Externals/gtest"]
path = Externals/gtest
url = https://github.com/google/googletest.git
shallow = true
[submodule "Externals/rcheevos/rcheevos"]
path = Externals/rcheevos/rcheevos
url = https://github.com/RetroAchievements/rcheevos.git
shallow = true
[submodule "Externals/libadrenotools"]
path = Externals/libadrenotools
url = https://github.com/bylaws/libadrenotools.git
shallow = true
[submodule "Externals/curl/curl"]
path = Externals/curl/curl
url = https://github.com/curl/curl.git
shallow = true
[submodule "Externals/fmt/fmt"]
path = Externals/fmt/fmt
url = https://github.com/fmtlib/fmt.git
shallow = true
[submodule "Externals/lz4/lz4"]
path = Externals/lz4/lz4
url = https://github.com/lz4/lz4.git
shallow = true
[submodule "Externals/xxhash/xxHash"]
path = Externals/xxhash/xxHash
url = https://github.com/Cyan4973/xxHash.git
shallow = true
[submodule "Externals/enet/enet"]
path = Externals/enet/enet
url = https://github.com/lsalzman/enet.git
shallow = true
[submodule "hidapi-src"]
path = Externals/hidapi/hidapi-src
url = https://github.com/libusb/hidapi.git
shallow = true
[submodule "Externals/tinygltf/tinygltf"]
path = Externals/tinygltf/tinygltf
url = https://github.com/syoyo/tinygltf.git
shallow = true
[submodule "Externals/minizip-ng/minizip-ng"]
path = Externals/minizip-ng/minizip-ng
url = https://github.com/zlib-ng/minizip-ng.git
shallow = true
[submodule "Externals/Vulkan-Headers"]
path = Externals/Vulkan-Headers
url = https://github.com/KhronosGroup/Vulkan-Headers.git
shallow = true
[submodule "Externals/watcher/watcher"]
path = Externals/watcher/watcher
url = https://github.com/e-dant/watcher.git
shallow = true
[submodule "Externals/SFML/SFML"]
path = Externals/SFML/SFML
url = https://github.com/SFML/SFML.git
shallow = true
[submodule "Externals/zstd/zstd"]
path = Externals/zstd/zstd
url = https://github.com/facebook/zstd.git
shallow = true
[submodule "Externals/miniupnpc/miniupnp"]
path = Externals/miniupnpc/miniupnp
url = https://github.com/miniupnp/miniupnp.git
shallow = true

View File

@ -1,8 +0,0 @@
[main]
host = https://www.transifex.com
[o:dolphinemu:p:dolphin-emu:r:emulator]
file_filter = Languages/po/<lang>.po
source_file = Languages/po/dolphin-emu.pot
source_lang = en-US
type = PO

View File

@ -1,26 +0,0 @@
# How to Set Up an Android Development Environment
If you'd like to contribute to the Android project, but do not currently have a development environment setup, follow the instructions in this guide.
## Prerequisites
* [Android Studio](https://developer.android.com/studio/)
If you downloaded Android Studio, install it with the default options and open the project located in `dolphin/Source/Android`
## Setting Up Android Studio
1. Wait for background tasks to complete on the bottom of the window.
2. Launch the Android SDK Manager by clicking on its icon in Android Studio's main toolbar:
![Android Studio Package Icon][package-icon]
3. Install or update the SDK Platform. Choose the API level as defined in the app module's [build.gradle](Source/Android/app/build.gradle#L7) file.
4. Install a CMake version as defined in the app module's [build.gradle](Source/Android/app/build.gradle#L99) file. The option won't appear until you select `Show Package Details`.
5. Select `Build Variants` on the left side of the window to choose the build variant and ABI you would like to compile for the `:app` module.
6. Select the green hammer icon in the main toolbar to build and create the apk in `Source/Android/app/build/outputs/apk`
## Compiling from the Command-Line
For command-line users, any task may be executed with `cd Source/Android` followed by `gradlew <task-name>`. In particular, `gradlew assemble` builds debug and release versions of the application (which are placed in `Source/Android/app/build/outputs/apk`).
[package-icon]: https://i.imgur.com/hgmMlsM.png
[code-style]: https://i.imgur.com/3b3UBhb.png

View File

@ -1,379 +0,0 @@
#!/usr/bin/env python3
"""
The current tooling supported in CMake, Homebrew, and Qt5 are insufficient for
creating macOS universal binaries automatically for applications like Dolphin
which have more complicated build requirements (like different libraries, build
flags and source files for each target architecture).
So instead, this script manages the configuration and compilation of distinct
builds and project files for each target architecture and then merges the two
binaries into a single universal binary.
Running this script will:
1) Generate Xcode project files for the ARM build (if project files don't
already exist)
2) Generate Xcode project files for the x64 build (if project files don't
already exist)
3) Build the ARM project for the selected build_target
4) Build the x64 project for the selected build_target
5) Generate universal .app packages combining the ARM and x64 packages
6) Use the lipo tool to combine the binary objects inside each of the
packages into universal binaries
7) Code sign the final universal binaries using the specified
codesign_identity
"""
import argparse
import filecmp
import glob
import json
import multiprocessing
import os
import shutil
import subprocess
# The config variables listed below are the defaults, but they can be
# overridden by command line arguments see parse_args(), or run:
# BuildMacOSUniversalBinary.py --help
DEFAULT_CONFIG = {
# Location of destination universal binary
"dst_app": "universal/",
# Build Target (dolphin-emu to just build the emulator and skip the tests)
"build_target": "ALL_BUILD",
# Location for CMake to search for files (default is for homebrew)
"arm64_cmake_prefix": "/opt/homebrew",
"x86_64_cmake_prefix": "/usr/local",
# Locations to qt5 directories for arm and x64 libraries
# The default values of these paths are taken from the default
# paths used for homebrew
"arm64_qt5_path": "/opt/homebrew/opt/qt5",
"x86_64_qt5_path": "/usr/local/opt/qt5",
# Identity to use for code signing. "-" indicates that the app will not
# be cryptographically signed/notarized but will instead just use a
# SHA checksum to verify the integrity of the app. This doesn't
# protect against malicious actors, but it does protect against
# running corrupted binaries and allows for access to the extended
# permissions needed for ARM builds
"codesign_identity": "-",
# CMake Generator to use for building
"generator": "Unix Makefiles",
"build_type": "Release",
"run_unit_tests": False,
# Whether our autoupdate functionality is enabled or not.
"autoupdate": True,
# The distributor for this build.
"distributor": "None"
}
# Architectures to build for. This is explicitly left out of the command line
# config options for several reasons:
# 1) Adding new architectures will generally require more code changes
# 2) Single architecture builds should utilize the normal generated cmake
# project files rather than this wrapper script
ARCHITECTURES = ["x86_64", "arm64"]
def parse_args(conf=DEFAULT_CONFIG):
"""
Parses the command line arguments into a config dictionary.
"""
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument(
"--target",
help="Build target in generated project files",
default=conf["build_target"],
dest="build_target")
parser.add_argument(
"-G",
help="CMake Generator to use for creating project files",
default=conf["generator"],
dest="generator")
parser.add_argument(
"--build_type",
help="CMake build type [Debug, Release, RelWithDebInfo, MinSizeRel]",
default=conf["build_type"],
dest="build_type")
parser.add_argument(
"--dst_app",
help="Directory where universal binary will be stored",
default=conf["dst_app"])
parser.add_argument("--run_unit_tests", action="store_true",
default=conf["run_unit_tests"])
parser.add_argument(
"--autoupdate",
help="Enables our autoupdate functionality",
action=argparse.BooleanOptionalAction,
default=conf["autoupdate"])
parser.add_argument(
"--distributor",
help="Sets the distributor for this build",
default=conf["distributor"])
parser.add_argument(
"--codesign",
help="Code signing identity to use to sign the applications",
default=conf["codesign_identity"],
dest="codesign_identity")
for arch in ARCHITECTURES:
parser.add_argument(
f"--{arch}_cmake_prefix",
help="Folder for cmake to search for packages",
default=conf[arch+"_cmake_prefix"],
dest=arch+"_cmake_prefix")
parser.add_argument(
f"--{arch}_qt5_path",
help=f"Install path for {arch} qt5 libraries",
default=conf[arch+"_qt5_path"])
return vars(parser.parse_args())
def lipo(path0, path1, dst):
if subprocess.call(["lipo", "-create", "-output", dst, path0, path1]) != 0:
print(f"WARNING: {path0} and {path1} cannot be lipo'd")
shutil.copy(path0, dst)
def recursive_merge_binaries(src0, src1, dst):
"""
Merges two build trees together for different architectures into a single
universal binary.
The rules for merging are:
1) Files that exist in either src tree are copied into the dst tree
2) Files that exist in both trees and are identical are copied over
unmodified
3) Files that exist in both trees and are non-identical are lipo'd
4) Symlinks are created in the destination tree to mirror the hierarchy in
the source trees
"""
# Check that all files present in the folder are of the same type and that
# links link to the same relative location
for newpath0 in glob.glob(src0+"/*"):
filename = os.path.basename(newpath0)
newpath1 = os.path.join(src1, filename)
if not os.path.exists(newpath1):
continue
if os.path.islink(newpath0) and os.path.islink(newpath1):
if os.path.relpath(newpath0, src0) == os.path.relpath(newpath1, src1):
continue
if os.path.isdir(newpath0) and os.path.isdir(newpath1):
continue
# isfile() can be true for links so check that both are not links
# before checking if they are both files
if (not os.path.islink(newpath0)) and (not os.path.islink(newpath1)):
if os.path.isfile(newpath0) and os.path.isfile(newpath1):
continue
raise Exception(f"{newpath0} and {newpath1} cannot be " +
"merged into a universal binary because they are of " +
"incompatible types. Perhaps the installed libraries" +
" are from different versions for each architecture")
for newpath0 in glob.glob(src0+"/*"):
filename = os.path.basename(newpath0)
newpath1 = os.path.join(src1, filename)
new_dst_path = os.path.join(dst, filename)
if os.path.islink(newpath0):
# Symlinks will be fixed after files are resolved
continue
if not os.path.exists(newpath1):
if os.path.isdir(newpath0):
shutil.copytree(newpath0, new_dst_path)
else:
shutil.copy(newpath0, new_dst_path)
continue
if os.path.isdir(newpath1):
os.mkdir(new_dst_path)
recursive_merge_binaries(newpath0, newpath1, new_dst_path)
continue
if filecmp.cmp(newpath0, newpath1):
shutil.copy(newpath0, new_dst_path)
else:
lipo(newpath0, newpath1, new_dst_path)
# Loop over files in src1 and copy missing things over to dst
for newpath1 in glob.glob(src1+"/*"):
filename = os.path.basename(newpath1)
newpath0 = os.path.join(src0, filename)
new_dst_path = os.path.join(dst, filename)
if (not os.path.exists(newpath0)) and (not os.path.islink(newpath1)):
if os.path.isdir(newpath1):
shutil.copytree(newpath1, new_dst_path)
else:
shutil.copy(newpath1, new_dst_path)
# Fix up symlinks for path0
for newpath0 in glob.glob(src0+"/*"):
filename = os.path.basename(newpath0)
new_dst_path = os.path.join(dst, filename)
if os.path.islink(newpath0):
relative_path = os.path.relpath(os.path.realpath(newpath0), src0)
os.symlink(relative_path, new_dst_path)
# Fix up symlinks for path1
for newpath1 in glob.glob(src1+"/*"):
filename = os.path.basename(newpath1)
new_dst_path = os.path.join(dst, filename)
newpath0 = os.path.join(src0, filename)
if os.path.islink(newpath1) and not os.path.exists(newpath0):
relative_path = os.path.relpath(os.path.realpath(newpath1), src1)
os.symlink(relative_path, new_dst_path)
def python_to_cmake_bool(boolean):
return "ON" if boolean else "OFF"
def build(config):
"""
Builds the project with the parameters specified in config.
"""
print("Building config:")
print(json.dumps(config, indent=4))
# Configure and build single architecture builds for each architecture
for arch in ARCHITECTURES:
if not os.path.exists(arch):
os.mkdir(arch)
# Place Qt on the prefix path.
prefix_path = config[arch+"_qt5_path"]+';'+config[arch+"_cmake_prefix"]
env = os.environ.copy()
env["CMAKE_OSX_ARCHITECTURES"] = arch
env["CMAKE_PREFIX_PATH"] = prefix_path
# Add the other architecture's prefix path to the ignore path so that
# CMake doesn't try to pick up the wrong architecture's libraries when
# cross compiling.
ignore_path = ""
for a in ARCHITECTURES:
if a != arch:
ignore_path = config[a+"_cmake_prefix"]
subprocess.check_call([
"cmake", "../../", "-G", config["generator"],
"-DCMAKE_BUILD_TYPE=" + config["build_type"],
'-DCMAKE_CXX_FLAGS="-DMACOS_UNIVERSAL_BUILD=1"',
'-DCMAKE_C_FLAGS="-DMACOS_UNIVERSAL_BUILD=1"',
# System name needs to be specified for CMake to use
# the specified CMAKE_SYSTEM_PROCESSOR
"-DCMAKE_SYSTEM_NAME=Darwin",
"-DCMAKE_PREFIX_PATH="+prefix_path,
"-DCMAKE_SYSTEM_PROCESSOR="+arch,
"-DCMAKE_IGNORE_PATH="+ignore_path,
"-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0.0",
"-DMACOS_CODE_SIGNING_IDENTITY="
+ config["codesign_identity"],
'-DMACOS_CODE_SIGNING="ON"',
"-DENABLE_AUTOUPDATE="
+ python_to_cmake_bool(config["autoupdate"]),
'-DDISTRIBUTOR=' + config['distributor'],
# Always use libraries from Externals to prevent any libraries
# installed by Homebrew from leaking in to the app
"-DUSE_SYSTEM_LIBS=OFF",
# However, we should still use the macOS provided versions of
# iconv, bzip2, and curl
"-DUSE_SYSTEM_ICONV=ON",
"-DUSE_SYSTEM_BZIP2=ON",
"-DUSE_SYSTEM_CURL=ON"
],
env=env, cwd=arch)
threads = multiprocessing.cpu_count()
subprocess.check_call(["cmake", "--build", ".",
"--config", config["build_type"],
"--parallel", f"{threads}"], cwd=arch)
dst_app = config["dst_app"]
if os.path.exists(dst_app):
shutil.rmtree(dst_app)
# Create and codesign the universal binary/
os.mkdir(dst_app)
# Source binary trees to merge together
src_app0 = ARCHITECTURES[0]+"/Binaries/"
src_app1 = ARCHITECTURES[1]+"/Binaries/"
recursive_merge_binaries(src_app0, src_app1, dst_app)
if config["autoupdate"]:
subprocess.check_call([
"../Tools/mac-codesign.sh",
"-t",
"-e", "preserve",
config["codesign_identity"],
dst_app+"/Dolphin.app/Contents/Helpers/Dolphin Updater.app"])
subprocess.check_call([
"../Tools/mac-codesign.sh",
"-t",
"-e", "preserve",
config["codesign_identity"],
dst_app+"/Dolphin.app"])
print("Built Universal Binary successfully!")
# Build and run unit tests for each architecture
unit_test_results = {}
if config["run_unit_tests"]:
for arch in ARCHITECTURES:
if not os.path.exists(arch):
os.mkdir(arch)
print(f"Building and running unit tests for: {arch}")
unit_test_results[arch] = \
subprocess.call(["cmake", "--build", ".",
"--config", config["build_type"],
"--target", "unittests",
"--parallel", f"{threads}"], cwd=arch)
passed_unit_tests = True
for a in unit_test_results:
code = unit_test_results[a]
passed = code == 0
status_string = "PASSED"
if not passed:
passed_unit_tests = False
status_string = f"FAILED ({code})"
print(a + " Unit Tests: " + status_string)
if not passed_unit_tests:
exit(-1)
print("Passed all unit tests")
if __name__ == "__main__":
conf = parse_args()
build(conf)

View File

@ -1,17 +0,0 @@
find_program(CCACHE_BIN NAMES ccache sccache)
if(CCACHE_BIN)
# Official ccache recommendation is to set CMAKE_C(XX)_COMPILER_LAUNCHER
if (NOT CMAKE_C_COMPILER_LAUNCHER MATCHES "ccache")
list(INSERT CMAKE_C_COMPILER_LAUNCHER 0 "${CCACHE_BIN}")
endif()
if (NOT CMAKE_CXX_COMPILER_LAUNCHER MATCHES "ccache")
list(INSERT CMAKE_CXX_COMPILER_LAUNCHER 0 "${CCACHE_BIN}")
endif()
# ccache uses -I when compiling without preprocessor, which makes clang complain.
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qunused-arguments -fcolor-diagnostics")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -fcolor-diagnostics")
endif()
endif()

View File

@ -1,58 +0,0 @@
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 "NO_DEBINFO_ONLY")
set(genexp_config_test "$<NOT:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>>")
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()

View File

@ -1,58 +0,0 @@
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()

View File

@ -1,34 +0,0 @@
# 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()

View File

@ -1,20 +0,0 @@
include(RemoveCompileFlag)
macro(dolphin_disable_warnings _target)
get_target_property(_target_cxx_flags ${_target} COMPILE_OPTIONS)
if (_target_cxx_flags)
set(new_flags "")
foreach(flag IN LISTS _target_cxx_flags)
# all warning flags start with "/W" or "/w" or "-W" or "-w"
if (NOT "${flag}" MATCHES "^[-/][Ww]")
list(APPEND new_flags "${flag}")
endif()
endforeach()
set_target_properties(${_target} PROPERTIES COMPILE_OPTIONS "${new_flags}")
endif()
if (MSVC)
target_compile_options(${_target} PRIVATE "/W0")
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
target_compile_options(${_target} PRIVATE "-w")
endif()
endmacro()

View File

@ -1,24 +0,0 @@
function(dolphin_inject_version_info target)
set(INFO_PLIST_PATH "$<TARGET_BUNDLE_DIR:${target}>/Contents/Info.plist")
add_custom_command(TARGET ${target}
POST_BUILD
COMMAND /usr/libexec/PlistBuddy -c
"Delete :CFBundleShortVersionString"
"${INFO_PLIST_PATH}"
|| true
COMMAND /usr/libexec/PlistBuddy -c
"Delete :CFBundleLongVersionString"
"${INFO_PLIST_PATH}"
|| true
COMMAND /usr/libexec/PlistBuddy -c
"Delete :CFBundleVersion"
"${INFO_PLIST_PATH}"
|| true
COMMAND /usr/libexec/PlistBuddy -c
"Merge '${CMAKE_BINARY_DIR}/Source/Core/VersionInfo.plist'"
"${INFO_PLIST_PATH}")
endfunction()

View File

@ -1,94 +0,0 @@
# like add_library(new ALIAS old) but avoids add_library cannot create ALIAS target "new" because target "old" is imported but not globally visible. on older cmake
# This can be replaced with a direct alias call once our minimum is cmake 3.18
function(dolphin_alias_library new old)
string(REPLACE "::" "" library_no_namespace ${old})
if (NOT TARGET _alias_${library_no_namespace})
add_library(_alias_${library_no_namespace} INTERFACE)
target_link_libraries(_alias_${library_no_namespace} INTERFACE ${old})
endif()
add_library(${new} ALIAS _alias_${library_no_namespace})
endfunction()
# Makes an imported target if it doesn't exist. Useful for when find scripts from older versions of cmake don't make the targets you need
function(dolphin_make_imported_target_if_missing target lib)
if(${lib}_FOUND AND NOT TARGET ${target})
add_library(_${lib} INTERFACE)
target_link_libraries(_${lib} INTERFACE "${${lib}_LIBRARIES}")
target_include_directories(_${lib} INTERFACE "${${lib}_INCLUDE_DIRS}")
add_library(${target} ALIAS _${lib})
endif()
endfunction()
function(dolphin_optional_system_library out_use_system library)
string(TOUPPER ${library} upperlib)
set(USE_SYSTEM_${upperlib} "" CACHE STRING "Use system ${library} instead of bundled. ON - Always use system and fail if unavailable, OFF - Always use bundled, AUTO - Use system if available, otherwise use bundled, blank - Delegate to USE_SYSTEM_LIBS. Default is blank.")
if("${USE_SYSTEM_${upperlib}}" STREQUAL "")
if(APPROVED_VENDORED_DEPENDENCIES)
string(TOLOWER ${library} lowerlib)
if(lowerlib IN_LIST APPROVED_VENDORED_DEPENDENCIES)
set(${out_use_system} AUTO PARENT_SCOPE)
else()
set(${out_use_system} ON PARENT_SCOPE)
endif()
else()
set(${out_use_system} ${USE_SYSTEM_LIBS} PARENT_SCOPE)
endif()
else()
set(${out_use_system} ${USE_SYSTEM_${upperlib}} PARENT_SCOPE)
endif()
endfunction()
function(dolphin_add_bundled_library library use_system bundled_path)
if (${use_system} STREQUAL "AUTO")
message(STATUS "No system ${library} was found. Using static ${library} from Externals.")
else()
message(STATUS "Using static ${library} from Externals")
endif()
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${bundled_path}/CMakeLists.txt")
message(FATAL_ERROR "No bundled ${library} was found. Did you forget to checkout submodules?")
endif()
add_subdirectory(${bundled_path} EXCLUDE_FROM_ALL)
endfunction()
function(dolphin_find_optional_system_library library bundled_path)
dolphin_optional_system_library(use_system ${library})
string(TOUPPER ${library} upperlib)
if(use_system)
find_package(${library} ${ARGN})
# Yay for cmake packages being inconsistent
if(DEFINED ${library}_FOUND)
set(prefix ${library})
else()
set(prefix ${upperlib})
endif()
if((NOT ${prefix}_FOUND) AND (NOT ${use_system} STREQUAL "AUTO"))
message(FATAL_ERROR "No system ${library} was found. Please install it or set USE_SYSTEM_${upperlib} to AUTO or OFF.")
endif()
endif()
if(${prefix}_FOUND)
message(STATUS "Using system ${library}")
set(${prefix}_TYPE "System" PARENT_SCOPE)
else()
dolphin_add_bundled_library(${library} ${use_system} ${bundled_path})
set(${prefix}_TYPE "Bundled" PARENT_SCOPE)
endif()
endfunction()
function(dolphin_find_optional_system_library_pkgconfig library search alias bundled_path)
dolphin_optional_system_library(use_system ${library})
string(TOUPPER ${library} upperlib)
if(use_system)
pkg_search_module(${library} ${search} ${ARGN} IMPORTED_TARGET)
if((NOT ${library}_FOUND) AND (NOT ${use_system} STREQUAL "AUTO"))
message(FATAL_ERROR "No system ${library} was found. Please install it or set USE_SYSTEM_${upperlib} to AUTO or OFF.")
endif()
endif()
if(${library}_FOUND)
message(STATUS "Using system ${library}")
dolphin_alias_library(${alias} PkgConfig::${library})
set(${library}_TYPE "System" PARENT_SCOPE)
else()
dolphin_add_bundled_library(${library} ${use_system} ${bundled_path})
set(${library}_TYPE "Bundled" PARENT_SCOPE)
endif()
endfunction()

View File

@ -1,45 +0,0 @@
# This module can be used in two different ways.
#
# When invoked as `cmake -P DolphinPostprocessBundle.cmake`, it fixes up an
# application folder to be standalone. It bundles all required libraries from
# the system and fixes up library IDs. Any additional shared libraries, like
# plugins, that are found under Contents/MacOS/ will be made standalone as well.
#
# When called with `include(DolphinPostprocessBundle)`, it defines a helper
# function `dolphin_postprocess_bundle` that sets up the command form of the
# module as a post-build step.
if(CMAKE_GENERATOR)
# Being called as include(DolphinPostprocessBundle), so define a helper function.
set(_DOLPHIN_POSTPROCESS_BUNDLE_MODULE_LOCATION "${CMAKE_CURRENT_LIST_FILE}")
function(dolphin_postprocess_bundle target)
add_custom_command(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} "-D" "DOLPHIN_BUNDLE_PATH=$<TARGET_BUNDLE_DIR:${target}>"
-P "${_DOLPHIN_POSTPROCESS_BUNDLE_MODULE_LOCATION}"
)
endfunction()
return()
endif()
message(STATUS "Fixing up application bundle: ${DOLPHIN_BUNDLE_PATH}")
# Make sure to fix up any additional shared libraries (like plugins) that are
# needed.
file(GLOB_RECURSE extra_libs "${DOLPHIN_BUNDLE_PATH}/Contents/MacOS/*.dylib")
# BundleUtilities doesn't support DYLD_FALLBACK_LIBRARY_PATH behavior, which
# makes it sometimes break on libraries that do weird things with @rpath. Specify
# equivalent search directories until https://gitlab.kitware.com/cmake/cmake/issues/16625
# is fixed and in our minimum CMake version.
set(extra_dirs "/usr/local/lib" "/lib" "/usr/lib")
# BundleUtilities is overly verbose, so disable most of its messages
function(message)
if(NOT ARGV MATCHES "^STATUS;")
_message(${ARGV})
endif()
endfunction()
include(BundleUtilities)
set(BU_CHMOD_BUNDLE_ITEMS ON)
fixup_bundle("${DOLPHIN_BUNDLE_PATH}" "${extra_libs}" "${extra_dirs}")

View File

@ -1,59 +0,0 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# FindALSA
# --------
#
# Find alsa
#
# Find the alsa libraries (asound)
#
# ::
#
# This module defines the following variables:
# ALSA_FOUND - True if ALSA_INCLUDE_DIR & ALSA_LIBRARY are found
# ALSA_LIBRARIES - Set when ALSA_LIBRARY is found
# ALSA_INCLUDE_DIRS - Set when ALSA_INCLUDE_DIR is found
#
#
#
# ::
#
# ALSA_INCLUDE_DIR - where to find asoundlib.h, etc.
# ALSA_LIBRARY - the asound library
# ALSA_VERSION_STRING - the version of alsa found (since CMake 2.8.8)
find_path(ALSA_INCLUDE_DIR NAMES alsa/asoundlib.h
DOC "The ALSA (asound) include directory"
)
find_library(ALSA_LIBRARY NAMES asound
DOC "The ALSA (asound) library"
)
if(ALSA_INCLUDE_DIR AND EXISTS "${ALSA_INCLUDE_DIR}/alsa/version.h")
file(STRINGS "${ALSA_INCLUDE_DIR}/alsa/version.h" alsa_version_str REGEX "^#define[\t ]+SND_LIB_VERSION_STR[\t ]+\".*\"")
string(REGEX REPLACE "^.*SND_LIB_VERSION_STR[\t ]+\"([^\"]*)\".*$" "\\1" ALSA_VERSION_STRING "${alsa_version_str}")
unset(alsa_version_str)
endif()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALSA
REQUIRED_VARS ALSA_LIBRARY ALSA_INCLUDE_DIR
VERSION_VAR ALSA_VERSION_STRING)
if(ALSA_FOUND)
set( ALSA_LIBRARIES ${ALSA_LIBRARY} )
set( ALSA_INCLUDE_DIRS ${ALSA_INCLUDE_DIR} )
if(NOT TARGET ALSA::ALSA)
add_library(ALSA::ALSA UNKNOWN IMPORTED)
set_target_properties(ALSA::ALSA PROPERTIES
IMPORTED_LOCATION ${ALSA_LIBRARY}
INTERFACE_INCLUDE_DIRECTORIES ${ALSA_INCLUDE_DIR}
)
endif()
endif()
mark_as_advanced(ALSA_INCLUDE_DIR ALSA_LIBRARY)

View File

@ -1,122 +0,0 @@
#.rst:
# FindBacktrace
# -------------
#
# Find provider for backtrace(3).
#
# Checks if OS supports backtrace(3) via either libc or custom library.
# This module defines the following variables:
#
# ``Backtrace_HEADER``
# The header file needed for backtrace(3). Cached.
# Could be forcibly set by user.
# ``Backtrace_INCLUDE_DIRS``
# The include directories needed to use backtrace(3) header.
# ``Backtrace_LIBRARIES``
# The libraries (linker flags) needed to use backtrace(3), if any.
# ``Backtrace_FOUND``
# Is set if and only if backtrace(3) support detected.
#
# The following cache variables are also available to set or use:
#
# ``Backtrace_LIBRARY``
# The external library providing backtrace, if any.
# ``Backtrace_INCLUDE_DIR``
# The directory holding the backtrace(3) header.
#
# Typical usage is to generate of header file using configure_file() with the
# contents like the following::
#
# #cmakedefine01 Backtrace_FOUND
# #if Backtrace_FOUND
# # include <${Backtrace_HEADER}>
# #endif
#
# And then reference that generated header file in actual source.
#=============================================================================
# Copyright 2013 Vadim Zhukov
# Copyright 2000-2016 Kitware, Inc.
# Copyright 2000-2011 Insight Software Consortium
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the names of Kitware, Inc., the Insight Software Consortium,
# nor the names of their contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
include(CMakePushCheckState)
include(CheckSymbolExists)
include(FindPackageHandleStandardArgs)
# List of variables to be provided to find_package_handle_standard_args()
set(_Backtrace_STD_ARGS Backtrace_INCLUDE_DIR)
if(Backtrace_HEADER)
set(_Backtrace_HEADER_TRY "${Backtrace_HEADER}")
else(Backtrace_HEADER)
set(_Backtrace_HEADER_TRY "execinfo.h")
endif(Backtrace_HEADER)
find_path(Backtrace_INCLUDE_DIR "${_Backtrace_HEADER_TRY}")
set(Backtrace_INCLUDE_DIRS ${Backtrace_INCLUDE_DIR})
if (NOT DEFINED Backtrace_LIBRARY)
# First, check if we already have backtrace(), e.g., in libc
cmake_push_check_state(RESET)
set(CMAKE_REQUIRED_INCLUDES ${Backtrace_INCLUDE_DIRS})
set(CMAKE_REQUIRED_QUIET ${Backtrace_FIND_QUIETLY})
check_symbol_exists("backtrace" "${_Backtrace_HEADER_TRY}" _Backtrace_SYM_FOUND)
cmake_pop_check_state()
endif()
if(_Backtrace_SYM_FOUND)
# Avoid repeating the message() call below each time CMake is run.
if(NOT Backtrace_FIND_QUIETLY AND NOT DEFINED Backtrace_LIBRARY)
message(STATUS "backtrace facility detected in default set of libraries")
endif()
set(Backtrace_LIBRARY "" CACHE FILEPATH "Library providing backtrace(3), empty for default set of libraries")
else()
# Check for external library, for non-glibc systems
if(Backtrace_INCLUDE_DIR)
# OpenBSD has libbacktrace renamed to libexecinfo
find_library(Backtrace_LIBRARY "execinfo")
elseif() # respect user wishes
set(_Backtrace_HEADER_TRY "backtrace.h")
find_path(Backtrace_INCLUDE_DIR ${_Backtrace_HEADER_TRY})
find_library(Backtrace_LIBRARY "backtrace")
endif()
# Prepend list with library path as it's more common practice
set(_Backtrace_STD_ARGS Backtrace_LIBRARY ${_Backtrace_STD_ARGS})
endif()
set(Backtrace_LIBRARIES ${Backtrace_LIBRARY})
set(Backtrace_HEADER "${_Backtrace_HEADER_TRY}" CACHE STRING "Header providing backtrace(3) facility")
find_package_handle_standard_args(Backtrace FOUND_VAR Backtrace_FOUND REQUIRED_VARS ${_Backtrace_STD_ARGS})
mark_as_advanced(Backtrace_HEADER Backtrace_INCLUDE_DIR Backtrace_LIBRARY)

View File

@ -1,42 +0,0 @@
# - Find BlueZ library
# This module defines
# BlueZ_INCLUDE_DIR
# BlueZ_LIBRARIES
# BlueZ_FOUND
#
# vim: expandtab sw=4 ts=4 sts=4:
find_package(PkgConfig QUIET)
pkg_check_modules (BlueZ_PKG QUIET bluez)
find_path(BlueZ_INCLUDE_DIR NAMES bluetooth/bluetooth.h
PATHS
${BlueZ_PKG_INCLUDE_DIRS}
/usr/include/bluetooth
/usr/include
/usr/local/include/bluetooth
/usr/local/include
)
find_library(BlueZ_LIBRARIES NAMES bluetooth
PATHS
${BlueZ_PKG_LIBRARY_DIRS}
/usr/lib
/usr/local/lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(BlueZ
REQUIRED_VARS BlueZ_LIBRARIES BlueZ_INCLUDE_DIR)
if(BlueZ_FOUND)
if(NOT TARGET BlueZ::BlueZ)
add_library(BlueZ::BlueZ UNKNOWN IMPORTED)
set_target_properties(BlueZ::BlueZ PROPERTIES
IMPORTED_LOCATION ${BlueZ_LIBRARIES}
INTERFACE_INCLUDE_DIRECTORIES ${BlueZ_INCLUDE_DIR}
)
endif()
endif()
mark_as_advanced(BlueZ_INCLUDE_DIR BlueZ_LIBRARIES)

View File

@ -1,15 +0,0 @@
find_path(CUBEB_INCLUDE_DIR cubeb.h PATH_SUFFIXES cubeb)
find_library(CUBEB_LIBRARY cubeb)
mark_as_advanced(CUBEB_INCLUDE_DIR CUBEB_LIBRARY)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CUBEB DEFAULT_MSG
CUBEB_INCLUDE_DIR CUBEB_LIBRARY)
if(CUBEB_FOUND AND NOT TARGET cubeb::cubeb)
add_library(cubeb::cubeb UNKNOWN IMPORTED)
set_target_properties(cubeb::cubeb PROPERTIES
IMPORTED_LOCATION "${CUBEB_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${CUBEB_INCLUDE_DIR}"
)
endif()

View File

@ -1,54 +0,0 @@
# from https://raw.githubusercontent.com/WebKit/webkit/master/Source/cmake/FindEGL.cmake
# - Try to Find EGL
# Once done, this will define
#
# EGL_FOUND - system has EGL installed.
# EGL_INCLUDE_DIRS - directories which contain the EGL headers.
# EGL_LIBRARIES - libraries required to link against EGL.
# EGL_DEFINITIONS - Compiler switches required for using EGL.
#
# Copyright (C) 2012 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
find_package(PkgConfig)
pkg_check_modules(PC_EGL egl)
if (PC_EGL_FOUND)
set(EGL_DEFINITIONS ${PC_EGL_CFLAGS_OTHER})
endif ()
find_path(EGL_INCLUDE_DIRS NAMES EGL/egl.h
HINTS ${PC_EGL_INCLUDEDIR} ${PC_EGL_INCLUDE_DIRS}
)
set(EGL_NAMES ${EGL_NAMES} egl EGL)
find_library(EGL_LIBRARIES NAMES ${EGL_NAMES}
HINTS ${PC_EGL_LIBDIR} ${PC_EGL_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(EGL DEFAULT_MSG EGL_INCLUDE_DIRS EGL_LIBRARIES)
mark_as_advanced(EGL_INCLUDE_DIRS EGL_LIBRARIES)

View File

@ -1,165 +0,0 @@
# FindFFmpeg
# ----------
#
# Find the native FFmpeg includes and libraries
#
# This module defines the following variables:
#
# FFmpeg_INCLUDE_<component>: where to find <component>.h
# FFmpeg_LIBRARY_<component>: where to find the <component> library
# FFmpeg_INCLUDES: aggregate all the include paths
# FFmpeg_LIBRARIES: aggregate all the paths to the libraries
# FFmpeg_FOUND: True if all components have been found
#
# This module defines the following targets, which are preferred over variables:
#
# FFmpeg::<component>: Target to use <component> directly, with include path,
# library and dependencies set up. If you are using a static build, you are
# responsible for adding any external dependencies (such as zlib, bzlib...).
#
# <component> can be one of:
# avcodec
# avdevice
# avfilter
# avformat
# postproc
# swresample
# swscale
#
set(_FFmpeg_ALL_COMPONENTS
avcodec
avdevice
avfilter
avformat
avutil
postproc
swresample
swscale
)
set(_FFmpeg_DEPS_avcodec avutil)
set(_FFmpeg_DEPS_avdevice avcodec avformat avutil)
set(_FFmpeg_DEPS_avfilter avutil)
set(_FFmpeg_DEPS_avformat avcodec avutil)
set(_FFmpeg_DEPS_postproc avutil)
set(_FFmpeg_DEPS_swresample avutil)
set(_FFmpeg_DEPS_swscale avutil)
function(find_ffmpeg LIBNAME)
if(DEFINED ENV{FFMPEG_DIR})
set(FFMPEG_DIR $ENV{FFMPEG_DIR})
endif()
if(FFMPEG_DIR)
list(APPEND INCLUDE_PATHS
${FFMPEG_DIR}
${FFMPEG_DIR}/ffmpeg
${FFMPEG_DIR}/lib${LIBNAME}
${FFMPEG_DIR}/include/lib${LIBNAME}
${FFMPEG_DIR}/include/ffmpeg
${FFMPEG_DIR}/include
NO_DEFAULT_PATH
NO_CMAKE_FIND_ROOT_PATH
)
list(APPEND LIB_PATHS
${FFMPEG_DIR}
${FFMPEG_DIR}/lib
${FFMPEG_DIR}/lib${LIBNAME}
NO_DEFAULT_PATH
NO_CMAKE_FIND_ROOT_PATH
)
else()
list(APPEND INCLUDE_PATHS
/usr/local/include/ffmpeg
/usr/local/include/lib${LIBNAME}
/usr/include/ffmpeg
/usr/include/lib${LIBNAME}
/usr/include/ffmpeg/lib${LIBNAME}
)
list(APPEND LIB_PATHS
/usr/local/lib
/usr/lib
)
endif()
find_path(FFmpeg_INCLUDE_${LIBNAME} lib${LIBNAME}/${LIBNAME}.h
HINTS ${INCLUDE_PATHS}
)
find_library(FFmpeg_LIBRARY_${LIBNAME} ${LIBNAME}
HINTS ${LIB_PATHS}
)
if(NOT FFMPEG_DIR AND (NOT FFmpeg_LIBRARY_${LIBNAME} OR NOT FFmpeg_INCLUDE_${LIBNAME}))
# Didn't find it in the usual paths, try pkg-config
find_package(PkgConfig QUIET)
pkg_check_modules(FFmpeg_PKGCONFIG_${LIBNAME} QUIET lib${LIBNAME})
find_path(FFmpeg_INCLUDE_${LIBNAME} lib${LIBNAME}/${LIBNAME}.h
${FFmpeg_PKGCONFIG_${LIBNAME}_INCLUDE_DIRS}
)
find_library(FFmpeg_LIBRARY_${LIBNAME} ${LIBNAME}
${FFmpeg_PKGCONFIG_${LIBNAME}_LIBRARY_DIRS}
)
endif()
if(FFmpeg_INCLUDE_${LIBNAME} AND FFmpeg_LIBRARY_${LIBNAME})
set(FFmpeg_INCLUDE_${LIBNAME} "${FFmpeg_INCLUDE_${LIBNAME}}" PARENT_SCOPE)
set(FFmpeg_LIBRARY_${LIBNAME} "${FFmpeg_LIBRARY_${LIBNAME}}" PARENT_SCOPE)
set(FFmpeg_${c}_FOUND TRUE PARENT_SCOPE)
if(NOT FFmpeg_FIND_QUIETLY)
message("-- Found ${LIBNAME}: ${FFmpeg_INCLUDE_${LIBNAME}} ${FFmpeg_LIBRARY_${LIBNAME}}")
endif()
endif()
endfunction()
foreach(c ${_FFmpeg_ALL_COMPONENTS})
find_ffmpeg(${c})
endforeach()
foreach(c ${_FFmpeg_ALL_COMPONENTS})
if(FFmpeg_${c}_FOUND)
list(APPEND FFmpeg_INCLUDES ${FFmpeg_INCLUDE_${c}})
list(APPEND FFmpeg_LIBRARIES ${FFmpeg_LIBRARY_${c}})
add_library(FFmpeg::${c} IMPORTED UNKNOWN)
set_target_properties(FFmpeg::${c} PROPERTIES
IMPORTED_LOCATION ${FFmpeg_LIBRARY_${c}}
INTERFACE_INCLUDE_DIRECTORIES ${FFmpeg_INCLUDE_${c}}
)
if(_FFmpeg_DEPS_${c})
set(deps)
foreach(dep ${_FFmpeg_DEPS_${c}})
list(APPEND deps FFmpeg::${dep})
endforeach()
set_target_properties(FFmpeg::${c} PROPERTIES
INTERFACE_LINK_LIBRARIES "${deps}"
)
unset(deps)
endif()
endif()
endforeach()
if(FFmpeg_INCLUDES)
list(REMOVE_DUPLICATES FFmpeg_INCLUDES)
endif()
foreach(c ${FFmpeg_FIND_COMPONENTS})
list(APPEND _FFmpeg_REQUIRED_VARS FFmpeg_INCLUDE_${c} FFmpeg_LIBRARY_${c})
endforeach()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(FFmpeg
REQUIRED_VARS ${_FFmpeg_REQUIRED_VARS}
HANDLE_COMPONENTS
)
foreach(c ${_FFmpeg_ALL_COMPONENTS})
unset(_FFmpeg_DEPS_${c})
endforeach()
unset(_FFmpeg_ALL_COMPONENTS)
unset(_FFmpeg_REQUIRED_VARS)

View File

@ -1,17 +0,0 @@
find_path(HIDAPI_INCLUDE_DIR NAMES hidapi.h PATH_SUFFIXES hidapi)
find_library(HIDAPI_LIBRARY NAMES hidapi hidapi-hidraw hidapi-libusb)
set(HIDAPI_LIBRARIES ${HIDAPI_LIBRARY})
set(HIDAPI_INCLUDE_DIRS ${HIDAPI_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(HIDAPI DEFAULT_MSG HIDAPI_LIBRARY HIDAPI_INCLUDE_DIR)
if(HIDAPI_FOUND AND NOT TARGET Hidapi::Hidapi)
add_library(Hidapi::Hidapi UNKNOWN IMPORTED)
set_target_properties(Hidapi::Hidapi PROPERTIES
IMPORTED_LOCATION ${HIDAPI_LIBRARIES}
INTERFACE_INCLUDE_DIRECTORIES ${HIDAPI_INCLUDE_DIRS}
)
endif()
mark_as_advanced(HIDAPI_INCLUDE_DIR HIDAPI_LIBRARY)

View File

@ -1,101 +0,0 @@
# Based on CMake's FindIconv.cmake
# Modified to prefer non-built-in iconv over the built-in one
# See https://gitlab.kitware.com/cmake/cmake/-/issues/24695 for details
# This file can be deleted once that issue has been closed and the fix has
# made it into a satisfactory number of cmake versions. FreeBSD is the only
# system known to hit this so far, so "satisfactory" can probably be defined
# as "enough that most FreeBSD users have a fixed cmake".
find_path(Iconv_INCLUDE_DIR
NAMES "iconv.h"
DOC "iconv include directory")
mark_as_advanced(Iconv_INCLUDE_DIR)
find_library(Iconv_LIBRARY
NAMES iconv libiconv
NAMES_PER_DIR
DOC "iconv library (if not in the C library)")
mark_as_advanced(Iconv_LIBRARY)
# iconv can only be provided in libc on a POSIX system.
if(UNIX AND (NOT Iconv_INCLUDE_DIR OR NOT Iconv_LIBRARY))
include(CMakePushCheckState)
include(CheckCXXSourceCompiles)
cmake_push_check_state(RESET)
# We always suppress the message here: Otherwise on supported systems
# not having iconv in their C library (e.g. those using libiconv)
# would always display a confusing "Looking for iconv - not found" message
set(CMAKE_FIND_QUIETLY TRUE)
# The following code will not work, but it's sufficient to see if it compiles.
# Note: libiconv will define the iconv functions as macros, so CheckSymbolExists
# will not yield correct results.
set(Iconv_IMPLICIT_TEST_CODE
"
#include <stddef.h>
#include <iconv.h>
int main() {
char *a, *b;
size_t i, j;
iconv_t ic;
ic = iconv_open(\"to\", \"from\");
iconv(ic, &a, &i, &b, &j);
iconv_close(ic);
}
"
)
check_cxx_source_compiles("${Iconv_IMPLICIT_TEST_CODE}" Iconv_IS_BUILT_IN)
cmake_pop_check_state()
if(Iconv_IS_BUILT_IN)
unset(Iconv_INCLUDE_DIR)
unset(Iconv_LIBRARY)
endif()
else()
set(Iconv_IS_BUILT_IN FALSE)
endif()
set(_Iconv_REQUIRED_VARS)
if(Iconv_IS_BUILT_IN)
set(_Iconv_REQUIRED_VARS _Iconv_IS_BUILT_IN_MSG)
set(_Iconv_IS_BUILT_IN_MSG "built in to C library")
else()
set(_Iconv_REQUIRED_VARS Iconv_LIBRARY Iconv_INCLUDE_DIR)
endif()
# NOTE: glibc's iconv.h does not define _LIBICONV_VERSION
if(Iconv_INCLUDE_DIR AND EXISTS "${Iconv_INCLUDE_DIR}/iconv.h")
file(STRINGS ${Iconv_INCLUDE_DIR}/iconv.h Iconv_VERSION_DEFINE REGEX "_LIBICONV_VERSION (.*)")
if(Iconv_VERSION_DEFINE MATCHES "(0x[A-Fa-f0-9]+)")
set(Iconv_VERSION_NUMBER "${CMAKE_MATCH_1}")
# encoding -> version number: (major<<8) + minor
math(EXPR Iconv_VERSION_MAJOR "${Iconv_VERSION_NUMBER} >> 8" OUTPUT_FORMAT HEXADECIMAL)
math(EXPR Iconv_VERSION_MINOR "${Iconv_VERSION_NUMBER} - (${Iconv_VERSION_MAJOR} << 8)" OUTPUT_FORMAT HEXADECIMAL)
math(EXPR Iconv_VERSION_MAJOR "${Iconv_VERSION_MAJOR}" OUTPUT_FORMAT DECIMAL)
math(EXPR Iconv_VERSION_MINOR "${Iconv_VERSION_MINOR}" OUTPUT_FORMAT DECIMAL)
set(Iconv_VERSION "${Iconv_VERSION_MAJOR}.${Iconv_VERSION_MINOR}")
endif()
unset(Iconv_VERSION_DEFINE)
unset(Iconv_VERSION_NUMBER)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Iconv
REQUIRED_VARS ${_Iconv_REQUIRED_VARS}
VERSION_VAR Iconv_VERSION)
if(Iconv_FOUND)
if(Iconv_IS_BUILT_IN)
set(Iconv_INCLUDE_DIRS "")
set(Iconv_LIBRARIES "")
else()
set(Iconv_INCLUDE_DIRS "${Iconv_INCLUDE_DIR}")
set(Iconv_LIBRARIES "${Iconv_LIBRARY}")
endif()
if(NOT TARGET Iconv::Iconv)
add_library(Iconv::Iconv INTERFACE IMPORTED)
set_property(TARGET Iconv::Iconv PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${Iconv_INCLUDE_DIRS}")
set_property(TARGET Iconv::Iconv PROPERTY INTERFACE_LINK_LIBRARIES "${Iconv_LIBRARIES}")
endif()
endif()

View File

@ -1,33 +0,0 @@
# - Try to find libevdev
# Once done this will define
# LIBEVDEV_FOUND - System has libevdev
# LIBEVDEV_INCLUDE_DIRS - The libevdev include directories
# LIBEVDEV_LIBRARIES - The libraries needed to use libevdev
find_package(PkgConfig)
pkg_check_modules(PC_LIBEVDEV QUIET libevdev)
FIND_PATH(
LIBEVDEV_INCLUDE_DIR libevdev/libevdev.h
HINTS ${PC_LIBEVDEV_INCLUDEDIR} ${PC_LIBEVDEV_INCLUDE_DIRS}
/usr/include
/usr/local/include
${LIBEVDEV_PATH_INCLUDES}
)
FIND_LIBRARY(
LIBEVDEV_LIBRARY
NAMES evdev libevdev
HINTS ${PC_LIBEVDEV_LIBDIR} ${PC_LIBEVDEV_LIBRARY_DIRS}
PATHS ${ADDITIONAL_LIBRARY_PATHS}
${LIBEVDEV_PATH_LIB}
)
set(LIBEVDEV_LIBRARIES ${LIBEVDEV_LIBRARY} )
set(LIBEVDEV_INCLUDE_DIRS ${LIBEVDEV_INCLUDE_DIR} )
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIBEVDEV DEFAULT_MSG
LIBEVDEV_LIBRARY LIBEVDEV_INCLUDE_DIR)
mark_as_advanced(LIBEVDEV_INCLUDE_DIR LIBEVDEV_LIBRARY )

View File

@ -1,15 +0,0 @@
find_path(LIBMGBA_INCLUDE_DIR mgba/flags.h)
find_library(LIBMGBA_LIBRARY mgba)
mark_as_advanced(LIBMGBA_INCLUDE_DIR LIBMGBA_LIBRARY)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIBMGBA DEFAULT_MSG
LIBMGBA_INCLUDE_DIR LIBMGBA_LIBRARY)
if(LIBMGBA_FOUND AND NOT mGBA::mgba)
add_library(mGBA::mgba UNKNOWN IMPORTED)
set_target_properties(mGBA::mgba PROPERTIES
IMPORTED_LOCATION "${LIBMGBA_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${LIBMGBA_INCLUDE_DIR}"
)
endif()

View File

@ -1,15 +0,0 @@
find_path(LZO_INCLUDE_DIR lzo/lzo1x.h)
find_library(LZO_LIBRARY lzo2)
mark_as_advanced(LZO_INCLUDE_DIR LZO_LIBRARY)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LZO DEFAULT_MSG
LZO_INCLUDE_DIR LZO_LIBRARY)
if(LZO_FOUND AND NOT TARGET LZO::LZO)
add_library(LZO::LZO UNKNOWN IMPORTED)
set_target_properties(LZO::LZO PROPERTIES
IMPORTED_LOCATION "${LZO_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${LZO_INCLUDE_DIR}"
)
endif()

View File

@ -1,59 +0,0 @@
find_path(MBEDTLS_INCLUDE_DIR mbedtls/ssl.h PATH_SUFFIXES mbedtls2)
find_library(MBEDTLS_LIBRARY mbedtls PATH_SUFFIXES mbedtls2)
find_library(MBEDX509_LIBRARY mbedx509 PATH_SUFFIXES mbedtls2)
find_library(MBEDCRYPTO_LIBRARY mbedcrypto PATH_SUFFIXES mbedtls2)
set(MBEDTLS_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR})
set(MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARY} ${MBEDX509_LIBRARY} ${MBEDCRYPTO_LIBRARY})
if(NOT MBEDTLS_INCLUDE_DIR STREQUAL "MBEDTLS_INCLUDE_DIR-NOTFOUND")
if(EXISTS ${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h)
file(STRINGS ${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h MBEDTLS_VERSION_STR REGEX "^#define[ \t]+MBEDTLS_VERSION_STRING[\t ].*")
else()
file(STRINGS ${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h MBEDTLS_VERSION_STR REGEX "^#define[ \t]+MBEDTLS_VERSION_STRING[\t ].*")
endif()
string(REGEX REPLACE "^#define[\t ]+MBEDTLS_VERSION_STRING[\t ]+\"([.0-9]+)\".*" "\\1" MBEDTLS_VERSION ${MBEDTLS_VERSION_STR})
endif()
if(NOT MBEDTLS_INCLUDE_DIR STREQUAL "MBEDTLS_INCLUDE_DIR-NOTFOUND" AND MBEDTLS_VERSION VERSION_GREATER_EQUAL 3)
# Once CMake 3.19 is required, we can enable HANDLE_VERSION_RANGE and use that
if(MBEDTLS_FIND_REQUIRED)
set(type FATAL_ERROR)
else()
set(type STATUS)
endif()
if(MBEDTLS_FIND_REQUIRED OR NOT MBEDTLS_FIND_QUIETLY)
message(${type} "Could NOT find MBEDTLS: Found unsuitable version \"${MBEDTLS_VERSION}\", but a 2.x version is required (found ${MBEDTLS_INCLUDE_DIR})")
endif()
set(MBEDTLS_FOUND FALSE)
else()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MBEDTLS
REQUIRED_VARS MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY
VERSION_VAR MBEDTLS_VERSION)
endif()
mark_as_advanced(MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)
if(MBEDTLS_FOUND)
add_library(MbedTLS::mbedcrypto UNKNOWN IMPORTED)
set_target_properties(MbedTLS::mbedcrypto PROPERTIES
IMPORTED_LOCATION "${MBEDCRYPTO_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${MBEDTLS_INCLUDE_DIR}"
)
add_library(MbedTLS::mbedx509 UNKNOWN IMPORTED)
set_target_properties(MbedTLS::mbedx509 PROPERTIES
IMPORTED_LOCATION "${MBEDX509_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${MBEDTLS_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES MbedTLS::mbedcrypto
)
add_library(MbedTLS::mbedtls UNKNOWN IMPORTED)
set_target_properties(MbedTLS::mbedtls PROPERTIES
IMPORTED_LOCATION "${MBEDTLS_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${MBEDTLS_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES MbedTLS::mbedx509
)
endif()

View File

@ -1,30 +0,0 @@
# This file only works for MiniUPnPc 1.7 or later (it requires MINIUPNPC_API_VERSION).
# TODO Find out if any distribution still ships with /usr/include/miniupnpc.h (i.e. not in a separate directory).
find_path(MINIUPNPC_INCLUDE_DIR miniupnpc.h PATH_SUFFIXES miniupnpc)
find_library(MINIUPNPC_LIBRARY miniupnpc)
if(MINIUPNPC_INCLUDE_DIR)
file(STRINGS "${MINIUPNPC_INCLUDE_DIR}/miniupnpc.h" MINIUPNPC_VERSION_STR REGEX "^#define[\t ]+MINIUPNPC_VERSION[\t ]+.*")
if(MINIUPNPC_VERSION_STR)
string(REGEX REPLACE "^#define[\t ]+MINIUPNPC_VERSION[\t ]+\"([.0-9]+)\"" "\\1" MINIUPNPC_VERSION ${MINIUPNPC_VERSION_STR})
endif()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MINIUPNPC
REQUIRED_VARS MINIUPNPC_INCLUDE_DIR MINIUPNPC_LIBRARY
VERSION_VAR MINIUPNPC_VERSION
)
set(MINIUPNPC_LIBRARIES ${MINIUPNPC_LIBRARY})
set(MINIUPNPC_INCLUDE_DIRS ${MINIUPNPC_INCLUDE_DIR})
mark_as_advanced(MINIUPNPC_INCLUDE_DIR MINIUPNPC_LIBRARY MINIUPNPC_API_VERSION_STR)
if (MINIUPNPC_FOUND AND NOT TARGET miniupnpc)
add_library(Miniupnpc::miniupnpc UNKNOWN IMPORTED)
set_target_properties(Miniupnpc::miniupnpc PROPERTIES
IMPORTED_LOCATION ${MINIUPNPC_LIBRARIES}
INTERFACE_INCLUDE_DIRECTORIES ${MINIUPNPC_INCLUDE_DIRS}
)
endif()

View File

@ -1,31 +0,0 @@
# - Try to find OProfile
# Once done this will define
# OPROFILE_FOUND - System has OProfile
# OPROFILE_INCLUDE_DIRS - The OProfile include directories
# OPROFILE_LIBRARIES - The libraries needed to use OProfile
find_path(OPROFILE_INCLUDE_DIR opagent.h)
find_library(OPROFILE_LIBRARY opagent
PATH_SUFFIXES oprofile
)
set(OPROFILE_INCLUDE_DIRS ${OPROFILE_INCLUDE_DIR})
set(OPROFILE_LIBRARIES ${OPROFILE_LIBRARY})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OProfile DEFAULT_MSG
OPROFILE_LIBRARY OPROFILE_INCLUDE_DIR
)
if (OPROFILE_FOUND)
if (NOT TARGET OProfile::OProfile)
add_library(OProfile::OProfile UNKNOWN IMPORTED)
set_target_properties(OProfile::OProfile PROPERTIES
IMPORTED_LOCATION ${OPROFILE_LIBRARIES}
INTERFACE_INCLUDE_DIRECTORIES ${OPROFILE_INCLUDE_DIRS}
)
endif()
endif()
mark_as_advanced(OPROFILE_INCLUDE_DIR OPROFILE_LIBRARY)

View File

@ -1,118 +0,0 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# FindOpenAL
# ----------
#
#
#
# Locate OpenAL This module defines OPENAL_LIBRARY OPENAL_FOUND, if
# false, do not try to link to OpenAL OPENAL_INCLUDE_DIR, where to find
# the headers
#
# $OPENALDIR is an environment variable that would correspond to the
# ./configure --prefix=$OPENALDIR used in building OpenAL.
#
# Created by Eric Wing. This was influenced by the FindSDL.cmake
# module.
# This makes the presumption that you are include al.h like
# #include "al.h"
# and not
# #include <AL/al.h>
# The reason for this is that the latter is not entirely portable.
# Windows/Creative Labs does not by default put their headers in AL/ and
# OS X uses the convention <OpenAL/al.h>.
#
# For Windows, Creative Labs seems to have added a registry key for their
# OpenAL 1.1 installer. I have added that key to the list of search paths,
# however, the key looks like it could be a little fragile depending on
# if they decide to change the 1.00.0000 number for bug fix releases.
# Also, they seem to have laid down groundwork for multiple library platforms
# which puts the library in an extra subdirectory. Currently there is only
# Win32 and I have hardcoded that here. This may need to be adjusted as
# platforms are introduced.
# The OpenAL 1.0 installer doesn't seem to have a useful key I can use.
# I do not know if the Nvidia OpenAL SDK has a registry key.
#
# For OS X, remember that OpenAL was added by Apple in 10.4 (Tiger).
# To support the framework, I originally wrote special framework detection
# code in this module which I have now removed with CMake's introduction
# of native support for frameworks.
# In addition, OpenAL is open source, and it is possible to compile on Panther.
# Furthermore, due to bugs in the initial OpenAL release, and the
# transition to OpenAL 1.1, it is common to need to override the built-in
# framework.
# Per my request, CMake should search for frameworks first in
# the following order:
# ~/Library/Frameworks/OpenAL.framework/Headers
# /Library/Frameworks/OpenAL.framework/Headers
# /System/Library/Frameworks/OpenAL.framework/Headers
#
# On OS X, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of
# OPENAL_LIBRARY to override this selection or set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
find_path(OPENAL_INCLUDE_DIR al.h
HINTS
ENV OPENALDIR
PATH_SUFFIXES include/AL include/OpenAL include
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_OpenAL_ARCH_DIR libs/Win64)
else()
set(_OpenAL_ARCH_DIR libs/Win32)
endif()
find_library(OPENAL_LIBRARY
NAMES OpenAL al openal OpenAL32
HINTS
ENV OPENALDIR
PATH_SUFFIXES lib64 lib libs64 libs ${_OpenAL_ARCH_DIR}
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw
/opt/local
/opt/csw
/opt
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
)
unset(_OpenAL_ARCH_DIR)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenAL DEFAULT_MSG OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
if(OPENAL_FOUND)
if(NOT TARGET OpenAL::OpenAL)
add_library(OpenAL::OpenAL UNKNOWN IMPORTED)
if(OPENAL_LIBRARY MATCHES "/([^/]+)\\.framework$")
set(_al_fw "${OPENAL_LIBRARY}/${CMAKE_MATCH_1}")
if(EXISTS "${_al_fw}.tbd")
set(_al_fw "${_al_fw}.tbd")
endif()
set_target_properties(OpenAL::OpenAL PROPERTIES
IMPORTED_LOCATION "${_al_fw}")
else()
set_target_properties(OpenAL::OpenAL PROPERTIES
IMPORTED_LOCATION "${OPENAL_LIBRARY}")
endif()
set_target_properties(OpenAL::OpenAL PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${OPENAL_INCLUDE_DIR}
)
endif()
endif()
mark_as_advanced(OPENAL_LIBRARY OPENAL_INCLUDE_DIR)

View File

@ -1,30 +0,0 @@
# - Try to find OpenSLES
# Once done this will define
# OPENSLES_FOUND - System has OpenSLES
# OPENSLES_INCLUDE_DIR - The OpenSLES include directory
# OPENSLES_LIBRARY - The library needed to use OpenSLES
# An imported target OpenSLES::OpenSLES is also created, prefer this
find_path(OPENSLES_INCLUDE_DIR
NAMES SLES/OpenSLES.h
)
find_library(OPENSLES_LIBRARY
NAMES OpenSLES
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpenSLES DEFAULT_MSG
OPENSLES_LIBRARY OPENSLES_INCLUDE_DIR)
if(OpenSLES_FOUND)
if(NOT TARGET OpenSLES::OpenSLES)
add_library(OpenSLES::OpenSLES UNKNOWN IMPORTED)
set_target_properties(OpenSLES::OpenSLES PROPERTIES
IMPORTED_LOCATION ${OPENSLES_LIBRARY}
INTERFACE_INCLUDE_DIRECTORIES ${OPENSLES_INCLUDE_DIR}
)
endif()
endif()
mark_as_advanced(OPENSLES_INCLUDE_DIR OPENSLES_LIBRARY )

View File

@ -1,4 +0,0 @@
find_program(POWERSHELL_EXE NAMES powershell)
INCLUDE(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PowerShell DEFAULT_MSG POWERSHELL_EXE)

View File

@ -1,42 +0,0 @@
# - Find PulseAudio library
# This module defines
# PulseAudio_INCLUDE_DIR
# PulseAudio_LIBRARIES
# PulseAudio_FOUND
#
# vim: expandtab sw=4 ts=4 sts=4:
find_package(PkgConfig QUIET)
pkg_check_modules (PulseAudio_PKG QUIET libpulse)
find_path(PulseAudio_INCLUDE_DIR NAMES pulse/pulseaudio.h
PATHS
${PulseAudio_PKG_INCLUDE_DIRS}
/usr/include/pulse
/usr/include
/usr/local/include/pulse
/usr/local/include
)
find_library(PulseAudio_LIBRARIES NAMES pulse
PATHS
${PulseAudio_PKG_LIBRARY_DIRS}
/usr/lib
/usr/local/lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PulseAudio
REQUIRED_VARS PulseAudio_LIBRARIES PulseAudio_INCLUDE_DIR)
if(PulseAudio_FOUND)
if(NOT TARGET PulseAudio::PulseAudio)
add_library(PulseAudio::PulseAudio UNKNOWN IMPORTED)
set_target_properties(PulseAudio::PulseAudio PROPERTIES
IMPORTED_LOCATION ${PulseAudio_LIBRARIES}
INTERFACE_INCLUDE_DIRECTORIES ${PulseAudio_INCLUDE_DIR}
)
endif()
endif()
mark_as_advanced(PulseAudio_INCLUDE_DIR PulseAudio_LIBRARIES)

View File

@ -1,29 +0,0 @@
find_package(PkgConfig QUIET)
pkg_check_modules(PC_SYSTEMD QUIET "libsystemd")
if (PC_SYSTEMD_FOUND)
add_definitions(${PC_SYSTEMD_CFLAGS} ${PC_SYSTEMD_CFLAGS_OTHER})
endif(PC_SYSTEMD_FOUND)
find_path(
SYSTEMD_INCLUDE_DIRS
NAMES systemd/sd-daemon.h
HINTS ${PC_SYSTEMD_INCLUDEDIR} ${PC_SYSTEMD_INCLUDE_DIRS}
)
find_library(
SYSTEMD_LIBRARIES
NAMES systemd
HINTS ${PC_SYSTEMD_LIBDIR} ${PC_SYSTEMD_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
SYSTEMD
REQUIRED_VARS SYSTEMD_LIBRARIES SYSTEMD_INCLUDE_DIRS
)
mark_as_advanced(
SYSTEMD_FOUND
SYSTEMD_LIBRARIES SYSTEMD_INCLUDE_DIRS
)

View File

@ -1,14 +0,0 @@
find_path(pugixml_INCLUDE_DIRS pugixml.hpp)
find_library(pugixml_LIBRARIES NAMES pugixml)
mark_as_advanced(pugixml_INCLUDE_DIRS pugixml_LIBRARIES)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(pugixml REQUIRED_VARS pugixml_LIBRARIES pugixml_INCLUDE_DIRS)
if(pugixml_FOUND AND NOT TARGET pugixml)
add_library(pugixml UNKNOWN IMPORTED)
set_target_properties(pugixml PROPERTIES
IMPORTED_LOCATION "${pugixml_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${pugixml_INCLUDE_DIRS}"
)
endif()

View File

@ -1,11 +0,0 @@
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# The default MSVC flags for Release and RelWithDebInfo are poorly chosen
# (see issue https://gitlab.kitware.com/cmake/cmake/-/issues/20812)
# By default, inlining is disabled for RelWithDebInfo.
# Manually redefine MSVC flags to match Visual Studio defaults
# and ensure that Release builds generate debug info.
foreach(f CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_RELEASE)
# optimize, define NDEBUG, generate debug info
set(${f} "/O2 /DNDEBUG /Z7")
endforeach()
endif()

View File

@ -1,16 +0,0 @@
# from https://stackoverflow.com/a/49216539
# The linked answer does some weird preconfiguring by manually splitting the CMAKE_CXX_FLAGS variable and applying it to a target,
# but as far as I can tell none of that is necessary, this works just fine as-is.
#
# Removes the specified compile flag from the specified target.
# _target - The target to remove the compile flag from
# _flag - The compile flag to remove
#
macro(remove_cxx_flag_from_target _target _flag)
get_target_property(_target_cxx_flags ${_target} COMPILE_OPTIONS)
if(_target_cxx_flags)
list(REMOVE_ITEM _target_cxx_flags ${_flag})
set_target_properties(${_target} PROPERTIES COMPILE_OPTIONS "${_target_cxx_flags}")
endif()
endmacro()

View File

@ -1,75 +0,0 @@
cmake_minimum_required(VERSION 3.13)
# for revision info
if(GIT_FOUND)
# 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}")
# 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_COMMITS_AHEAD_MASTER
execute_process(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-list --count HEAD ^master
OUTPUT_VARIABLE DOLPHIN_WC_COMMITS_AHEAD_MASTER
OUTPUT_STRIP_TRAILING_WHITESPACE)
# defines DOLPHIN_WC_TAG
execute_process(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} describe --exact-match HEAD
OUTPUT_VARIABLE DOLPHIN_WC_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
endif()
string(TIMESTAMP DOLPHIN_WC_BUILD_DATE "%Y-%m-%d" UTC)
# version number
set(DOLPHIN_VERSION_MAJOR "2506")
set(DOLPHIN_VERSION_MINOR "0")
set(DOLPHIN_VERSION_PATCH ${DOLPHIN_WC_REVISION})
# 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_COMMITS_AHEAD_MASTER 0)
endif()
# If this is a tag (i.e. a release), then set the current patch version and
# the number of commits ahead to zero.
if(DOLPHIN_WC_TAG)
set(DOLPHIN_VERSION_PATCH "0")
set(DOLPHIN_WC_COMMITS_AHEAD_MASTER 0)
endif()
function(configure_source_file path)
configure_file(
"${PROJECT_SOURCE_DIR}/${path}.in"
"${PROJECT_BINARY_DIR}/${path}.tmp"
)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${PROJECT_BINARY_DIR}/${path}.tmp" "${PROJECT_BINARY_DIR}/${path}")
file(REMOVE "${PROJECT_BINARY_DIR}/${path}.tmp")
endfunction()
configure_source_file("Source/Core/Common/scmrev.h")
if(APPLE)
configure_source_file("Source/Core/VersionInfo.plist")
endif()
if(LINUX)
configure_source_file("Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml")
endif()

File diff suppressed because it is too large Load Diff

View File

@ -1,64 +0,0 @@
{
"configurations": [
{
"name": "Release",
"configurationType": "Release",
"generator": "Ninja",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildCommandArgs": "",
"buildRoot": "${workspaceRoot}\\Build\\${name}",
"cmakeCommandArgs": "",
"variables": [
]
},
{
"name": "Debug",
"configurationType": "Debug",
"generator": "Ninja",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildCommandArgs": "",
"buildRoot": "${workspaceRoot}\\Build\\${name}",
"cmakeCommandArgs": "",
"variables": [
]
},
{
"name": "Release (arm64)",
"configurationType": "Release",
"generator": "Ninja",
"inheritEnvironments": [ "msvc_arm64_x64" ],
"buildCommandArgs": "",
"buildRoot": "${workspaceRoot}\\Build\\${name}",
"cmakeCommandArgs": "",
"variables": [
{
"name": "CMAKE_SYSTEM_NAME",
"value": "Windows"
},
{
"name": "CMAKE_SYSTEM_PROCESSOR",
"value": "aarch64"
}
]
},
{
"name": "Debug (arm64)",
"configurationType": "Debug",
"generator": "Ninja",
"inheritEnvironments": [ "msvc_arm64_x64" ],
"buildCommandArgs": "",
"buildRoot": "${workspaceRoot}\\Build\\${name}",
"cmakeCommandArgs": "",
"variables": [
{
"name": "CMAKE_SYSTEM_NAME",
"value": "Windows"
},
{
"name": "CMAKE_SYSTEM_PROCESSOR",
"value": "aarch64"
}
]
}
]
}

70
CMakeTests/CheckLib.cmake Normal file
View File

@ -0,0 +1,70 @@
include(FindPkgConfig OPTIONAL)
macro(_internal_message msg)
if(NOT ${_is_quiet})
message("${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)
include_directories(${${var}_INCLUDE_DIRS})
# Make sure include directories for headers found using find_path below
# are re-added when reconfiguring
include_directories(${${var}_INCLUDE})
_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()
macro(check_libav)
if(PKG_CONFIG_FOUND)
pkg_check_modules(LIBAV libavcodec>=54.35.0 libavformat>=54.20.4
libswscale>=2.1.1 libavutil>=52.3.0)
else()
message("pkg-config is required to check for libav/ffmpeg")
endif()
if(LIBAV_FOUND)
message("libav/ffmpeg found, enabling AVI frame dumps")
add_definitions(-DHAVE_LIBAV)
include_directories(${LIBAV_INCLUDE_DIRS})
else()
message("libav/ffmpeg not found, disabling AVI frame dumps")
endif()
endmacro()

29
CMakeTests/FindLLVM.cmake Normal file
View File

@ -0,0 +1,29 @@
# This file only exists because LLVM's cmake files are broken.
# This affects both LLVM 3.4 and 3.5.
# Hopefully when they fix their cmake system we don't need this garbage.
include(CheckLibraryExists)
list(APPEND LLVM_CONFIG_EXECUTABLES "llvm-config")
list(APPEND LLVM_CONFIG_EXECUTABLES "llvm-config-3.5")
list(APPEND LLVM_CONFIG_EXECUTABLES "llvm-config-3.4")
foreach(LLVM_CONFIG_NAME ${LLVM_CONFIG_EXECUTABLES})
find_program(LLVM_CONFIG_EXE NAMES ${LLVM_CONFIG_NAME})
if (LLVM_CONFIG_EXE)
execute_process(COMMAND ${LLVM_CONFIG_EXE} --version OUTPUT_VARIABLE LLVM_PACKAGE_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE )
if (${LLVM_PACKAGE_VERSION} VERSION_GREATER "3.3")
execute_process(COMMAND ${LLVM_CONFIG_EXE} --includedir OUTPUT_VARIABLE LLVM_INCLUDE_DIRS
OUTPUT_STRIP_TRAILING_WHITESPACE )
execute_process(COMMAND ${LLVM_CONFIG_EXE} --ldflags OUTPUT_VARIABLE LLVM_LDFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE )
check_library_exists(LLVM-${LLVM_PACKAGE_VERSION} LLVMVerifyFunction "${LLVM_LDFLAGS}" HAVE_DYNAMIC_LLVM_${LLVM_PACKAGE_VERSION})
if (HAVE_DYNAMIC_LLVM_${LLVM_PACKAGE_VERSION})
set(LLVM_LIBRARIES "${LLVM_LDFLAGS} -lLLVM-${LLVM_PACKAGE_VERSION}")
set(LLVM_FOUND 1)
break()
endif()
endif()
endif()
endforeach()

View File

@ -23,7 +23,7 @@ elseif (NOT LIBUSB_FOUND)
/usr/local/include /usr/local/include
) )
find_library(LIBUSB_LIBRARIES NAMES usb-1.0 usb find_library(LIBUSB_LIBRARIES NAMES usb-1.0
PATHS PATHS
${LIBUSB_PKG_LIBRARY_DIRS} ${LIBUSB_PKG_LIBRARY_DIRS}
/usr/lib /usr/lib
@ -40,11 +40,4 @@ elseif (NOT LIBUSB_FOUND)
mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES) mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES)
endif () endif ()
if(LIBUSB_FOUND AND NOT TARGET LibUSB::LibUSB)
add_library(LibUSB::LibUSB UNKNOWN IMPORTED)
set_target_properties(LibUSB::LibUSB PROPERTIES
IMPORTED_LOCATION "${LIBUSB_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${LIBUSB_INCLUDE_DIR}"
)
endif()

View File

@ -0,0 +1,33 @@
# - Try to find libevdev
# Once done this will define
# LIBEVDEV_FOUND - System has libevdev
# LIBEVDEV_INCLUDE_DIRS - The libevdev include directories
# LIBEVDEV_LIBRARIES - The libraries needed to use libevdev
find_package(PkgConfig)
pkg_check_modules(PC_LIBEVDEV QUIET libevdev)
FIND_PATH(
LIBEVDEV_INCLUDE_DIR libevdev/libevdev.h
HINTS ${PC_LIBEVDEV_INCLUDEDIR} ${PC_LIBEVDEV_INCLUDE_DIRS}
/usr/include
/usr/local/include
${LIBEVDEV_PATH_INCLUDES}
)
FIND_LIBRARY(
LIBEVDEV_LIBRARY
NAMES evdev libevdev
HINTS ${PC_LIBEVDEV_LIBDIR} ${PC_LIBEVDEV_LIBRARY_DIRS}
PATHS ${ADDITIONAL_LIBRARY_PATHS}
${LIBEVDEV_PATH_LIB}
)
set(LIBEVDEV_LIBRARIES ${LIBEVDEV_LIBRARY} )
set(LIBEVDEV_INCLUDE_DIRS ${LIBEVDEV_INCLUDE_DIR} )
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(libevdev DEFAULT_MSG
LIBEVDEV_LIBRARY LIBEVDEV_INCLUDE_DIR)
mark_as_advanced(LIBEVDEV_INCLUDE_DIR LIBEVDEV_LIBRARY )

View File

@ -0,0 +1,179 @@
# Locate miniupnp library
# This module defines
# MINIUPNP_FOUND, if false, do not try to link to miniupnp
# MINIUPNP_LIBRARY, the miniupnp variant
# MINIUPNP_INCLUDE_DIR, where to find miniupnpc.h and family)
# MINIUPNPC_VERSION_PRE1_6 --> set if we detect the version of miniupnpc is
# pre 1.6
# MINIUPNPC_VERSION_PRE1_5 --> set if we detect the version of miniupnpc is
# pre 1.5
#
# Note that the expected include convention is
# #include "miniupnpc.h"
# and not
# #include <miniupnpc/miniupnpc.h>
# This is because, the miniupnpc location is not standardized and may exist
# in locations other than miniupnpc/
#=============================================================================
# Copyright 2011 Mark Vejvoda
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
if (MINIUPNP_INCLUDE_DIR AND MINIUPNP_LIBRARY)
# Already in cache, be silent
set(MINIUPNP_FIND_QUIETLY TRUE)
endif (MINIUPNP_INCLUDE_DIR AND MINIUPNP_LIBRARY)
find_path(MINIUPNP_INCLUDE_DIR miniupnpc.h
PATH_SUFFIXES miniupnpc)
find_library(MINIUPNP_LIBRARY miniupnpc)
if (MINIUPNP_INCLUDE_DIR AND MINIUPNP_LIBRARY)
set (MINIUPNP_FOUND TRUE)
endif ()
if (MINIUPNP_FOUND)
if (NOT MINIUPNP_FIND_QUIETLY)
message (STATUS "Found the miniupnpc libraries at ${MINIUPNP_LIBRARY}")
message (STATUS "Found the miniupnpc headers at ${MINIUPNP_INCLUDE_DIR}")
endif (NOT MINIUPNP_FIND_QUIETLY)
message(STATUS "Detecting version of miniupnpc in path: ${MINIUPNP_INCLUDE_DIR}")
set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
check_cxx_source_runs("
#include <miniwget.h>
#include <miniupnpc.h>
#include <upnpcommands.h>
#include <stdio.h>
int main()
{
static struct UPNPUrls urls;
static struct IGDdatas data;
GetUPNPUrls (&urls, &data, \"myurl\",0);
return 0;
}"
MINIUPNPC_VERSION_1_7_OR_HIGHER)
IF (NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
check_cxx_source_runs("
#include <miniwget.h>
#include <miniupnpc.h>
#include <upnpcommands.h>
#include <stdio.h>
int main()
{
struct UPNPDev *devlist = NULL;
int upnp_delay = 5000;
const char *upnp_multicastif = NULL;
const char *upnp_minissdpdsock = NULL;
int upnp_sameport = 0;
int upnp_ipv6 = 0;
int upnp_error = 0;
devlist = upnpDiscover(upnp_delay, upnp_multicastif, upnp_minissdpdsock, upnp_sameport, upnp_ipv6, &upnp_error);
return 0;
}"
MINIUPNPC_VERSION_PRE1_7)
ENDIF()
IF (NOT MINIUPNPC_VERSION_PRE1_7 AND NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
check_cxx_source_runs("
#include <miniwget.h>
#include <miniupnpc.h>
#include <upnpcommands.h>
#include <stdio.h>
int main()
{
struct UPNPDev *devlist = NULL;
int upnp_delay = 5000;
const char *upnp_multicastif = NULL;
const char *upnp_minissdpdsock = NULL;
int upnp_sameport = 0;
int upnp_ipv6 = 0;
int upnp_error = 0;
devlist = upnpDiscover(upnp_delay, upnp_multicastif, upnp_minissdpdsock, upnp_sameport);
return 0;
}"
MINIUPNPC_VERSION_PRE1_6)
ENDIF()
IF (NOT MINIUPNPC_VERSION_PRE1_6 AND NOT MINIUPNPC_VERSION_PRE1_7 AND NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
check_cxx_source_runs("
#include <miniwget.h>
#include <miniupnpc.h>
#include <upnpcommands.h>
#include <stdio.h>
static struct UPNPUrls urls;
static struct IGDdatas data;
int main()
{
char externalIP[16] = \"\";
UPNP_GetExternalIPAddress(urls.controlURL, data.first.servicetype, externalIP);
return 0;
}"
MINIUPNPC_VERSION_1_5_OR_HIGHER)
ENDIF()
IF (NOT MINIUPNPC_VERSION_1_5_OR_HIGHER AND NOT MINIUPNPC_VERSION_PRE1_6 AND NOT MINIUPNPC_VERSION_PRE1_7 AND NOT MINIUPNPC_VERSION_1_7_OR_HIGHER)
set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
check_cxx_source_runs("
#include <miniwget.h>
#include <miniupnpc.h>
#include <upnpcommands.h>
#include <stdio.h>
static struct UPNPUrls urls;
static struct IGDdatas data;
int main()
{
char externalIP[16] = \"\";
UPNP_GetExternalIPAddress(urls.controlURL, data.servicetype, externalIP);
return 0;
}"
MINIUPNPC_VERSION_PRE1_5)
ENDIF()
IF(MINIUPNPC_VERSION_PRE1_5)
message(STATUS "Found miniupnpc version is pre v1.5")
ENDIF()
IF(MINIUPNPC_VERSION_PRE1_6)
message(STATUS "Found miniupnpc version is pre v1.6")
ENDIF()
IF(MINIUPNPC_VERSION_PRE1_7)
message(STATUS "Found miniupnpc version is pre v1.7")
ENDIF()
IF(NOT MINIUPNPC_VERSION_PRE1_5 AND NOT MINIUPNPC_VERSION_PRE1_6 AND NOT MINIUPNPC_VERSION_PRE1_7)
message(STATUS "Found miniupnpc version is v1.7 or higher")
ENDIF()
else ()
message (STATUS "Could not find miniupnp")
endif ()
MARK_AS_ADVANCED(MINIUPNP_INCLUDE_DIR MINIUPNP_LIBRARY)

View File

@ -0,0 +1,82 @@
# Locate polarssl library
# This module defines
# POLARSSL_FOUND
# POLARSSL_LIBRARY
# POLARSSL_INCLUDE_DIR
# POLARSSL_WORKS, this is true if polarssl is found and contains the methods
# needed by dolphin-emu
# validate cached values (but use them as hints)
set(POLARSSL_INCLUDE_DIR_HINT POLARSSL_INCLUDE_DIR)
set(POLARSSL_LIBRARY_HINT POLARSSL_LIBRARY)
unset(POLARSSL_INCLUDE_DIR CACHE)
unset(POLARSSL_LIBRARY CACHE)
find_path(POLARSSL_INCLUDE_DIR polarssl/ssl.h HINTS ${POLARSSL_INCLUDE_DIR_HINT})
find_library(POLARSSL_LIBRARY polarssl HINTS ${POLARSSL_LIBRARY_HINT})
if(POLARSSL_INCLUDE_DIR STREQUAL POLARSSL_INCLUDE_DIR_HINT AND
POLARSSL_LIBRARY STREQUAL POLARSSL_LIBRARY_HINT)
# using cached values, be silent
set(POLARSSL_FIND_QUIETLY TRUE)
endif()
if (POLARSSL_INCLUDE_DIR AND POLARSSL_LIBRARY)
set (POLARSSL_FOUND TRUE)
endif ()
if (POLARSSL_FOUND)
if (NOT POLARSSL_FIND_QUIETLY)
message (STATUS "Found the polarssl libraries at ${POLARSSL_LIBRARY}")
message (STATUS "Found the polarssl headers at ${POLARSSL_INCLUDE_DIR}")
endif (NOT POLARSSL_FIND_QUIETLY)
set(CMAKE_REQUIRED_INCLUDES ${POLARSSL_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${POLARSSL_LIBRARY})
unset(POLARSSL_WORKS CACHE)
check_cxx_source_compiles("
#include <polarssl/ctr_drbg.h>
#include <polarssl/entropy.h>
#include <polarssl/net.h>
#include <polarssl/ssl.h>
#include <polarssl/version.h>
#if POLARSSL_VERSION_NUMBER < 0x01030000
#error \"Shared PolarSSL version is too old\"
#endif
int main()
{
ssl_context ctx;
ssl_session session;
entropy_context entropy;
ctr_drbg_context ctr_drbg;
x509_crt cacert;
x509_crt clicert;
pk_context pk;
ssl_init(&ctx);
entropy_init(&entropy);
const char* pers = \"dolphin-emu\";
ctr_drbg_init(&ctr_drbg, entropy_func,
&entropy,
(const unsigned char*)pers,
strlen(pers));
ssl_set_rng(&ctx, ctr_drbg_random, &ctr_drbg);
ssl_set_session(&ctx, &session);
ssl_close_notify(&ctx);
ssl_session_free(&session);
ssl_free(&ctx);
entropy_free(&entropy);
return 0;
}"
POLARSSL_WORKS)
else ()
message (STATUS "Could not find polarssl")
endif ()
mark_as_advanced(POLARSSL_INCLUDE_DIR POLARSSL_LIBRARY)

193
CMakeTests/FindSDL2.cmake Normal file
View File

@ -0,0 +1,193 @@
# Locate SDL2 library
# This module defines
# SDL2_LIBRARY, the name of the library to link against
# SDL2_FOUND, if false, do not try to link to SDL2
# SDL2_INCLUDE_DIR, where to find SDL.h
#
# This module responds to the the flag:
# SDL2_BUILDING_LIBRARY
# If this is defined, then no SDL2_main will be linked in because
# only applications need main().
# Otherwise, it is assumed you are building an application and this
# module will attempt to locate and set the the proper link flags
# as part of the returned SDL2_LIBRARY variable.
#
# Don't forget to include SDL2main.h and SDL2main.m your project for the
# OS X framework based version. (Other versions link to -lSDL2main which
# this module will try to find on your behalf.) Also for OS X, this
# module will automatically add the -framework Cocoa on your behalf.
#
#
# Additional Note: If you see an empty SDL2_LIBRARY_TEMP in your configuration
# and no SDL2_LIBRARY, it means CMake did not find your SDL2 library
# (SDL2.dll, libsdl2.so, SDL2.framework, etc).
# Set SDL2_LIBRARY_TEMP to point to your SDL2 library, and configure again.
# Similarly, if you see an empty SDL2MAIN_LIBRARY, you should set this value
# as appropriate. These values are used to generate the final SDL2_LIBRARY
# variable, but when these values are unset, SDL2_LIBRARY does not get created.
#
#
# $SDL2DIR is an environment variable that would
# correspond to the ./configure --prefix=$SDL2DIR
# used in building SDL2.
# l.e.galup 9-20-02
#
# Modified by Eric Wing.
# Added code to assist with automated building by using environmental variables
# and providing a more controlled/consistent search behavior.
# Added new modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
# Also corrected the header search path to follow "proper" SDL2 guidelines.
# Added a search for SDL2main which is needed by some platforms.
# Added a search for threads which is needed by some platforms.
# Added needed compile switches for MinGW.
#
# On OSX, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of
# SDL2_LIBRARY to override this selection or set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
#
# Note that the header path has changed from SDL2/SDL.h to just SDL.h
# This needed to change because "proper" SDL2 convention
# is #include "SDL.h", not <SDL2/SDL.h>. This is done for portability
# reasons because not all systems place things in SDL2/ (see FreeBSD).
#
# Ported by Johnny Patterson. This is a literal port for SDL2 of the FindSDL.cmake
# module with the minor edit of changing "SDL" to "SDL2" where necessary. This
# was not created for redistribution, and exists temporarily pending official
# SDL2 CMake modules.
#=============================================================================
# Copyright 2003-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PATH(SDL2_INCLUDE_DIR SDL.h
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES include/SDL2 include
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local/include/SDL2
/usr/include/SDL2
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
)
#MESSAGE("SDL2_INCLUDE_DIR is ${SDL2_INCLUDE_DIR}")
FIND_LIBRARY(SDL2_LIBRARY_TEMP
NAMES SDL2
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES lib64 lib
PATHS
/sw
/opt/local
/opt/csw
/opt
)
#MESSAGE("SDL2_LIBRARY_TEMP is ${SDL2_LIBRARY_TEMP}")
IF(NOT SDL2_BUILDING_LIBRARY)
IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
# Non-OS X framework versions expect you to also dynamically link to
# SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms
# seem to provide SDL2main for compatibility even though they don't
# necessarily need it.
FIND_LIBRARY(SDL2MAIN_LIBRARY
NAMES SDL2main
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES lib64 lib
PATHS
/sw
/opt/local
/opt/csw
/opt
)
ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
ENDIF(NOT SDL2_BUILDING_LIBRARY)
# SDL2 may require threads on your system.
# The Apple build may not need an explicit flag because one of the
# frameworks may already provide it.
# But for non-OSX systems, I will use the CMake Threads package.
IF(NOT APPLE)
FIND_PACKAGE(Threads)
ENDIF(NOT APPLE)
# MinGW needs an additional library, mwindows
# It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -lmwindows
# (Actually on second look, I think it only needs one of the m* libraries.)
IF(MINGW)
SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
ENDIF(MINGW)
SET(SDL2_FOUND "NO")
IF(SDL2_LIBRARY_TEMP)
# For SDL2main
IF(NOT SDL2_BUILDING_LIBRARY)
IF(SDL2MAIN_LIBRARY)
SET(SDL2_LIBRARY_TEMP ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY_TEMP})
ENDIF(SDL2MAIN_LIBRARY)
ENDIF(NOT SDL2_BUILDING_LIBRARY)
# For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
# CMake doesn't display the -framework Cocoa string in the UI even
# though it actually is there if I modify a pre-used variable.
# I think it has something to do with the CACHE STRING.
# So I use a temporary variable until the end so I can set the
# "real" variable in one-shot.
IF(APPLE)
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa")
ENDIF(APPLE)
# For threads, as mentioned Apple doesn't need this.
# In fact, there seems to be a problem if I used the Threads package
# and try using this line, so I'm just skipping it entirely for OS X.
IF(NOT APPLE)
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
ENDIF(NOT APPLE)
# For MinGW library
IF(MINGW)
SET(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP})
ENDIF(MINGW)
# Set the final string here so the GUI reflects the final state.
SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found")
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
SET(SDL2_FOUND "YES")
# extract the major and minor version numbers from SDL2/SDL_version.h
# we have to handle framework a little bit differently :
if("${SDL2_INCLUDE_DIR}" MATCHES ".framework")
set(SDL2_VERSION_H_INPUT "${SDL2_INCLUDE_DIR}/Headers/SDL_version.h")
else()
set(SDL2_VERSION_H_INPUT "${SDL2_INCLUDE_DIR}/SDL_version.h")
endif()
FILE(READ "${SDL2_VERSION_H_INPUT}" SDL2_VERSION_H_CONTENTS)
STRING(REGEX REPLACE ".*#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+).*#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+).*#define[ \t]+SDL_PATCHLEVEL[ \t]+([0-9]+).*"
"\\1.\\2.\\3" SDL2_VERSION "${SDL2_VERSION_H_CONTENTS}")
#MESSAGE("SDL2 Version is ${SDL2_VERSION}")
ENDIF(SDL2_LIBRARY_TEMP)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2
REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR VERSION_VAR SDL2_VERSION)

View File

@ -87,10 +87,9 @@ if(SFML_FIND_VERSION AND SFML_INCLUDE_DIR)
set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/SFML/Config.hpp") set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/SFML/Config.hpp")
endif() endif()
FILE(READ "${SFML_CONFIG_HPP_INPUT}" SFML_CONFIG_HPP_CONTENTS) FILE(READ "${SFML_CONFIG_HPP_INPUT}" SFML_CONFIG_HPP_CONTENTS)
STRING(REGEX MATCH "#define SFML_VERSION_MAJOR[ \t]+([0-9]+)" SFML_VERSION_MAJOR_MATCH "${SFML_CONFIG_HPP_CONTENTS}") STRING(REGEX MATCH ".*#define SFML_VERSION_MAJOR ([0-9]+).*#define SFML_VERSION_MINOR ([0-9]+).*" SFML_CONFIG_HPP_CONTENTS "${SFML_CONFIG_HPP_CONTENTS}")
STRING(REGEX MATCH "#define SFML_VERSION_MINOR[ \t]+([0-9]+)" SFML_VERSION_MINOR_MATCH "${SFML_CONFIG_HPP_CONTENTS}") STRING(REGEX REPLACE ".*#define SFML_VERSION_MAJOR ([0-9]+).*" "\\1" SFML_VERSION_MAJOR "${SFML_CONFIG_HPP_CONTENTS}")
STRING(REGEX REPLACE "#define SFML_VERSION_MAJOR[ \t]+([0-9]+)" "\\1" SFML_VERSION_MAJOR "${SFML_VERSION_MAJOR_MATCH}") STRING(REGEX REPLACE ".*#define SFML_VERSION_MINOR ([0-9]+).*" "\\1" SFML_VERSION_MINOR "${SFML_CONFIG_HPP_CONTENTS}")
STRING(REGEX REPLACE "#define SFML_VERSION_MINOR[ \t]+([0-9]+)" "\\1" SFML_VERSION_MINOR "${SFML_VERSION_MINOR_MATCH}")
math(EXPR SFML_REQUESTED_VERSION "${SFML_FIND_VERSION_MAJOR} * 10 + ${SFML_FIND_VERSION_MINOR}") math(EXPR SFML_REQUESTED_VERSION "${SFML_FIND_VERSION_MAJOR} * 10 + ${SFML_FIND_VERSION_MINOR}")
# if we could extract them, compare with the requested version number # if we could extract them, compare with the requested version number
@ -103,14 +102,10 @@ if(SFML_FIND_VERSION AND SFML_INCLUDE_DIR)
set(SFML_VERSION_OK FALSE) set(SFML_VERSION_OK FALSE)
endif() endif()
else() else()
# SFML version is < 3.0 # SFML version is < 2.0
if (SFML_REQUESTED_VERSION GREATER 29) if (SFML_REQUESTED_VERSION GREATER 19)
set(SFML_VERSION_OK FALSE) set(SFML_VERSION_OK FALSE)
if (SFML_REQUESTED_VERSION GREATER 19) set(SFML_VERSION_MAJOR 1)
set(SFML_VERSION_MAJOR 1)
else()
set(SFML_VERSION_MAJOR 2)
endif()
set(SFML_VERSION_MINOR x) set(SFML_VERSION_MINOR x)
endif() endif()
endif() endif()
@ -204,27 +199,11 @@ if (NOT SFML_FOUND)
message(FATAL_ERROR ${FIND_SFML_ERROR}) message(FATAL_ERROR ${FIND_SFML_ERROR})
elseif(NOT SFML_FIND_QUIETLY) elseif(NOT SFML_FIND_QUIETLY)
# error but continue # error but continue
message(STATUS "${FIND_SFML_ERROR}") message("${FIND_SFML_ERROR}")
endif() endif()
endif() endif()
# handle success # handle success
if(SFML_FOUND) if(SFML_FOUND)
message(STATUS "Found SFML ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR} in ${SFML_INCLUDE_DIR}") message(STATUS "Found SFML ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR} in ${SFML_INCLUDE_DIR}")
foreach(FIND_SFML_COMPONENT ${SFML_FIND_COMPONENTS})
string(TOLOWER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_LOWER)
string(TOUPPER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_UPPER)
if(NOT TARGET sfml-${FIND_SFML_COMPONENT_LOWER})
add_library(sfml-${FIND_SFML_COMPONENT_LOWER} UNKNOWN IMPORTED)
set_target_properties(sfml-${FIND_SFML_COMPONENT_LOWER} PROPERTIES
IMPORTED_LOCATION "${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${SFML_INCLUDE_DIR}"
)
if(NOT ${FIND_SFML_COMPONENT_LOWER} STREQUAL system)
set_target_properties(sfml-${FIND_SFML_COMPONENT_LOWER} PROPERTIES
INTERFACE_LINK_LIBRARIES sfml-system
)
endif()
endif()
endforeach()
endif() endif()

View File

@ -1,119 +0,0 @@
# Dolphin Emulator Code of Conduct
Like many Open Source projects and the greater FLOSS community, Dolphin is a
collaborative open source community comprised of a diverse group of
contributors and users from around the globe. We find the contributions,
collaborations, and mentorships within our community to be the essential
lifeblood of our project and appreciate the efforts of those who participate to
nurture and grow those, and all other aspects of our community.
However, when a large and sufficiently diverse group of people work together,
there are often cultural, communication, and compatibility issues. In order to
minimize conflict, and provide a framework for resolution, we have a brief code
of conduct that we ask all participants in the Dolphin community adhere to.
These rules should apply to everyone, regardless of their status within the
community, and anyone can serve to remind, or ask the project leads to help
resolve issues.
No list is ever exhaustive, so we encourage members of the Dolphin community to
adhere to the spirit, rather than the letter, of this code, as that is how it
will be enforced. Places where this code may be particularly applicable are
GitHub issues and pull requests, bug tracker comments, IRC, Discord, forums,
Twitter discussions broadly directed at or between members of the community,
and other direct interactions within the community. Any violations, especially
continued or flagrant offenses, may affect an individuals (or organizations)
ability to participate within the Dolphin community.
If you feel that someone is in violation of the code of conduct, whether in
letter or in spirit, we request that you email as detailed a description as
possible of the offense and offending party/parties to
[conduct@dolphin-emu.org](mailto:conduct@dolphin-emu.org). If you have
questions, concerns, or any other inquiries please feel free to contact the
project leads.
## Rules
1. **Be friendly and patient.** We were all new or suffered from a lack of
knowledge at one point in time. Please try to remember what it felt like to
be on that end, and treat people accordingly.
2. **Be welcoming.** We strive to be a community that welcomes and supports
people of all backgrounds and identities. This includes, but is not limited
to members of any race, ethnicity, culture, national origin, colour,
immigration status, social and economic class, educational level, sex,
sexual orientation, gender identity and expression, age, size, family
status, political belief, religion, and mental and physical ability.
3. **Be helpful.** By helping others to learn our entire ecosystem is enriched.
We encourage members of the Dolphin community to mentor each other and help
to raise the general level of knowledge in the community whenever possible.
4. **Be considerate.** Your work will be used by other people, and you in turn
will depend on the work of others. Any decision you take will affect users
and colleagues, and you should take those consequences into account when
making decisions. Remember that were a world-wide community, so you might
not be communicating in someone elses primary language.
5. **Be respectful.** Not all of us will agree all the time, but disagreement
is no excuse for poor behavior and poor manners. We might all experience
some frustration now and then, but we cannot allow that frustration to turn
into a personal attack. Its important to remember that a community where
people feel uncomfortable or threatened is not a productive one. Members of
the Dolphin community should be respectful when dealing with other members
as well as with people outside the Dolphin community.
6. **Be careful in the words that you choose.** We are a community of
professionals, and we conduct ourselves professionally. Be kind to others.
Do not insult or put down other participants. Harassment and other
exclusionary behavior arent acceptable. This includes, but is not limited
to:
- Violent threats or language directed against another person.
- Discriminatory jokes and language.
- Posting sexually explicit or violent material.
- Posting (or threatening to post) other peoples personally identifying
information (“doxing”), regardless of whether it is publicly available.
- Personal insults, especially those using racist, sexist, or otherwise
discriminatory terms.
- Deliberately referring to others by names or pronouns counter to their
identity.
- Unwelcome sexual attention.
- Advocating for, or encouraging, any of the above behavior.
- Repeated harassment of others. In general, if someone asks you to stop,
then stop.
7. **When we disagree, try to understand why.** Disagreements, both social and
technical, happen all the time and Dolphin is no exception. It is important
that we resolve disagreements and differing views constructively. Remember
that were different. The strength of Dolphin comes from its varied
community, people from a wide range of backgrounds. Different people have
different perspectives on issues. Being unable to understand why someone
holds a viewpoint doesnt mean that theyre wrong. Dont forget that it is
human to err and blaming each other doesnt get us anywhere. Instead, focus
on helping to resolve issues and learning from mistakes.
## Consequences
Except in flagrant or otherwise egregious cases, the first infraction will
result in a verbal warning. Everyone slips up or acts out of frustration at
times, we just ask that you work to not repeat the behavior. Continued
infractions will be dealt with on a case-by-case basis, and could lead to
actions including:
- Temporary suspension from one or all avenues of Dolphin community
participation. This includes, but is not limited to, IRC, Discord, GitHub,
Redmine, and the Dolphin Forums.
- Permanent suspension from participating in the Dolphin community.
Moderators should generally assume good intent when evaluating infractions, but
should also keep in mind that good intent does not override the Code of Conduct
rules.
## Acknowledgments
This text is adapted from the [Asahi Linux Code of
Conduct](https://asahilinux.org/code-of-conduct/), itself derived from the
[Ceph Code of Conduct](https://ceph.io/community/code-of-conduct/), and the
[Django Project Code of Conduct](https://www.djangoproject.com/conduct/). Feel
free to reuse under the terms of the [CC-BY-SA 4.0
license](https://creativecommons.org/licenses/by-sa/4.0/).

10
COPYING
View File

@ -1,10 +0,0 @@
Most of Dolphin's original source code is licensed under GPLv2+. Part of the
source code distributed in this repository is derived from other projects and
may have stronger or weaker licensing requirement. Overall, in aggregate, the
entirety of this repository is compatible with the GPLv3 license.
Per-file licensing information is provided via SPDX tags [1]. The licenses
referenced in these tags can be found in the LICENSES/ directory within this
source repository.
[1] https://spdx.dev/

View File

@ -1,86 +1,35 @@
# <a name="main-section-overview"></a>Dolphin Coding Style & Legal Requirements # Dolphin Coding Style & Licensing
- [Legal](#legal)
- [Coding style introduction](#introduction)
- [C++ coding style and formatting](#cpp-coding-style-and-formatting)
- [C++ code-specific guidelines](#cpp-code-specific-guidelines)
- [Android](#android)
- [Help](#help)
# <a name="legal"></a>Legal
Summary:
- [Trade secrets](#trade-secrets)
- [Code licensing](#code-licensing)
## <a name="trade-secrets"></a>Trade secrets
Following all relevant laws is of utmost importance for an emulation project like Dolphin.
If you know any confidential information related to the GameCube, Wii, or Triforce, either because you signed a non-disclosure agreement or because you looked at leaked materials, we ask that you don't contribute code to Dolphin **at all**. While accepting code from contributors who know confidential information is legal if the code is unrelated to the confidential information, we refuse to accept code from such contributors because it greatly increases our review burden and increases the legal risk we take.
Also, this probably goes without saying, but piracy is strictly forbidden both on GitHub and in all other Dolphin channels.
## <a name="code-licensing"></a>Code licensing
If you make any contributions to Dolphin after December 1st, 2014, you are agreeing that any code you have contributed will be licensed under the GNU GPL version 2 (or any later version). If you make any contributions to Dolphin after December 1st, 2014, you are agreeing that any code you have contributed will be licensed under the GNU GPL version 2 (or any later version).
# <a name="introduction"></a>Coding style introduction ## Coding Style
Summary: - [Introduction] (#introduction)
- [Styling and formatting] (#styling-and-formatting)
- [General] (#general)
- [Naming] (#naming)
- [Conditionals] (#conditionals)
- [Classes and Structs] (#classes-and-structs)
- [Code specific] (#code-specific)
- [General] (#general-1)
- [Headers] (#headers)
- [Loops] (#loops)
- [Functions] (#functions)
- [Classes and Structs] (#classes-and-structs-1)
- [Aims](#intro-aims)
- [Checking and fixing formatting issues](#intro-formatting-issues)
## <a name="intro-aims"></a>Aims ## Introduction
This guide is for developers who wish to contribute to the Dolphin codebase. It details how to properly style and format code for this project. This guide also offers suggestions on specific functions and other elements that may be used in code. This guide is for developers who wish to contribute to the Dolphin codebase. It will detail how to properly style and format code to fit this project. This guide also offers suggestions on specific functions and other varia that may be used in code.
Following this guide and formatting your code as detailed will likely get your pull request merged much faster than if you don't (assuming the code itself has no mistakes). Following this guide and formatting your code as detailed will likely get your pull request merged much faster than if you don't (assuming the written code has no mistakes in itself).
This project uses clang-format 19.1 to check for common style issues. In case of conflicts between this guide and clang-format rules, the latter should be followed instead of this guide. ## Styling and formatting
## <a name="intro-formatting-issues"></a>Checking and fixing formatting issues ### General
Windows users need to be careful about line endings. Windows users should configure git to checkout UNIX-style line endings to keep clang-format simple.
In most cases, clang-format can and **should** be used to automatically reformat code and solve most formatting issues.
- To run clang-format on all staged files:
```
git diff --cached --name-only | grep -E '[.](cpp|h|mm)$' | xargs -I {} clang-format -i {}
```
- Formatting issues can be checked for before committing with a lint script that is included with the codebase. To enable it as a pre-commit hook (assuming you are in the repository root):
```
ln -s ../../Tools/lint.sh .git/hooks/pre-commit
```
- Alternatively, a custom git filter driver can be used to automatically and transparently reformat any changes:
```
git config filter.clang_format.smudge 'cat'
git config filter.clang_format.clean 'clang-format %f'
echo '/Source/Core/**/*.cpp filter=clang_format' >> .git/info/attributes
echo '/Source/Core/**/*.h filter=clang_format' >> .git/info/attributes
echo '/Source/Core/**/*.mm filter=clang_format' >> .git/info/attributes
```
- Visual Studio supports automatically formatting the current document according to the clang-format configuration by pressing <kbd>Control</kbd>+<kbd>K</kbd> followed by <kbd>Control</kbd>+<kbd>D</kbd> (or selecting Edit &rarr; Advanced &rarr; Format Document). This can be used without separately installing clang-format.
# <a name="cpp-coding-style-and-formatting"></a>C++ coding style and formatting
Summary:
- [General](#cpp-style-general)
- [Naming](#cpp-style-naming)
- [Conditionals](#cpp-style-conditionals)
- [Classes and structs](#cpp-style-classes-and-structs)
## <a name="cpp-style-general"></a>General
- Try to limit lines of code to a maximum of 100 characters. - Try to limit lines of code to a maximum of 100 characters.
- Note that this does not mean you should try and use all 100 characters every time you have the chance. Typically with well formatted code, you normally shouldn't hit a line count of anything over 80 or 90 characters. - Note that this does not mean you should try and use all 100 characters every time you have the chance. Typically with well formatted code, you normally shouldn't hit a line count of anything over 80 or 90 characters.
- The indentation style we use is 2 spaces per level. - The indentation style we use is tabs for initial indentation and then, if vertical alignment is needed, spaces are to be used.
- The opening brace for namespaces, classes, functions, enums, structs, unions, conditionals, and loops go on the next line. - The opening brace for namespaces, classes, functions, enums, structs, unions, conditionals, and loops go on the next line.
- With array initializer lists and lambda expressions it is OK to keep the brace on the same line. - With array initializer lists and lambda expressions it is OK to keep the brace on the same line.
- References and pointers have the ampersand or asterisk against the type name, not the variable name. Example: `int* var`, not `int *var`. - References and pointers have the ampersand or asterisk against the type name, not the variable name. Example: `int* var`, not `int *var`.
@ -90,10 +39,10 @@ Summary:
```c++ ```c++
if (condition) if (condition)
return 0; return 0;
while (var != 0) while (var != 0)
var--; var--;
``` ```
- No: - No:
@ -103,56 +52,56 @@ Summary:
while (var != 0) var--; while (var != 0) var--;
``` ```
## <a name="cpp-style-naming"></a>Naming ### Naming
- All class, enum, function, and struct names should be in upper CamelCase. If the name contains an abbreviation uppercase it. - All class, enum, function, and struct names should be in upper CamelCase. If the name contains an abbreviation uppercase it.
- `class SomeClassName` - `class SomeClassName`
- `enum IPCCommandType` - `enum IPCCommandType`
- All compile time constants should be fully uppercased. With constants that have more than one word in them, use an underscore to separate them. - All compile time constants should be fully uppercased. With constants that have more than one word in them, use an underscore to separate them.
- `constexpr double PI = 3.14159;` - `const double PI = 3.14159;`
- `constexpr int MAX_PATH = 260;` - `const int MAX_PATH = 260;`
- All variables should be lowercase with underscores separating the individual words in the name. - All variables should be lowercase with underscores separating the individual words in the name.
- `int this_variable_name;` - `int this_variable_name;`
- Please do not use [Hungarian notation](https://en.wikipedia.org/wiki/Hungarian_notation) prefixes with variables. The only exceptions to this are the variable prefixes below. - Please do not use [Hungarian notation](http://en.wikipedia.org/wiki/Hungarian_notation) prefixes with variables. The only exceptions to this are the variable prefixes below.
- Global variables `g_` - Global variables `g_`
- Class variables `m_` - Class variables `m_`
- Static variables `s_` - Static variables `s_`
## <a name="cpp-style-conditionals"></a>Conditionals ### Conditionals
- Do not leave `else` or `else if` conditions dangling unless the `if` condition lacks braces. - Do not leave `else` or `else if` conditions dangling unless the `if` condition lacks braces.
- Yes: - Yes:
```c++ ```c++
if (condition) if (condition)
{ {
// code // code
} }
else else
{ {
// code // code
} }
``` ```
- Acceptable: - Acceptable:
```c++ ```c++
if (condition) if (condition)
// code line // code line
else else
// code line // code line
``` ```
- No: - No:
```c++ ```c++
if (condition) if (condition)
{ {
// code // code
} }
else else
// code line // code line
``` ```
## <a name="cpp-style-classes-and-structs"></a>Classes and structs ### Classes and Structs
- If making a [POD](https://en.wikipedia.org/wiki/Passive_data_structure) type, use a `struct` for this. Use a `class` otherwise. - If making a [POD](http://en.wikipedia.org/wiki/Plain_Old_Data_Structures) type, use a `struct` for this. Use a `class` otherwise.
- Class layout should be in the order, `public`, `protected`, and then `private`. - Class layout should be in the order, `public`, `protected`, and then `private`.
- If one or more of these sections are not needed, then simply don't include them. - If one or more of these sections are not needed, then simply don't include them.
- For each of the above specified access levels, the contents of each should follow this given order: constructor, destructor, operator overloads, functions, then variables. - For each of the above specified access levels, the contents of each should follow this given order: constructor, destructor, operator overloads, functions, then variables.
@ -162,36 +111,27 @@ Summary:
class ExampleClass : public SomeParent class ExampleClass : public SomeParent
{ {
public: public:
ExampleClass(int x, int y); ExampleClass(int x, int y);
int GetX() const; int GetX() const;
int GetY() const; int GetY() const;
protected: protected:
virtual void SomeProtectedFunction() = 0; virtual void SomeProtectedFunction() = 0;
static float s_some_variable; static float s_some_variable;
private: private:
int m_x; int m_x;
int m_y; int m_y;
}; };
``` ```
# <a name="cpp-code-specific-guidelines"></a>C++ code-specific guidelines ## Code Specific
Summary: ### General
- Using C++11 features is OK and recommended.
- [General](#cpp-code-general) - Use the [nullptr](http://en.cppreference.com/w/cpp/language/nullptr) type over the macro `NULL`.
- [Headers](#cpp-code-headers) - If a [range-based for loop](http://en.cppreference.com/w/cpp/language/range-for) can be used instead of container iterators, use it.
- [Loops](#cpp-code-loops)
- [Functions](#cpp-code-functions)
- [Classes and Structs](#cpp-code-classes-and-structs)
## <a name="cpp-code-general"></a>General
- The codebase currently uses C++20, though not all compilers support all C++20 features.
- See CMakeLists.txt "Enforce minimum compiler versions" for the currently supported compilers.
- Use the [nullptr](https://en.cppreference.com/w/cpp/language/nullptr) type over the macro `NULL`.
- If a [range-based for loop](https://en.cppreference.com/w/cpp/language/range-for) can be used instead of container iterators, use it.
- Obviously, try not to use `goto` unless you have a *really* good reason for it. - Obviously, try not to use `goto` unless you have a *really* good reason for it.
- If a compiler warning is found, please try and fix it. - If a compiler warning is found, please try and fix it.
- Try to avoid using raw pointers (pointers allocated with `new`) as much as possible. There are cases where using a raw pointer is unavoidable, and in these situations it is OK to use them. An example of this is functions from a C library that require them. In cases where it is avoidable, the STL usually has a means to solve this (`vector`, `unique_ptr`, etc). - Try to avoid using raw pointers (pointers allocated with `new`) as much as possible. There are cases where using a raw pointer is unavoidable, and in these situations it is OK to use them. An example of this is functions from a C library that require them. In cases where it is avoidable, the STL usually has a means to solve this (`vector`, `unique_ptr`, etc).
@ -199,19 +139,18 @@ Summary:
- Do not use `using namespace [x];` in headers. Try not to use it at all if you can. - Do not use `using namespace [x];` in headers. Try not to use it at all if you can.
- The preferred form of the increment and decrement operator in for-loops is prefix-form (e.g. `++var`). - The preferred form of the increment and decrement operator in for-loops is prefix-form (e.g. `++var`).
## <a name="cpp-code-headers"></a>Headers ### Headers
- If a header is not necessary in a certain source file, remove them. - If a header is not necessary in a certain source file, remove them.
- If you find duplicate includes of a certain header, remove it. - If you find duplicate includes of a certain header, remove it.
- When declaring includes in a source file, make sure they follow the given pattern: - When declaring includes in a source file, make sure they follow the given pattern:
- The header for the source file
- Standard library headers - Standard library headers
- System-specific headers (these should also likely be in an `#ifdef` block unless the source file itself is system-specific). - System-specific headers (these should also likely be in an `#ifdef` block unless the source file itself is system-specific).
- Other Dolphin source file headers - Dolphin source file headers
- Each of the above header sections should also be in alphabetical order - Each of the above header sections should also be in alphabetical order
- Project source file headers should be included in a way that is relative to the `[Dolphin Root]/Source/Core` directory. - Project source file headers should be included in a way that is relative to the `[Dolphin Root]/Source/Core` directory.
- This project uses `#pragma once` as header guards. - This project uses `#pragma once` as header guards.
## <a name="cpp-code-loops"></a>Loops ### Loops
- If an infinite loop is required, do not use `for (;;)`, use `while (true)`. - If an infinite loop is required, do not use `for (;;)`, use `while (true)`.
- Empty-bodied loops should use braces after their header, not a semicolon. - Empty-bodied loops should use braces after their header, not a semicolon.
- Yes: `while (condition) {}` - Yes: `while (condition) {}`
@ -221,23 +160,22 @@ Summary:
```c++ ```c++
do do
{ {
// code
} while (false); } while (false);
``` ```
## <a name="cpp-code-functions"></a>Functions ### Functions
- If a function parameter is a pointer or reference and its value or data isn't intended to be changed, please mark that parameter as `const`. - If a function parameter is a pointer or reference and its value or data isn't intended to be changed, please mark that parameter as `const`.
- Functions that specifically modify their parameters should have the respective parameter(s) marked as a pointer so that the variables being modified are syntactically obvious. - Functions that specifically modify their parameters should have the respective parameter(s) marked as a pointer so that the variables being modified are syntaxically obvious.
- What not to do: - What not to do:
```c++ ```c++
template<class T> template<class T>
inline void Clamp(T& val, const T& min, const T& max) inline void Clamp(T& val, const T& min, const T& max)
{ {
if (val < min) if (val < min)
val = min; val = min;
else if (val > max) else if (val > max)
val = max; val = max;
} }
``` ```
@ -249,10 +187,10 @@ Summary:
template<class T> template<class T>
inline void Clamp(T* val, const T& min, const T& max) inline void Clamp(T* val, const T& min, const T& max)
{ {
if (*val < min) if (*val < min)
*val = min; *val = min;
else if (*val > max) else if (*val > max)
*val = max; *val = max;
} }
``` ```
@ -264,7 +202,7 @@ Summary:
class ClassName : ParentClass class ClassName : ParentClass
{ {
public: public:
void Update() final; void Update() final;
}; };
``` ```
@ -274,29 +212,20 @@ Summary:
class ClassName : ParentClass class ClassName : ParentClass
{ {
public: public:
void Update() override; void Update() override;
}; };
``` ```
## <a name="cpp-code-classes-and-structs"></a>Classes and structs ### Classes and Structs
- Classes and structs that are not intended to be extended through inheritance should be marked with the `final` specifier. - Classes and structs that are not intended to be extended through inheritance should be marked with the `final` specifier.
```c++ ```c++
class ClassName final : ParentClass class ClassName final : ParentClass
{ {
// Class definitions // Class definitions
}; };
``` ```
# <a name="android"></a>Android ## Java
If you are using Kotlin, just use the built-in official Kotlin code style. The Android project is currently written in Java. If you are using Android Studio to contribute, you can import the project's code style from `code-style-java.jar`, located in `[Dolphin Root]/Source/Android`. Please organize imports before committing.
To install the Java code style in Android Studio, select the gear icon in the Code Style settings as shown, select `Import Scheme...` and select `dolphin/Source/Android/code-style-java.xml`. The Code Style menu should look like this when complete. ![Code Style Window][code-style]
You can now select any section of code and press `Ctrl + Alt + L` to automatically format it.
# <a name="help"></a>Help
If you have any questions about Dolphin's development or would like some help, Dolphin developers use `#dolphin-emu @ irc.libera.chat` to communicate. If you are new to IRC, [Libera.Chat has resources to get started chatting with IRC.](https://libera.chat/)
[code-style]: https://i.imgur.com/3b3UBhb.png

View File

@ -1,6 +0,0 @@
#GameCube Controller Adapter
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="0337", TAG+="uaccess"
#Wiimotes or DolphinBar
SUBSYSTEM=="hidraw*", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="0306", TAG+="uaccess"
SUBSYSTEM=="hidraw*", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="0330", TAG+="uaccess"

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

View File

@ -1,4 +1,4 @@
The two fonts in this directory (font_western.bin and font_japanese.bin) were The two fonts in this directory (font_ansi.bin and font_sjis.bin) were
generated using gc-font-tool which can be found in the docs/ directory in the generated using gc-font-tool which can be found in the docs/ directory in the
dolphin source code. dolphin source code.

View File

@ -1,13 +0,0 @@
# 1-2 - Wii System Menu
[Core]
# Values set here will override the main Dolphin settings.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video_Settings]
SafeTextureCacheColorSamples = 0

View File

@ -0,0 +1,22 @@
# 010E01 - Wii Backup Disc v1.31
[Core]
# Values set here will override the main Dolphin settings.
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId =
EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video]
ProjectionHack = 0

View File

@ -0,0 +1,20 @@
# 301E01 - GameCube Service Disc
[Core]
# Values set here will override the main Dolphin settings.
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 3
EmulationIssues = Certain tests may soft-lock
[OnLoad]
# Add memory patches to be loaded once on boot here.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video]

View File

@ -1,10 +0,0 @@
# Cxxxxx All Virtual Console Commodore 64 games
[Core]
# Values set here will override the main Dolphin settings.
[Video]
[Video_Settings]
SuggestedAspectRatio = 2
SafeTextureCacheColorSamples = 0

View File

@ -0,0 +1,23 @@
# C94EGX - Tower Toppler
[Core]
# Values set here will override the main Dolphin settings.
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video]
[Video_Settings]
SafeTextureCacheColorSamples = 0

View File

@ -0,0 +1,23 @@
# C96EGX - Summer Games II
[Core]
# Values set here will override the main Dolphin settings.
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video]
[Video_Settings]
SafeTextureCacheColorSamples = 0

View File

@ -0,0 +1,23 @@
# C97EGX - California Games
[Core]
# Values set here will override the main Dolphin settings.
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video]
[Video_Settings]
SafeTextureCacheColorSamples = 0

View File

@ -0,0 +1,23 @@
# C9MEGX - Pitstop II
[Core]
# Values set here will override the main Dolphin settings.
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video]
[Video_Settings]
SafeTextureCacheColorSamples = 0

View File

@ -0,0 +1,23 @@
# C9XEGX - The Last Ninja
[Core]
# Values set here will override the main Dolphin settings.
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video]
[Video_Settings]
SafeTextureCacheColorSamples = 0

View File

@ -3,11 +3,20 @@
[Core] [Core]
# Values set here will override the main Dolphin settings. # Values set here will override the main Dolphin settings.
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
[OnFrame] [OnFrame]
# Add memory patches to be applied every frame here. # Add memory patches to be applied every frame here.
[ActionReplay] [ActionReplay]
# Add action replay cheats here. # Add action replay cheats here.
[Video_Hacks] [Video]
EFBToTextureEnable = False ProjectionHack = 0

View File

@ -1,5 +1,8 @@
# D43E01 - Legend of Zelda, The - Ocarina of Time - Master Quest # D43E01 - Legend of Zelda, The - Ocarina of Time - Master Quest
[OnLoad]
# Add memory patches to be loaded once on boot here.
[OnFrame] [OnFrame]
# Add memory patches to be applied every frame here. # Add memory patches to be applied every frame here.
@ -20,7 +23,7 @@ $Infinite Hover When Moving
02CA2AB2 0000000F 02CA2AB2 0000000F
$Infinite Rupees $Infinite Rupees
02BE181C 000003E7 02BE181C 000003E7
$Swords/Shields/Boots/Tunics $Swords/Shields/boots/tunics
02BE1884 00007777 02BE1884 00007777
$Have Quiver (Adult) $Have Quiver (Adult)
00BE1889 00000001 00BE1889 00000001

View File

@ -1,12 +1,12 @@
# D43J01 - ZELDA OCARINA MULTI PACK # D43J01 - ZELDA OCARINA MULTI PACK
[OnLoad]
# Add memory patches to be loaded once on boot here.
[OnFrame] [OnFrame]
# Add memory patches to be applied every frame here. # Add memory patches to be applied every frame here.
$loophack $loophack
0x806866E4:word:0x60000000 0x806866E4:word:0x60000000
[Patches_RetroAchievements_Verified]
$loophack
[ActionReplay] [ActionReplay]
# Add action replay cheats here. # Add action replay cheats here.

View File

@ -1,16 +0,0 @@
# D56E01 - Interactive Multi-Game Demo Disc Version 35
[Core]
# Values set here will override the main Dolphin settings.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video_Hacks]
EFBToTextureEnable = False
BBoxEnable = True
ImmediateXFBEnable = False
DeferEFBCopies = False

View File

@ -1,12 +1,23 @@
# D85E01 - Interactive Multi Game Demo Disc v12 # D85E01 - Multi Game Demo Disk 12
[Core] [Core]
# Values set here will override the main Dolphin settings. # Values set here will override the main Dolphin settings.
FPRF = True
MMU = True [EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 4
EmulationIssues = Videos run at low FPS
[OnLoad]
# Add memory patches to be loaded once on boot here.
[OnFrame] [OnFrame]
# Add memory patches to be applied every frame here. # Add memory patches to be applied every frame here.
[ActionReplay] [ActionReplay]
# Add action replay cheats here. # Add action replay cheats here.
[Video]
ProjectionHack = 0
[Video_Settings]

View File

@ -1,12 +0,0 @@
# D86P01 - Interactive Multi Game Demo Disc v12
[Core]
# Values set here will override the main Dolphin settings.
FPRF = True
MMU = True
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.

View File

@ -1,4 +0,0 @@
# D93U01 - Interactive Multi-Game Demo Disk: November 2003
[Core]
FPRF = True

View File

@ -1,11 +0,0 @@
# D95P01 - Interactive Multi Game Demo Disc v5
[Core]
# Values set here will override the main Dolphin settings.
FPRF = True
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.

View File

@ -1,22 +0,0 @@
# DAXP01, DAXE01 - The Legend of Zelda Skyward Sword
[Core]
# Values set here will override the main Dolphin settings.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video_Hacks]
EFBAccessEnable = True
EFBEmulateFormatChanges = True
[Video_Enhancements]
ArbitraryMipmapDetection = True
[Video_Settings]
# Allow the ArbitraryMipmapDetection setting to take effect.
EnableGPUTextureDecoding = False

View File

@ -3,15 +3,32 @@
[Core] [Core]
# Values set here will override the main Dolphin settings. # Values set here will override the main Dolphin settings.
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 5
EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
[OnFrame] [OnFrame]
# Add memory patches to be applied every frame here. # Add memory patches to be applied every frame here.
[ActionReplay] [ActionReplay]
# Add action replay cheats here. # Add action replay cheats here.
[Video]
ProjectionHack = 0
PH_SZNear = 0
PH_SZFar = 0
PH_ExtraParam = 0
PH_ZNear =
PH_ZFar =
[Video_Settings] [Video_Settings]
EFBScale = -1
SafeTextureCacheColorSamples = 512 SafeTextureCacheColorSamples = 512
[Video_Enhancements] [Video_Enhancements]
MaxAnisotropy = 0 MaxAnisotropy = 0
ForceTextureFiltering = False ForceFiltering = False

View File

@ -1,4 +0,0 @@
# DJU - (unknown title - INI file autogenerated from vWii system menu list of titles without 16:9 support)
[Video_Settings]
SuggestedAspectRatio = 2

View File

@ -2,7 +2,15 @@
[Core] [Core]
# Values set here will override the main Dolphin settings. # Values set here will override the main Dolphin settings.
MMU = True MMU = 1
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 3
EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
[OnFrame] [OnFrame]
# Add memory patches to be applied every frame here. # Add memory patches to be applied every frame here.
@ -13,7 +21,8 @@ MMU = True
[Video] [Video]
[Video_Settings] [Video_Settings]
UseXFB = True
UseRealXFB = False
[Video_Hacks] [Video_Hacks]
EFBToTextureEnable = False EFBToTextureEnable = False
ImmediateXFBEnable = False

View File

@ -1,18 +0,0 @@
# DPOJ8P - PHANTASY STAR ONLINE EPISODE I&II TRIAL EDITION
[Core]
# Values set here will override the main Dolphin settings.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
$Bypass Modem Detection
04194f40 4182002c
[Video_Settings]
SafeTextureCacheColorSamples = 512
[AR_RetroAchievements_Verified]
$Bypass Modem Detection

View File

@ -1,13 +0,0 @@
# DPSJ8P - PHANTASY STAR ONLINE EPISODE III TRIAL EDITION
[Core]
# Values set here will override the main Dolphin settings.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video_Settings]
SafeTextureCacheColorSamples = 512

View File

@ -1,4 +0,0 @@
# DQAJK2 - Aquarius Baseball
[Video_Settings]
SuggestedAspectRatio = 2

View File

@ -1,11 +0,0 @@
# DSRJ8P - Sonic and the Secret Rings
[Core]
# Values set here will override the main Dolphin settings.
RealWiiRemoteRepeatReports = False
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.

View File

@ -0,0 +1,19 @@
# DTLX01 - ACTION REPLAY
[Core]
# Values set here will override the main Dolphin settings.
[EmuState]
# The Emulation State. 1 is worst, 5 is best, 0 is not set.
EmulationStateId = 3
EmulationIssues =
[OnLoad]
# Add memory patches to be loaded once on boot here.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.

View File

@ -1,8 +0,0 @@
# Exxxxx - All "Virtual Console Arcade" and NeoGeo Virtual Console games
[Core]
# Values set here will override the main Dolphin settings.
[Video_Settings]
SuggestedAspectRatio = 2
SafeTextureCacheColorSamples = 0

View File

@ -1,13 +0,0 @@
# E52E08 - 1942
[Core]
# Values set here will override the main Dolphin settings.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video_Hacks]
EFBToTextureEnable = False

View File

@ -1,16 +0,0 @@
# E53E08 - BLACK TIGER
[Core]
# Values set here will override the main Dolphin settings.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video_Hacks]
EFBToTextureEnable = False
[Video_Settings]
SafeTextureCacheColorSamples = 0

View File

@ -1,16 +0,0 @@
# E54E08 - GHOSTS'N GOBLINS
[Core]
# Values set here will override the main Dolphin settings.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video_Hacks]
EFBToTextureEnable = False
[Video_Settings]
SafeTextureCacheColorSamples = 0

View File

@ -1,13 +0,0 @@
# E55E08 - WoB:COMMANDO
[Core]
# Values set here will override the main Dolphin settings.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video_Hacks]
EFBToTextureEnable = False

View File

@ -1,13 +0,0 @@
# E56E08 - EXED EXES
[Core]
# Values set here will override the main Dolphin settings.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video_Hacks]
EFBToTextureEnable = False

View File

@ -1,13 +0,0 @@
# E57E08 - SONSON
[Core]
# Values set here will override the main Dolphin settings.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video_Hacks]
EFBToTextureEnable = False

View File

@ -1,17 +0,0 @@
# E5ZE8P - Super Hang-On
[Core]
# Values set here will override the main Dolphin settings.
CPUThread = False
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video_Settings]
SafeTextureCacheColorSamples = 0
[Video_Hacks]
ImmediateXFBEnable = False

View File

@ -1,17 +0,0 @@
# E62E8P - Space Harrier
[Core]
# Values set here will override the main Dolphin settings.
CPUThread = False
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video_Settings]
SafeTextureCacheColorSamples = 0
[Video_Hacks]
ImmediateXFBEnable = False

View File

@ -1,17 +0,0 @@
# E63E8P - Shinobi
[Core]
# Values set here will override the main Dolphin settings.
CPUThread = False
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video_Settings]
SafeTextureCacheColorSamples = 0
[Video_Hacks]
ImmediateXFBEnable = False

View File

@ -1,16 +0,0 @@
# E6NE9B - Solomon's Key
[Core]
# Values set here will override the main Dolphin settings.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video_Hacks]
EFBToTextureEnable = False
[Video_Settings]
SafeTextureCacheColorSamples = 0

View File

@ -1,16 +0,0 @@
# E6QE9B - RYGAR
[Core]
# Values set here will override the main Dolphin settings.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video_Hacks]
EFBToTextureEnable = False
[Video_Settings]
SafeTextureCacheColorSamples = 0

View File

@ -1,16 +0,0 @@
# E6VE8P - Zaxxon
[Core]
# Values set here will override the main Dolphin settings.
[OnFrame]
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Video_Settings]
SafeTextureCacheColorSamples = 0
[Video_Hacks]
ImmediateXFBEnable = False

Some files were not shown because too many files have changed in this diff Show More