Commit Graph

623 Commits

Author SHA1 Message Date
Skyler Saleh 4ecb3084b7 Apple M1 Support for MacOS
This commit adds support for compiling Dolphin for ARM on MacOS so that it can
run natively on the M1 processors without running through Rosseta2 emulation
providing a 30-50% performance speedup and less hitches from Rosseta2.

It consists of several key changes:

- Adding support for W^X allocation(MAP_JIT) for the ARM JIT
- Adding the machine context and config info to identify the M1 processor
- Additions to the build system and docs to support building universal binaries
- Adding code signing entitlements to access the MAP_JIT functionality
- Updating the MoltenVK libvulkan.dylib to a newer version with M1 support
2021-05-22 15:25:17 -07:00
Léo Lam ae9ac510e2
CMake: Do not enable LTO by default for MSVC
LTO is supposed to be enabled by default for VS Release builds
according to the VS prop files but a build log from JMC reveals
that /GL and /LTCG are not actually passed to cl.exe/link.exe
for some reason...

LTO also leads to *extremely* and unacceptably slow build times
when using link.exe, so let's disable it by default to actually
match the project files.
2021-04-27 12:54:18 +02:00
Léo Lam 20d00dfc79
CMake: Add missing MSVC optimization flags to match VS project props 2021-04-27 12:54:18 +02:00
Léo Lam c69747c7fb
CMake: Fix CMAKE_RUNTIME_OUTPUT_DIRECTORY being ignored in UnitTests
CMAKE_RUNTIME_OUTPUT_DIRECTORY_<mode> overrode CMAKE_RUNTIME_OUTPUT_DIRECTORY.

It's just unnecessary and it broke UnitTests's custom output directory
2021-04-27 12:54:18 +02:00
Léo Lam dcf3ca0f89
CMake: Force gtest to link CRT dynamically to avoid runtime mismatches
Required to fix unit test builds for Windows+MSVC+CMake.

For more information, see:

23ef29555e/googletest/README.md (visual-studio-dynamic-vs-static-runtimes)
2021-04-27 12:54:18 +02:00
Léo Lam 18174d3ed6
Merge pull request #9649 from leoetlino/cmake-auto-update-track
Make it possible to enable auto-updates by default with CMake builds
2021-04-24 19:44:51 +02:00
JosJuice 91669c25fe
Merge pull request #9650 from leoetlino/consistent-build-binary-dirs
Put x86_64 Windows binaries in Binary/x64 for consistency with ARM64
2021-04-24 19:22:05 +02:00
Florent Castelli 6910fab63f
cmake: Replace /Zi with /Z7 for sccache support
Also allows better parallelization since there's no contention on a PDB
file with compiling.
2021-04-24 17:59:34 +02:00
Léo Lam a7a69ecd2e
Put x86_64 Windows binaries in Binary/x64 for consistency with ARM64
...and with our existing Visual Studio project files and
buildbot config.
2021-04-17 21:33:07 +02:00
Léo Lam 5f355690e0
Make it possible to enable auto-updates by default with CMake builds
This adds a CMake option (DOLPHIN_DEFAULT_UPDATE_TRACK) to allow
configuring SCM_UPDATE_TRACK_STR. This is needed to enable auto-updates
in Windows CMake builds by default.
2021-04-17 19:45:43 +02:00
Skyler Saleh b2d5eea20c Build: Fix -fno-strict-aliasing on Xcode builds
Xcode is configured by default to turn on the strict aliasing optimization
through a separate project setting. This would cause the compiler to be called
with both -fno-strict-aliasing and -fstrict-aliasing. This change turns off
that project setting causing only the -fno-strict-aliasing flag to be provided
to the compiler.
2021-04-10 21:28:10 -07:00
Skyler Saleh b0d91a5399 Build: Check for zstd headers
Modify the CMakeLists.txt so that it doesn't try to use a shared zstd library
that doesn't have header files. This was a support issue on Macs because
homebrew was installing headerless zstd libraries with Qt.
2021-04-02 12:05:12 -07:00
Dentomologist 7eaa98d461 CMake: Fix unused compiler flag warning
Add a check to define FMT_EXCEPTIONS = 0 when compiling on MacOS.

Replaces -fno-objc-exceptions, which also disabled fmt exceptions but
generated warnings when compiling c++ files.
2021-03-16 13:11:36 -07:00
JosJuice 2cb3f663bc CMake: Include WIL headers
MSBuild does this, so CMake should too. Fixes a Windows build error.
2021-03-04 10:26:31 +01:00
Norbert Lange d4b293e969 Simplify macro guards for HAVE_XRANDR 2021-02-22 14:32:53 +01:00
Léo Lam eafb9de047
Merge pull request #9323 from waddlesplash/haiku
Rehabilitate Haiku support.
2021-01-05 16:09:43 +01:00
waddlesplash 2df11d3911 Rehabilitate Haiku support. 2021-01-02 16:54:24 -05:00
Léo Lam 0aadb9fd7b
Build the gdbstub by default
While the gdbstub is somewhat broken at the moment, building it by
default should keep us from breaking the build (which has happened
several times in the past: #2614, #5904, #8262).

It isn't very intrusive and it does nothing unless it is enabled
in the config file.
2020-12-25 01:21:36 +01:00
C.W. Betts 1100a31407 CMake: Apple Silicon detection
CMake's CMAKE_SYSTEM_PROCESSOR call returns "arm64" on Apple Silicon. This patch makes sure that arm64 and aarch64 are treated as the same architecture.
2020-12-24 14:34:04 -07:00
Ryan Burns aefbf9c445 Exclude Discord RPC lib from installation
This vendored library does not need to be installed,
as it is statically linked in.
2020-12-02 19:23:28 -08:00
Léo Lam 5d9eb8f6ce
Merge pull request #9271 from leoetlino/warnings
Fix several warnings and only enable extra warnings for our own code
2020-11-22 02:04:53 +01:00
Léo Lam f53a7a2b66
CMake: Pass various /Zc flags to MSVC for consistency with Base.props
969ea6e4f5

Fixes non-conformant handling of __VA_ARGS__.
2020-11-21 14:43:26 +01:00
Léo Lam ade9f92a63
Enable extra warnings in Source CMakeLists, not in root CMakeLists
Having extra warnings enabled for everything including external
libraries produces an overwhelming amount of warnings in code that
isn't even part of our codebase.

Move the various warning flags to Source/CMakeLists.txt to get rid
of those useless warnings.

Note that the Source CMakeLists.txt is already where the MSVC warnings
are defined, so this commit improves consistency as well.
2020-11-21 00:59:17 +01:00
JosJuice 56e68e7b72 CMake: Bump fmt version requirement to 7.1.0
We use make_args_checked, which was added in 7.1.0.
2020-11-16 13:06:20 +01:00
Lioncash 369a9e01dc Externals: Update fmt to 7.1.0
Updates fmt to the latest release from 6.1.2
2020-10-27 11:36:47 -04:00
Léo Lam 23c9179fb6
Merge pull request #9071 from orbea/cmake
cmake: Silence warnings.
2020-10-26 18:48:42 +01:00
iwubcode 02c3242078 CMake: Change "USE_VULKAN" to "HAS_VULKAN" 2020-10-24 13:48:51 -05:00
iwubcode 22b0d10568 CMake: Set HAS_OPENGL for every system other than arm64 2020-10-24 13:48:51 -05:00
mazes-80 f375ee72a2
CMake: Add option to enable/disable Vulkan video backend 2020-10-23 20:14:46 +02:00
James Sharpe 135cd390e7
Require zstd >= 1.4.0
<leoetlino: Dolphin fails to build with zstd 1.3.8.>
2020-10-21 21:52:59 +02:00
JosJuice cb14b65aad CMake: Fix build errors exposed by making common dependent on fmt 2020-10-19 14:36:09 +02:00
orbea 2bfbc4d79f cmake: Silence warnings. 2020-09-08 21:18:40 -07:00
Admiral H. Curtiss fdab9783c7 Externals: Add rangeset. 2020-08-24 19:31:32 +02:00
JosJuice c9edfa0eaa Replace Windows CMake lambda constexpr capture workaround
While manually capturing constexpr variables used in lambda
expressions does work, it's really easy to forget doing so since
we don't have a Windows CMake builder and the workaround isn't
necessary anywhere else. Fortunately, MSVC has a flag that fixes
the constexpr capture behavior, so let's use that instead.
2020-06-25 13:11:29 +02:00
Tillmann Karras 24eee74937 CMake: support using system-wide zstd library
CMake does not have native support for zstd yet.
2020-06-16 19:42:55 +01:00
tokumeiwokiboushimasu 6fb6d16f0a
Specify the system minizip's include directory
Without this, build fails on Fedora32.
2020-06-11 17:15:41 +09:00
JosJuice 2137fb7813 Externals: Add zstd
I had to rename Source/Common/Compiler.h because the VS build
confuses it with Externals/zstd/lib/common/compiler.h otherwise.
2020-05-13 20:53:10 +02:00
Pierre Bourdon 143131a6a1
cmake: add an option to control dependencies vendoring
Disable by default, to be used by distributions who care to try and
prefer system-wide libraries when available. It makes sense for us to
keep using vendored libs by default when possible to make it easier for
users to compile, but we should provide appropriate tools for distro to
figure out which dependencies they can share with the rest of the
system.
2020-05-10 09:34:14 +02:00
degasus 9fd1385733 Externals: Fix OpenAL include directory. 2020-04-29 13:07:51 +02:00
degasus 990acbb17d Externals: Fix ed25519 include path. 2020-04-29 12:55:42 +02:00
degasus ae2d567f59 Externals: Fix include path for picojson and discord 2020-04-29 11:45:59 +02:00
degasus 239cde8aea Externals: Alter the soundtouch include directory.
We must not provide the /Externals directory as global include directory.
Here, this yield a crash because of external minizip header and system library mismatch.

Soundtouch itself recormends to include it with <SoundTouch.h> and -I/usr/include/soundtouch, so this should fit better.
2020-04-29 11:30:26 +02:00
Techjar d5f356f937 Require minizip 2.0.0 or newer
Minizip 1.x is the old broken version, while 2.x is the newer fork we
use. Many distros ship the old version which is causing stack smashing
in RedumpVerifier, so we'll only use the shared lib if it's the newer
version.
2020-04-28 20:42:02 -04:00
degasus 9fd03cda9d Externals: Add libLZMA. 2020-04-24 15:18:09 +02:00
degasus 4385afdb0a Externals: Add bzip2. 2020-04-24 15:18:09 +02:00
Léo Lam 5db7add9c7
Merge pull request #8667 from Mystro256/master
Allow for some shared minizip/fmt
2020-03-15 16:25:11 +01:00
mazes-80 209db1f96c Build system: default to fmt shared library when available 2020-03-15 14:30:44 +01:00
Mystro256 9f12e0f5a9 Allow using shared minizip 2020-03-11 10:55:05 -04:00
spycrab 213a9adcff CMake: Fix building ARM64 on Windows 2020-02-12 12:29:31 +01:00
Connor McLaughlin ae6d3be449
Merge pull request #8530 from s-daveb/master
MacOS: Fixes configuration hang; bump MacOS SDK.
2020-01-13 20:21:08 +10:00