mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-10 07:38:56 +02:00
[tools] MSVC environment loader, POSIX vulkan/MSVC install scripts (#2993)
* also move install-vulkan-sdk.ps1 to tools Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2993 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Co-committed-by: Caio Oliveira <caiooliveirafarias0@gmail.com>
This commit is contained in:
parent
680384f7b8
commit
7e730a121b
9 changed files with 595 additions and 29 deletions
|
|
@ -26,7 +26,7 @@ Android has a completely different build process than other platforms. See its [
|
|||
|
||||
If the configure phase fails, see the `Troubleshooting` section below. Usually, as long as you followed the dependencies guide, the defaults *should* successfully configure and build.
|
||||
|
||||
### Qt Creator
|
||||
### Option A: Qt Creator
|
||||
|
||||
This is the recommended GUI method for Linux, macOS, and Windows.
|
||||
|
||||
|
|
@ -46,39 +46,51 @@ Hit "Configure Project", then wait for CMake to finish configuring (may take a w
|
|||
|
||||
</details>
|
||||
|
||||
### Command Line
|
||||
|
||||
This is recommended for *BSD, Solaris, Linux, and MSYS2. MSVC is possible, but not recommended.
|
||||
### Option B: Command Line
|
||||
|
||||
<details>
|
||||
<summary>Click to Open</summary>
|
||||
|
||||
Note that CMake must be in your PATH, and you must be in the cloned Eden directory. On Windows, you must also set up a Visual C++ development environment. This can be done by running `C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat` in the same terminal.
|
||||
|
||||
Recommended generators:
|
||||
> [!WARNING]
|
||||
>For all systems:
|
||||
>- *CMake* **MUST** be in your PATH (and also *ninja*, if you are using it as `<GENERATOR>`)
|
||||
>- You *MUST* be in the cloned *Eden* directory
|
||||
>
|
||||
>On Windows:
|
||||
> - It's recommended to install **[Ninja](https://ninja-build.org/)**
|
||||
> - You must load **Visual C++ development environment**, this can be done by running our convenience script:
|
||||
> - `tools/windows/load-msvc-env.ps1` (for PowerShell 5+)
|
||||
> - `tools/windows/load-msvc-env.sh` (for MSYS2, Git Bash, etc)
|
||||
|
||||
Available `<GENERATOR>`:
|
||||
- MSYS2: `MSYS Makefiles`
|
||||
- MSVC: Install **[ninja](https://ninja-build.org/)** and use `Ninja`, OR use `Visual Studio 17 2022`
|
||||
- MSVC: `Ninja` (preferred) or `Visual Studio 17 2022`
|
||||
- macOS: `Ninja` (preferred) or `Xcode`
|
||||
- Others: `Ninja` (preferred) or `UNIX Makefiles`
|
||||
|
||||
BUILD_TYPE should usually be `Release` or `RelWithDebInfo` (debug symbols--compiled executable will be large). If you are using a debugger and annoyed with stuff getting optimized out, try `Debug`.
|
||||
Available `<BUILD_TYPE>`:
|
||||
- `Release` (default)
|
||||
- `RelWithDebInfo` (debug symbols--compiled executable will be large)
|
||||
- `Debug` (if you are using a debugger and annoyed with stuff getting optimized out)
|
||||
|
||||
Caveat for Debug Builds:
|
||||
- If you're building with CCache, you will need to add the environment variable `CL` with the `/FS` flag ([Reference](https://learn.microsoft.com/pt-br/cpp/build/reference/fs-force-synchronous-pdb-writes?view=msvc-170))
|
||||
|
||||
Also see the [Options](Options.md) page for additional CMake options.
|
||||
|
||||
```sh
|
||||
cmake -S . -B build -G "GENERATOR" -DCMAKE_BUILD_TYPE=<BUILD_TYPE> -DYUZU_TESTS=OFF
|
||||
cmake -S . -B build -G "<GENERATOR>" -DCMAKE_BUILD_TYPE=<BUILD_TYPE> -DYUZU_TESTS=OFF
|
||||
```
|
||||
|
||||
If you are on Windows and prefer to use Clang:
|
||||
|
||||
```sh
|
||||
cmake -S . -B build -G "GENERATOR" -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl
|
||||
cmake -S . -B build -G "<GENERATOR>" -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### [CLion](https://www.jetbrains.com/clion/)
|
||||
### Option C: [CLion](https://www.jetbrains.com/clion/)
|
||||
|
||||
<details>
|
||||
<summary>Click to Open</summary>
|
||||
|
|
@ -133,13 +145,13 @@ Many platforms have quirks, bugs, and other fun stuff that may cause issues when
|
|||
|
||||
## Building & Running
|
||||
|
||||
### Qt Creator
|
||||
### On Qt Creator
|
||||
|
||||
Simply hit Ctrl+B, or the "hammer" icon in the bottom left. To run, hit the "play" icon, or Ctrl+R.
|
||||
|
||||
### Command Line
|
||||
### On Command Line
|
||||
|
||||
If you are not on Windows and are using the `UNIX Makefiles` generator, you must also add `-j$(nproc)` to this command.
|
||||
If you are using the `UNIX Makefiles` or `Visual Studio 17 2022` as `<GENERATOR>`, you should also add `--parallel` for faster build times.
|
||||
|
||||
```
|
||||
cmake --build build
|
||||
|
|
@ -157,4 +169,4 @@ Some platforms have convenience scripts provided for building.
|
|||
- **[Linux](scripts/Linux.md)**
|
||||
- **[Windows](scripts/Windows.md)**
|
||||
|
||||
macOS scripts will come soon.
|
||||
macOS scripts will come soon.
|
||||
|
|
|
|||
22
docs/Deps.md
22
docs/Deps.md
|
|
@ -3,10 +3,13 @@
|
|||
To build Eden, you MUST have a C++ compiler.
|
||||
* On Linux, this is usually [GCC](https://gcc.gnu.org/) 11+ or [Clang](https://clang.llvm.org/) v14+
|
||||
- GCC 12 also requires Clang 14+
|
||||
* On Windows, this is either:
|
||||
- **[MSVC](https://visualstudio.microsoft.com/downloads/)** (you should select *Community* option),
|
||||
- clang-cl - can be downloaded from the MSVC installer,
|
||||
- or **[MSYS2](https://www.msys2.org)**
|
||||
* On Windows, we support:
|
||||
- **[MSVC](https://visualstudio.microsoft.com/downloads/)** (default)
|
||||
- It's STRONGLY RECOMMENDED to use the **Community** option and **Visual Studio 2022**
|
||||
- You need to install: **[Desktop development with C++](https://learn.microsoft.com/en-us/cpp/build/vscpp-step-0-installation?view=msvc-170)**
|
||||
- **[clang-cl](https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-180)**
|
||||
- You need to install: **C++ Clang tools for Windows**
|
||||
- **[MSYS2](https://www.msys2.org)** (experimental)
|
||||
* On macOS, this is Apple Clang
|
||||
- This can be installed with `xcode-select --install`
|
||||
|
||||
|
|
@ -15,20 +18,23 @@ The following additional tools are also required:
|
|||
* **[CMake](https://www.cmake.org/)** 3.22+ - already included with the Android SDK
|
||||
* **[Git](https://git-scm.com/)** for version control
|
||||
- **[Windows installer](https://gitforwindows.org)**
|
||||
* **[Python3](https://www.python.org/downloads/)** 3.10+ - necessary to download external repositories
|
||||
* On Windows, you must install the **[Vulkan SDK](https://vulkan.lunarg.com/sdk/home#windows)** as well
|
||||
- *A convenience script to install the latest SDK is provided in `.ci/windows/install-vulkan-sdk.ps1`*
|
||||
- *A convenience script to install the latest SDK is provided in:*
|
||||
- `tools/windows/install-vulkan-sdk.ps1` (for PowerShell 5+)
|
||||
- `tools/windows/install-vulkan-sdk.sh` (for MSYS2, Git Bash, etc)
|
||||
|
||||
If you are on desktop and plan to use the Qt frontend, you *must* install Qt 6, and optionally Qt Creator (the recommended IDE for building)
|
||||
If you are on desktop and plan to use the Qt frontend, you *must* install Qt 6, and optionally Qt Creator (the **RECOMMENDED** IDE for building)
|
||||
* On Linux, *BSD and macOS, this can be done by the package manager
|
||||
- If you wish to use Qt Creator, append `qtcreator` or `qt-creator` to the commands seen below.
|
||||
* MSVC/clang-cl users on Windows must install through the [official installer](https://www.qt.io/download-qt-installer-oss)
|
||||
* MSVC/clang-cl users on Windows must install through the official [Qt](https://www.qt.io/download-qt-installer-oss) installer
|
||||
* Linux and macOS users may choose to use the installer as well.
|
||||
* MSYS2 can also install Qt 6 via the package manager
|
||||
|
||||
If you are on Windows, a convenience script to install MSVC, MSYS2, Qt, all necessary packages for MSYS2, and set up a zsh environment with useful keybinds and aliases can be found [here](https://git.crueter.xyz/scripts/windev).
|
||||
- For help setting up Qt Creator, run `./install.sh -h qtcreator`
|
||||
|
||||
If you are on Windows and NOT building with MSYS2, you may go [back home](Build.md) and continue.
|
||||
If you are on **Windows** and building with **MSVC** or **clang-cl**, you may go [back home](Build.md) and continue.
|
||||
|
||||
## Externals
|
||||
The following are handled by Eden's externals:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue