From 7e730a121bfa0539cbb132b0b0e19eb182840581 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Sat, 15 Nov 2025 17:53:13 +0100 Subject: [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 Reviewed-by: MaranBr Co-authored-by: Caio Oliveira Co-committed-by: Caio Oliveira --- docs/Build.md | 46 +++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 17 deletions(-) (limited to 'docs/Build.md') diff --git a/docs/Build.md b/docs/Build.md index 52a671ab1e..0bb70ee322 100644 --- a/docs/Build.md +++ b/docs/Build.md @@ -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 -### Command Line - -This is recommended for *BSD, Solaris, Linux, and MSYS2. MSVC is possible, but not recommended. +### Option B: Command Line
Click to Open -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 ``) +>- 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 ``: - 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 ``: +- `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= -DYUZU_TESTS=OFF +cmake -S . -B build -G "" -DCMAKE_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 "" -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl ```
-### [CLion](https://www.jetbrains.com/clion/) +### Option C: [CLion](https://www.jetbrains.com/clion/)
Click to Open @@ -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 ``, 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. \ No newline at end of file +macOS scripts will come soon. -- cgit v1.2.3