dolphin-arm64: Use the arm64 msvc mkspec#23
Conversation
|
What's going on with the line endings in the headers? Is that LF -> CRLF or CRLF -> LF? |
Apparently carriage returns were added. Those files were pulled by qsc, so I'm not sure if I should change that? edit: For consistency sake, I've matched the line endings |
|
I guess whoever committed this last might have had automatic line ending conversion enabled in git? I don't know which line ending we would prefer here, though. |
|
I'm not sure if the |
This introduces a CMakePresets file for both Linux and Windows that replace the old CMakeSettings.
It adds presets for **Debug** and **Release** profiles for both **x64** and **ARM64** architectures, and can be used using Visual Studio's built-in CMakePresets support, or Visual Studio Code's CMake Tools extension.
They can also be used from the command line, like so:
x64/Linux:
Configure: `cmake --preset unix-release-x64`
Build: `cmake --build --preset unix-build-release-x64`
ARM64/Windows:
Configure: `cmake --preset windows-release-arm64`
Build: `cmake --build --preset windows-build-release-arm64`
**Cross-compiling**
On Windows, the Visual Studio generator automatically takes care of selecting the cross-compiler if required.
On Linux, the Ninja generator is used. 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 unix-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 unix-build-release-arm64`
You will need a sysroot to link against Qt, since we do not vendor it in on platforms other than Windows.
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": 9,
"include": ["CMakePresets.json"],
"configurePresets": [
{
"name": "gcc-debug-arm64",
"inherits": "unix-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": "unix-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"
}
}
],
"buildPresets": [
{
"name": "gcc-build-debug-arm64",
"configurePreset": "gcc-debug-arm64"
},
{
"name": "clang-build-debug-arm64",
"configurePreset": "clang-debug-arm64"
}
]
}
```
This allows the `clang-debug-arm64` and `gcc-debug-arm64` configure presets, as well as the `clang-build-debug-arm64` and `gcc-build-debug-arm64` build presets to work.
This should also make it trival to cross-compile from Linux to FreeBSD and vice-versa, however this is untested.
**Unified Build Layout**
This also unites the Windows and Linux CMake builds **which is a breaking change!**
- They now both share the same output directories under `build/<ARCHITECTURE>`
- Linux builds now also have the `Sys` and `Languages` folder automatically copied over
- Binaries are now always "relocatable", removing the need for the LINUX_LOCAL_DEV option to exist
---
Depends on:
- dolphin-emu#14176
- dolphin-emu#14173
- dolphin-emu/ext-win-qt#23
This introduces a CMakePresets file for both Linux and Windows that replace the old CMakeSettings.
It adds presets for **Debug** and **Release** profiles for both **x64** and **ARM64** architectures, and can be used using Visual Studio's built-in CMakePresets support, or Visual Studio Code's CMake Tools extension.
They can also be used from the command line, like so:
x64/Linux:
Configure: `cmake --preset unix-release-x64`
Build: `cmake --build --preset unix-build-release-x64`
ARM64/Windows:
Configure: `cmake --preset windows-release-arm64`
Build: `cmake --build --preset windows-build-release-arm64`
**Cross-compiling**
On Windows, the Visual Studio generator automatically takes care of selecting the cross-compiler if required.
On Linux, the Ninja generator is used. 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 unix-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 unix-build-release-arm64`
You will need a sysroot to link against Qt, since we do not vendor it in on platforms other than Windows.
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": 9,
"include": ["CMakePresets.json"],
"configurePresets": [
{
"name": "gcc-debug-arm64",
"inherits": "unix-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": "unix-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"
}
}
],
"buildPresets": [
{
"name": "gcc-build-debug-arm64",
"configurePreset": "gcc-debug-arm64"
},
{
"name": "clang-build-debug-arm64",
"configurePreset": "clang-debug-arm64"
}
]
}
```
This allows the `clang-debug-arm64` and `gcc-debug-arm64` configure presets, as well as the `clang-build-debug-arm64` and `gcc-build-debug-arm64` build presets to work.
This should also make it trival to cross-compile from Linux to FreeBSD and vice-versa, however this is untested.
**Unified Build Layout**
This also unites the Windows and Linux CMake builds **which is a breaking change!**
- They now both share the same output directories under `build/<ARCHITECTURE>`
- Linux builds now also have the `Sys` and `Languages` folder automatically copied over
- Binaries are now always "relocatable", removing the need for the LINUX_LOCAL_DEV option to exist
---
Depends on:
- dolphin-emu#14176
- dolphin-emu#14173
- dolphin-emu/ext-win-qt#23
This introduces a CMakePresets file for both Linux and Windows that replace the old CMakeSettings.
It adds presets for **Debug** and **Release** profiles for both **x64** and **ARM64** architectures, and can be used using Visual Studio's built-in CMakePresets support, or Visual Studio Code's CMake Tools extension.
They can also be used from the command line, like so:
x64/Linux:
Configure: `cmake --preset unix-release-x64`
Build: `cmake --build --preset unix-build-release-x64`
ARM64/Windows:
Configure: `cmake --preset windows-release-arm64`
Build: `cmake --build --preset windows-build-release-arm64`
**Cross-compiling**
On Windows, the Visual Studio generator automatically takes care of selecting the cross-compiler if required.
On Linux, the Ninja generator is used. 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 unix-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 unix-build-release-arm64`
You will need a sysroot to link against Qt, since we do not vendor it in on platforms other than Windows.
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": 9,
"include": ["CMakePresets.json"],
"configurePresets": [
{
"name": "gcc-debug-arm64",
"inherits": "unix-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": "unix-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"
}
}
],
"buildPresets": [
{
"name": "gcc-build-debug-arm64",
"configurePreset": "gcc-debug-arm64"
},
{
"name": "clang-build-debug-arm64",
"configurePreset": "clang-debug-arm64"
}
]
}
```
This allows the `clang-debug-arm64` and `gcc-debug-arm64` configure presets, as well as the `clang-build-debug-arm64` and `gcc-build-debug-arm64` build presets to work.
This should also make it trival to cross-compile from Linux to FreeBSD and vice-versa, however this is untested.
**Unified Build Layout**
This also unites the Windows and Linux CMake builds **which is a breaking change!**
- They now both share the same output directories under `build/<ARCHITECTURE>`
- Linux builds now also have the `Sys` and `Languages` folder automatically copied over
- Binaries are now always "relocatable", removing the need for the LINUX_LOCAL_DEV option to exist
---
Depends on:
- dolphin-emu#14176
- dolphin-emu#14173
- dolphin-emu/ext-win-qt#23
|
On a related note, there does seem to be an issue with cross compiling as the QT version provided with ming (as of current it is 6.10.1.0) is much newer than the code we have here which is 6.5.1, as it complains about some missing symbols, I haven't looked into this in detail yet as I simply copied over the newer DLLS to resolve the issue so I could run my ming compiled Dolphin binary. |
4a94589 to
831a3e6
Compare
Some files are missing for Qt6 to cross-compile from x64 to arm64 using CMake.
The only modified file is dolphin-arm64.yml, the rest of the diff is me recompiling.
Part of dolphin-emu/dolphin#14475
The qsc examples have been updated here dolphin-emu/qsc#2