Commit Graph

45339 Commits

Author SHA1 Message Date
Joshua Vandaële
3b91d2b74d
CMake: Introduce Presets, replacing Settings
This introduces a CMakePresets file for both Unix-likes and Windows that replace the old CMakeSettings.

It adds presets for **Debug** and **Release** profiles for both **x64** and **ARM64** architectures, as well as **Generic builds**.
Presets can be used using[ Visual Studio's built-in CMakePresets support](https://learn.microsoft.com/en-us/cpp/build/cmake-presets-vs?view=msvc-170), or [Visual Studio Code's CMake Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) extension.

They can also be used from the command line, like so:

- x64/Unix-like/Ninja:
  - Configure: `cmake --preset ninja-release-x64`
  - Build: `cmake --build --preset ninja-build-release-x64`
  - Configure + Build: `cmake --workflow --preset ninja-release-x64`
- ARM64/Windows/Visual Studio:
  - Configure: `cmake --preset visualstudio-release-arm64`
  - Build: `cmake --build --preset visualstudio-build-release-arm64`
  - Configure + Build: `cmake --workflow --preset visualstudio-release-arm64`

The Ninja generator is available to both Windows and Unix-likes, while the Visual Studio Generator is only available on Windows.

**Cross-compiling**

On **Windows**, the Visual Studio generator automatically takes care of everything, you just need to select an ARM64 preset.

On **Unix-likes**, to cross-compile you need to install a cross-compiler and (optionally) a sysroot of the target system.
Here is an example to compile from x64 to ARM64 with a sysroot:

- `cmake --preset ninja-release-arm64 -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_SYSROOT=/opt/sysroots/aarch64-linux-gnu`
- `cmake --build --preset ninja-build-release-arm64`

You will need a sysroot to link against Qt, since we do not vendor it in on platforms other than Windows.

**User presets**

A `CMakeUserPresets.json` file may be created locally at the root of the project to further customize your presets.
For example, here are the user presets I used to test this PR on Arch Linux with a generic Arch Linux ARM sysroot:

```json
{
  "version": 10,
  "configurePresets": [
    {
      "name": "gcc-debug-arm64",
      "inherits": "ninja-debug-arm64",
      "cacheVariables": {
        "CMAKE_C_COMPILER": "aarch64-linux-gnu-gcc",
        "CMAKE_CXX_COMPILER": "aarch64-linux-gnu-g++",
        "CMAKE_EXE_LINKER_FLAGS": "-L/opt/sysroots/ArchLinuxARM/lib",
        "CMAKE_SYSROOT": "/opt/sysroots/ArchLinuxARM"
      }
    },
    {
      "name": "clang-debug-arm64",
      "inherits": "ninja-debug-arm64",
      "cacheVariables": {
        "CMAKE_C_COMPILER": "clang",
        "CMAKE_CXX_COMPILER": "clang++",
        "CMAKE_C_FLAGS": "-target aarch64-linux-gnu",
        "CMAKE_CXX_FLAGS": "-target aarch64-linux-gnu",
        "CMAKE_SYSROOT": "/opt/sysroots/ArchLinuxARM"
      }
    },
    {
      "name": "clang-debug-x64",
      "inherits": "ninja-debug-x64",
      "cacheVariables": {
        "CMAKE_C_COMPILER": "clang",
        "CMAKE_CXX_COMPILER": "clang++"
      }
    }
  ],
  "buildPresets": [
    {
      "name": "gcc-build-debug-arm64",
      "configurePreset": "gcc-debug-arm64"
    },
    {
      "name": "clang-build-debug-arm64",
      "configurePreset": "clang-debug-arm64"
    },
    {
      "name": "clang-build-debug-x64",
      "configurePreset": "clang-debug-x64"
    }
  ],
  "workflowPresets": [
    {
      "name": "gcc-debug-arm64",
      "steps": [
        { "type": "configure", "name": "gcc-debug-arm64" },
        { "type": "build", "name": "gcc-build-debug-arm64" }
      ]
    },
    {
      "name": "clang-debug-arm64",
      "steps": [
        { "type": "configure", "name": "clang-debug-arm64" },
        { "type": "build", "name": "clang-build-debug-arm64" }
      ]
    },
    {
      "name": "clang-debug-x64",
      "steps": [
        { "type": "configure", "name": "clang-debug-x64" },
        { "type": "build", "name": "clang-build-debug-x64" }
      ]
    }
  ]
}
```

They are then used like so:
Configure + Build with GCC: `cmake --workflow --preset gcc-debug-arm64`
Configure + Build with Clang: `cmake --workflow --preset clang-debug-arm64`
Configure + Build with Clang (x64): `cmake --workflow --preset clang-debug-x64`

*Addendum: It should also now be possible to cross-compile from Windows to Unix-likes, and Unix-like to other Unix-like (e.g. Linux -> FreeBSD), however this is untested.*
2026-03-15 17:42:21 +01:00
Joshua Vandaële
6551c9bc24
CMake: Error out if trying to build generic builds on Windows
Generic builds have never been supported on Windows.
2026-03-15 17:42:21 +01:00
Joshua Vandaële
dfeb58b018
CMake: Bump minimum requirement to 3.25 2026-03-15 17:42:21 +01:00
Joshua Vandaële
9153408a0f
CMake: Unify output directory 2026-03-15 17:42:21 +01:00
Joshua Vandaële
9025c33299
CMake: Remove LINUX_LOCAL_DEV and symlink required files 2026-03-15 17:42:21 +01:00
Joshua Vandaële
343aa6f0dd
CMake: Unify sys directories 2026-03-15 17:42:21 +01:00
Joshua Vandaële
f61388d7fc
CMake: Unify translation directories 2026-03-15 17:42:21 +01:00
Joshua Vandaële
b397cb4b93
CMake: PDBs outside of Binaries 2026-03-15 17:42:21 +01:00
Joshua Vandaële
6402195f01
Remove Visual Studio Projects and Solutions in favor of CMake 2026-03-15 17:42:21 +01:00
Joshua Vandaële
efa0923c1c
UNDOME: Change ext-win-qt to local repo
https://github.com/dolphin-emu/ext-win-qt/pull/23
2026-03-15 17:28:32 +01:00
OatmealDome
a28fff3f00
Merge pull request #14224 from JoshuaVandaele/windows-mz-ng-fix
Externals: Fix clashing dependencies
2026-03-15 12:27:02 -04:00
Jordan Woyak
b6027da5db
Merge pull request #14464 from Dentomologist/system_use_forward_declarations_in_system.h
System: Use forward declarations in System.h
2026-03-14 20:24:52 -05:00
Dentomologist
2aba231915 System: Use forward declarations in System.h 2026-03-14 10:53:45 -07:00
Dentomologist
210f70a501
Merge pull request #14463 from m-brodschi/move-perf-metrics-to-coretiming
Move PerformanceMetrics from global variable to System
2026-03-14 10:40:10 -07:00
Mihai Brodschi
f9c3f06f0a Move PerformanceMetrics from global variable to System
This avoids the static initialization order fiasco between Core and VideoCommon

Co-authored-by: Jordan Woyak <jordan.woyak@gmail.com>
2026-03-14 16:42:21 +02:00
Dentomologist
7a45ede688
Merge pull request #14123 from JosJuice/fix-logical-page-mappings
Memmap: Fix populating m_logical_page_mappings
2026-03-13 12:11:01 -07:00
Dentomologist
dd9f1e3573
Merge pull request #14458 from jordan-woyak/buildfix
HW/Triforce/SerialDevice: Add missing include to fix FreeBSD build.
2026-03-12 20:46:27 -07:00
Jordan Woyak
51a15f42a9 HW/Triforce/SerialDevice: Add missing include to fix FreeBSD build. 2026-03-12 21:35:30 -05:00
JMC47
d4e97f6bd7
Merge pull request #14409 from sepalani/tri-rw-log
AMMediaboard: Improve recv/send log messages
2026-03-12 21:51:29 -04:00
JMC47
2336753a24
Merge pull request #14408 from sepalani/tri-eagain
AMMediaboard: Check for EAGAIN in WSAGetLastError
2026-03-12 21:51:10 -04:00
JMC47
f0096310bf
Merge pull request #14452 from jordan-woyak/triforce-avalon-touchscreen
Triforce: Implement The Key of Avalon's touchscreen.
2026-03-12 21:49:08 -04:00
Jordan Woyak
12d790a54a
Merge pull request #14442 from Dentomologist/performancemetrics_use_state_changed_hookableevent
PerformanceMetrics: Use HookableEvent for state changed callback
2026-03-12 19:54:13 -05:00
JMC47
9143c4cc95
Merge pull request #14172 from sepalani/usb-iso-ret
IOS/USB: Add helper to set return values of IsoMessage's packets
2026-03-12 16:33:07 -04:00
Dentomologist
e550e1ff7c
Merge pull request #14345 from TryTwo/cheat_search_work
CheatSearch: Add ability to breakpoint the selected lines.
2026-03-12 12:35:51 -07:00
Dentomologist
e26b61dcee
Merge pull request #14440 from JosJuice/optimize-remove-page
Core: Optimize RemoveHostPageTableMappings
2026-03-12 12:31:53 -07:00
JMC47
161f9e82c1
Merge pull request #14427 from Simonx22/qt/cheats-gecko-download-error-message
DolphinQt: Improve Gecko code download failure message
2026-03-12 15:25:41 -04:00
JMC47
ff84a4b07a
Merge pull request #14426 from Simonx22/android/convert-afterdirectoryinitializationrunner-to-kotlin
Android: Convert AfterDirectoryInitializationRunner to Kotlin
2026-03-12 15:25:15 -04:00
JMC47
6257823caf
Merge pull request #14424 from Simonx22/android/wii-update-callback-kotlin
Android: Convert WiiUpdateCallback to Kotlin
2026-03-12 15:25:05 -04:00
JMC47
94c1891187
Merge pull request #14423 from Simonx22/android/convert-alertdialogitemsbuilder-to-kotlin
Android: Convert AlertDialogItemsBuilder to Kotlin
2026-03-12 15:24:49 -04:00
JMC47
e0ab156afd
Merge pull request #14422 from Simonx22/android/convert-tvsettingsviewholder-to-kotlin
Android: Convert TvSettingsViewHolder to Kotlin
2026-03-12 15:24:38 -04:00
JMC47
c5c1204eda
Merge pull request #14421 from Simonx22/android/convert-usbpermservice-to-kotlin
Android: Convert USBPermService to Kotlin
2026-03-12 15:24:24 -04:00
Jordan Woyak
cca880de16 State: Increase STATE_VERSION. 2026-03-12 03:58:01 -05:00
Jordan Woyak
3e8430440a Triforce: Implement The Key of Avalon's touchscreen.
Added SerialDevice base class interface.
Adapted MagneticCardReader to use the SerialDevice interface.
Implemented The Key of Avalon touchscreen SerialDevice.
Altered CSIDevice_AMBaseboard to use SerialDevice.
Made serial reads happen every GCAMCommand rather than only upon write.
2026-03-12 03:57:47 -05:00
JMC47
56b9b37ac8
Merge pull request #14406 from jordan-woyak/baseboard-minor-cleanups
SI_DeviceAMBaseboard: Minor cleanups.
2026-03-12 04:33:56 -04:00
Jordan Woyak
b77cf5e0f2 State: Increase STATE_VERSION. 2026-03-12 02:48:31 -05:00
Jordan Woyak
b1000496a2 SI_DeviceAMBaseboard: Clean up RunBuffer.
Eliminated outer loop.
Reduced memcpy'ing.
2026-03-12 02:48:07 -05:00
Jordan Woyak
4fa93e402d SI/SI_DeviceAMBaseboard: Expose the buffer size of 128 to eliminate some magic numbers. 2026-03-12 02:48:07 -05:00
Jordan Woyak
1234a4e479 SI_DeviceAMBaseboard: Use CreateStatusResponse to fix "RunSIBuffer: expected_response_length" WARN_LOGs. 2026-03-12 02:48:07 -05:00
Jordan Woyak
8da0a94ab9 SI_DeviceAMBaseboard: Add baseboard 0x70 command to SerialInterface::EBufferCommands enum to eliminate BaseBoardCommand enum. 2026-03-12 02:48:07 -05:00
Jordan Woyak
cda384d40f SI_DeviceAMBaseboard: Remove unnecessary code. 2026-03-12 02:48:07 -05:00
Jordan Woyak
fe2d604060
Merge pull request #14401 from naari3/master
AMMediaboard: stub Triforce NETWORK TEST command handling
2026-03-12 02:47:37 -05:00
OatmealDome
899124466c
Merge branch 'release-prep-2603' 2026-03-12 00:35:33 -04:00
OatmealDome
d8558142ea
ScmRevGen: Bump version to 2603 2026-03-11 19:36:49 -04:00
JosJuice
30a735aa6f Translation resources sync with Transifex 2026-03-09 22:57:38 +01:00
Dentomologist
252ec7452c PerformanceMetrics: Use HookableEvent for state changed callback
Use the normal state changed `HookableEvent` instead of having
`Core::NotifyStateChanged` call `g_perf_metrics.OnEmulationStateChanged`
directly.

The direct call was added in bad78cfed4 to
avoid a crash. At the time state changed callbacks were stored in a
vector, and the crash was caused by `g_perf_metric`'s destructor trying
to remove the callback from the already-destroyed vector.

Later a97627e736 switched state changed
callbacks to use `HookableEvent`, which is specifically designed to
handle the case where a hook outlives its associated event.

Since the workaround is no longer necessary replace it with a standard
`EventHook`.
2026-03-07 12:50:59 -08:00
JosJuice
a3b37c041a Core: Optimize RemoveHostPageTableMappings
This switches from an O(log(N) * M) algorithm to an O(N * log(M))
algorithm. This is advantageous because N, the size of `mappings`, is
usually much smaller than M, the size of `m_page_table_mapped_entries`.

RemoveLargePageTableMapping already did something similar, so we can
even deduplicate some code between it and RemoveHostPageTableMappings.

Speeds up Rogue Squadron 3 by roughly 3% on my PC.
2026-03-07 12:56:36 +01:00
Dentomologist
49d5299f1e
Merge pull request #14438 from JosJuice/save-on-settings-close
DolphinQt: Save when closing settings window
2026-03-04 18:31:55 -08:00
JosJuice
d25ef67d6f DolphinQt: Save when closing settings window
If Dolphin crashes, changes that have been made to settings are often
lost. This has been a minor annoyance for me when developing, but it has
become a much bigger issue recently due to the problem where Dolphin
freezes on shutdown for ROG Ally users.

Instead of saving the config when certain arbitrary settings are
changed, let's save the config when the user closes the settings window.
2026-03-04 22:26:25 +01:00
JMC47
239c4e444c
Merge pull request #14279 from jordan-woyak/nfs-hp2-speedhack
GameSettings: Add patches for Need for Speed: Hot Pursuit 2 to limit the internal frame rate.
2026-03-04 00:35:45 -05:00
JMC47
aa1c198325
Merge pull request #14297 from jordan-woyak/speedhack-stunt-racer
GameSettings: Add patch to limit framerate in Monster 4x4: Stunt Racer.
2026-03-03 16:12:55 -05:00