Skip to content

Commit 9d78f0a

Browse files
committed
update guide to recommend clang
1 parent 04b5410 commit 9d78f0a

File tree

3 files changed

+38
-14
lines changed

3 files changed

+38
-14
lines changed

assets/vs_installer.png

99.9 KB
Loading

getting-started/cpp-stuff.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,30 @@ To be able to use the Geode SDK, you **will** need at least the following:
1313
## Compiler
1414

1515
To use the Geode SDK, and in turn make Geometry Dash mods, you will need either:
16-
* [Visual Studio 2022+](#windows) on Windows
16+
* [Clang](#windows-clang) (recommended) or [Visual Studio 2022+](#windows-visual-studio) on Windows
1717
* [Clang](#macos) on MacOS
1818
* [A secret third thing](#linux) on Linux
1919

20-
### Windows
20+
### Windows (Clang)
2121

22-
Download Visual Studio from [its website](https://visualstudio.microsoft.com/downloads/). If you want **just** the compiler and not the code editor, look for *Build Tools for Visual Studio* further down in the page.
22+
First, install [LLVM](https://github.com/llvm/llvm-project) and [Ninja](https://github.com/ninja-build/ninja). The easiest way is using Scoop:
23+
```
24+
scoop install llvm ninja
25+
```
2326

24-
After launching the installer, select **Desktop development with C++**. You may choose other features, but you **will** need at least ***MSVC*** and ***Windows SDK*** installed.
27+
LLVM itself does not come with Windows SDK and CRT libraries, so you will need a minimal Visual Studio install for these, which is described in the next section.
2528

26-
Once Visual Studio is installed, you should now have a working C++ compiler that is suited for GD mod development.
29+
### Windows (Visual Studio)
30+
31+
Please note that Visual Studio **2022** or higher is required. If you have an older version already installed, you should upgrade to the latest available.
2732

28-
Please note that Visual Studio **2022** or higher is required. 2019 or lower will not work, as they don't support C++20 properly.
33+
Unless you want to install Visual Studio (the editor) itself, we recommend installing just the build tools. Open the VS [download page](https://visualstudio.microsoft.com/downloads), scroll to the bottom, and under "Tools for Visual Studio" download **Build Tools for Visual Studio**.
34+
35+
After launching the installer, select **Desktop development with C++** and optionally deselect all features except for **MSVC Build Tools** and **Windows SDK**, like on the screenshot below. Click Install and wait for it to finish.
36+
37+
![Image showing VS installer](/assets/vs_installer.png)
38+
39+
Once Visual Studio is installed, you should now have a working C++ compiler that is suited for GD mod development.
2940

3041
### MacOS
3142

getting-started/ide-setup.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,39 @@ You can use one of the following IDEs for developing Geode mods. Using an IDE is
1919

2020
## VSCode on Windows
2121

22-
For VS Code, we recommend a few extensions:
23-
* [`C/C++`](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools)
22+
Install the following VSCode extensions:
2423
* [`CMake Tools`](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools)
2524
* [`Geode`](https://marketplace.visualstudio.com/items?itemName=GeodeSDK.geode) - Not required, but will provide some nice features.
2625

26+
As well as one of:
27+
* [`clangd`](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd) - **if using Clang as compiler**
28+
* [`C/C++`](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) - **if using MSVC / Visual Studio as compiler**
29+
2730
There are a few steps you should follow to get proper intellisense and code completion (you should only need to do these once per project, ideally):
2831

29-
1. With VS Code open on your project, press F1 and run `CMake: Select a Kit`. This will bring up a list of installed compilers on your machine.
32+
1. With VS Code open on your project, press F1 and run `CMake: Select a Kit`. This will bring up a list of installed compilers on your machine. This will also open automatically whenever opening a new project.
3033

3134
![Image showing a bunch of compilers CMake detected in VS Code](/assets/win_compilers.png)
3235

33-
You should pick a **Visual Studio 2022+** compiler (specifically the `amd64` version), or Clang, but nothing else!
34-
35-
> :warning: Please pay attention to this
36+
Depending on which compiler you want to use, pick either:
37+
* **Clang** (not `Clang-cl`) - recommended
38+
* **Visual Studio 20xx Release - amd64** (not `amd64_x86` or any other ones)
3639

37-
2. Now to select the build variant, press F1 and run `CMake: Select Variant`. We recommend **RelWithDebInfo** for easier debugging, as Debug may sometimes cause obscure crashes.
40+
2. Now to select the build variant, press F1 and run `CMake: Select Variant`. We recommend **RelWithDebInfo** for easier debugging, as **Debug** may sometimes cause obscure crashes.
3841

3942
![Image showing available build types on Windows: Debug, Release, MinSizeRel, and RelWithDebInfo](/assets/win_relwithdebinfo.png)
4043

41-
3. Register CMake as the **Configuration Provider** for the C++ extension by pressing F1 and running `C/C++: Edit Configurations (UI)`. Scroll down to **Advanced** options, and set the Configuration Provider as `ms-vscode.cmake-tools`.
44+
3. If using **Clang** with the **clangd** extension, press F1 and run `CMake: Edit User-Local CMake Kits`. This will open a file, in there find the chosen kit (one with Clang in the name) and add these keys to it:
45+
```json
46+
"cmakeSettings": {
47+
"CMAKE_EXPORT_COMPILE_COMMANDS": 1
48+
},
49+
"preferredGenerator": {
50+
"name": "Ninja"
51+
}
52+
```
53+
54+
4. If instead of Clang you chose the **C/C++ extension**, you need to register CMake as the **Configuration Provider** for the C++ extension by pressing F1 and running `C/C++: Edit Configurations (UI)`. Scroll down to **Advanced** options, and set the Configuration Provider as `ms-vscode.cmake-tools`.
4255

4356
![Image showing the "C/C++: Edit Configurations (UI)" command being run in VS Code](/assets/win_usecmake.png)
4457

0 commit comments

Comments
 (0)