You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: getting-started/ide-setup.md
+50-19
Original file line number
Diff line number
Diff line change
@@ -128,43 +128,74 @@ If there are errors similar to VS Code (such as `#include <Geode/modify/MenuLaye
128
128
129
129
# CLion
130
130
131
-
No additional plugins are needed - the only thing you need to do is to set the CMake options correctly. When you open your mod's directory in CLion for the first time, you'll be met with an Open Project Wizard:
131
+
*[CLion on Windows](#clion-on-windows)
132
+
*[CLion on Linux](#clion-on-linux)
133
+
134
+
## CLion on Windows
135
+
136
+
No additional plugins are needed - the only thing you need to do is to configure your toolchain correctly. When you open your mod's directory in CLion for the first time, you'll be met with an Open Project Wizard:
132
137
133
138

134
139
135
-
Here you need to make sure that:
140
+
If this is the first time you're launching CLion, click the "Manage toolchains..." button, which will open a window where you can add a new toolchain.
141
+
142
+
Here's an example of how to set up Visual Studio toolchain:
143
+
144
+

145
+
146
+
And here's an example of how to set up Clang toolchain:
136
147
137
-
1. Build type is set to `Release` or `RelWithDebInfo`; it cannot be Debug
138
-
2. Toolchain is set to *Visual Studio*
139
-
3. Generator is set to *Visual Studio 17 2022* or newer
140
-
4. Build directory is set to *build*
148
+

149
+
150
+
After that, in the Open Project Wizard, you need to make sure that:
151
+
152
+
1. Build type is set to `Release` or `RelWithDebInfo` (we recommend `RelWithDebInfo`, since `Debug` might cause obscure crashes)
153
+
2. Toolchain is set to *Visual Studio* or *Clang/LLVM*
154
+
3. Generator is set to *Visual Studio 17 2022* or *Ninja* (if you have it installed)
141
155
142
156
In the end it should look like this:
143
157
144
158

145
159
146
-
Now you can press OK and CMake will run for the first time. The setup **will fail** until you build the project for the first time. In order to do that, go to the top right corner of the window where you'll see a dropdown saying `Add Configuration`.
160
+
Now you can press OK and CMake will run for the first time. Wait until it finishes, and you should see a dropdown in the top right corner of the window that says `NameOfTheMod` (or whatever you called your project).
161
+
Click on it, and pick `NameOfTheMod_PACKAGE` instead, which will trigger post build steps and package/install the mod to Geometry Dash.
162
+
163
+

164
+
165
+
Now click the hammer icon in the top right corner next to build the mod:
166
+
167
+

168
+
169
+
The build should end with a message saying `Build finished` and (assuming you ran `geode config setup` before) the mod should now be installed to Geometry Dash.
147
170
148
-

171
+
Don't forget to reload CMake after you add new files to the project.
172
+
173
+

149
174
150
-
Click it and choose `Edit Configurations` and you'll be met with the Run/Debug Configurations window. Inside of it, click the plus button in the top left corner of the window and choose `CMake Application` from the popup:
175
+
## CLion on Linux
151
176
152
-

177
+
Pretty much the same as on [Windows](#clion-on-windows) except for setting up the toolchain.
153
178
154
-
In the created configuration, click the `Target` dropdown and choose `All Targets`. You can also change the name to something else than "Unnamed".
179
+
First step is to create an environment file with the following content:
155
180
156
-

Once that's done, you can click Apply and then OK. If it hasn't already, wait for CMake to finish its run. It might look something like this, with a line at the end saying `[Failed to reload]`.
188
+
If the toolchain and/or splat weren't installed via `geode sdk install-linux`, modify the paths accordingly.
159
189
160
-

190
+
Save it as `geode-env.sh` in your home directory (or wherever you want, just remember the path).
161
191
162
-
Now click the hammer icon in the top right corner next to build the mod for the first time - **make sure that the dropdowns next to it say `RelWithDebInfo` and `Build Mod`** (or however you called your build task in the step before):
192
+
> :warning: If you're using a non default shell (like fish), you might need to edit the environment file to use the correct syntax. For example, fish uses `set -gx VAR value` instead of `export VAR=value`.
163
193
164
-

194
+
Now, in the toolchain settings on the right side of the **Name** field, click the *Add environment*button and select the file you just created.
165
195
166
-
The build should end with a message saying `Build finished` and (assuming you ran `geode config setup` before) the mod should now be installed to Geometry Dash. In order to make all the IDE features work correctly, reload CMake now, this run should end successfully with a message saying `[Finished]` at the end:
196
+

167
197
168
-

198
+
After that, you can follow the same steps as on Windows to build your mod.
169
199
170
-
Don't forget to reload CMake after you add new files to the project.
200
+
For some specific mods/libraries (most people won't need this), you might also want to add the clang-cl toolchain. Everything is the same as with clang, except you have to use the `clang-cl-msvc.cmake` toolchain file instead. (Copy the environment file and change the `CMAKE_TOOLCHAIN_FILE` variable to point to the `clang-cl-msvc.cmake` file.)
201
+
Also make sure you're using `clang-cl` as the compiler in the toolchain settings.
0 commit comments