CLion

CLion ist eine kommerzielle JetBrains IDE für C++.

Projekt importieren

CLion benötigt eine CMakeLists.txt Datei als Projektdatei, was für Godot problematisch ist, da es das SCons Buildsystem anstelle von CMake verwendet. Es gibt jedoch eine CMakeLists.txt-Konfiguration für Android Studio, die auch von CLion verwendet werden kann.

  • Wählen Sie im Begrüßungsfenster von CLion die Option zum Importieren eines bestehenden Projekts. Wenn Sie bereits ein anderes Projekt geöffnet haben, wählen Sie Datei > Öffnen aus dem oberen Menü.

  • Navigieren Sie zu <Godot-Stammverzeichnis>/platform/android/java/nativeSrcsConfigs (die Datei CMakeLists.txt befindet sich dort) und wählen Sie sie aus (aber nicht die Datei CMakeLists.txt selbst), dann klicken Sie OK.

../../../_images/clion_1_open.png

Der Ordner, der die Datei CMakeLists.txt enthält.

  • Wenn dieses Popup-Fenster erscheint, wählen Sie Dieses Fenster, um das Projekt zu öffnen:

../../../_images/clion_2_this_window.png
  • Wählen Sie Tools > CMake > Change Project Root aus dem oberen Menü und wählen Sie den Godot-Stammordner.

../../../_images/clion_3_change_project_root.png
  • You should be now be able to see all the project files. Autocomplete should work once the project has finished indexing.

Wenn Sie auf Probleme stoßen, bitten Sie um Hilfe in einem von Godots Community-Kanälen.

Debuggen des Projekts

Since CLion does not support SCons, you won't be able to compile, launch, and debug Godot from CLion in one step. You will first need to compile godot yourself and run the binary without CLion. You will then be able to debug Godot by using the Attach to process feature.

  • Führen Sie die Kompilierung im Debug-Modus aus, indem Sie scons eingeben.

  • Run the binary you have created (in the bin directory). If you want to debug a specific project, run the binary with the following arguments : --editor --path path/to/your/godot/project. To run the project instead of editing it, remove the --editor argument.

  • Gehen Sie in CLion zu Ausführen > An Prozess anhängen...

../../../_images/clion_4_select_attach_to_process.png
  • Find and Select godot in the list (or type the binary name/Process ID)

../../../_images/clion_5_select_godot_process.png

Sie können nun die Debugging-Tools von CLion verwenden.

Bemerkung

If you run the binary without any arguments, you will only debug the project manager window. Don't forget to add the --path path/to/your/godot/project argument to debug a project.