Skip to content

Conversation

@van800
Copy link
Contributor

@van800 van800 commented Aug 14, 2025

Automatically resolves C++ standard libraries.
I have tested on Mac and Windows.

@van800 van800 changed the title sln, vcxproj, props and targets for Rider to work on all OS everything required to work on a GDExtension in Rider x-plat, C++ standard libraries are automatically resolved Aug 15, 2025
@van800 van800 changed the title everything required to work on a GDExtension in Rider x-plat, C++ standard libraries are automatically resolved everything required to work on a GDExtension in Rider x-plat Aug 15, 2025
@paddy-exe paddy-exe added the enhancement New feature or request label Aug 18, 2025
Copy link
Contributor

@dsnopek dsnopek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these configurations intended for building godot-cpp for working on godot-cpp itself? Or, are these intended for developers creating an extension that uses godot-cpp?

Can you provide some information on how these are meant to be used by developers and how we can maintain them over time?

Since I don't personally understand how these files work, I'm wary of merging this without more information

<NMakeReBuildCommandLine>echo Starting SCons &amp; scons --directory=&quot;$(ProjectDir.TrimEnd(&apos;\&apos;))&quot; dev_build=yes</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>echo Starting SCons &amp; scons --clean --directory=&quot;$(ProjectDir.TrimEnd(&apos;\&apos;))&quot; dev_build=yes</NMakeCleanCommandLine>
<NMakeOutput Condition="'$(NMakeOutput)' == ''">bin/godot.macos.editor.dev</NMakeOutput>
<NMakePreprocessorDefinitions>TOOLS_ENABLED;DEBUG_ENABLED;DEV_ENABLED;ENGINE_UPDATE_CHECK_ENABLED;NO_EDITOR_SPLASH;ACCESSKIT_DYNAMIC;ACCESSKIT_ENABLED;MACOS_ENABLED;UNIX_ENABLED;COREAUDIO_ENABLED;COREMIDI_ENABLED;GLES3_ENABLED;METAL_ENABLED;RD_ENABLED;VULKAN_ENABLED;MINIZIP_ENABLED;BROTLI_ENABLED;THREADS_ENABLED;CLIPPER2_ENABLED;ZLIB_DEBUG;ZSTD_STATIC_LINKING_ONLY;VK_USE_PLATFORM_MACOS_MVK;VK_USE_PLATFORM_METAL_EXT;GLAD_ENABLED;EGL_ENABLED;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these defines appear to be from Godot rather than godot-cpp? Like ACCESSKIT_ENABLED, COREMIDI_ENABLED, etc

However, I'm not sure what this file are used for

@van800
Copy link
Contributor Author

van800 commented Aug 20, 2025

I see, what you mean. Thank you.
It is intended for developers creating an extension that uses godot-cpp
NMakePreprocessorDefinitions here is copy-paste from the engine. I will drop it.
I will make other changes too, completely forgot about scenarios like compiling gdextension for a different platform and arch. And I will add comments

@dsnopek
Copy link
Contributor

dsnopek commented Aug 20, 2025

I wonder if this might be better as a community-maintained template for users of Rider?

I don't know if anyone on the GDExtension team uses Rider, and would be able to test PRs for it or maintain it going foward. Whereas a small community of enthusiastic users of Rider could take that on

@van800
Copy link
Contributor Author

van800 commented Aug 21, 2025

It is up to you to decide if you'd like to incorporate the proposed changes.

Kapture.2025-08-21.at.14.37.17.mp4

A bit of me struggling with typing code. But the experience of GDExtension and the game in one place might be very good after all. (GodotEditor should be running all the time)

@fire fire changed the title everything required to work on a GDExtension in Rider x-plat Dependencies for the GDExtension Rider platform Aug 21, 2025
@van800
Copy link
Contributor Author

van800 commented Aug 28, 2025

Added a fix for Cpp debugging to work.
image

@van800 van800 changed the title Dependencies for the GDExtension Rider platform IDE project configuration for developing Godot GDExtensions using JetBrains Rider Aug 29, 2025
@dsnopek
Copy link
Contributor

dsnopek commented Sep 2, 2025

Discussed at the GDExtension team meeting, and we're a little wary of adding so much code for Rider support. We'd prefer either:

  1. Adding something to SCons (in godot-cpp) to generate these files (similar to scons vsproj=true in the Godot project) or a shell script or even docs for how to generate these files. Or,
  2. Adding a page to the documentation for developers about how to set this up for themselves (similar to these docs for the Godot project). Or,
  3. Adding the minimum files here to make this work (even if it has less functionality)

@van800 van800 force-pushed the main branch 4 times, most recently from de2cbce to 76b7e5f Compare September 3, 2025 14:23
@van800
Copy link
Contributor Author

van800 commented Sep 3, 2025

@dsnopek I went with option (3).
All files needed for Rider are now in the .sln folder, which is configured to be invisible in vscode.
Would this solution fit?

Just a side note. It forced me to do some changes in the Rider Godot integration, so for Rider demo project would be fully recognized by Rider 2025.3, not the current one 2025.2.

@dsnopek
Copy link
Contributor

dsnopek commented Sep 3, 2025

Thanks! However, I don't think this matches what we had in mind for option nr 3.

This appears to still be the same amount of files and content, just hidden in a dot directory. We aren't worried about the users seeing the files, we're worried about us being able to maintain this going forward, since we don't understand what all of this does or how it was generated in the first place.

The idea behind option nr 3 was to reduce the files and content down to just the bare minimum to make it work. If it was small enough, perhaps we'd be able to understand and maintain it

@van800
Copy link
Contributor Author

van800 commented Sep 3, 2025

I have removed some auxilary files and macos_debug info, added a readme, describing each of the files in the .sln folder.
Does it help to justify the change? @dsnopek

I am afraid, there is nothing else to remove or simplify. I can merge targets and props into gdext.vcxproj, but it would not simplify understanding how msbuild files work.

@paddy-exe
Copy link
Collaborator

@van800 The README misses a section that explain how those file have been generated or can be generated on its own. Or could you alternatively elaborate how you did so?

@van800
Copy link
Contributor Author

van800 commented Sep 4, 2025

Reworked sln-vcxproj mapping again and it became a lot simpler, I am surprised myself.

@paddy-exe
The .sln file is created when a new solution is created in VS or Rider and updated with editing solution configurations in VS or Rider. The corresponding part of the .vcxproj, which maps $(Configuration) and $(Platform) to other properties, is typically generated by IDE, though it can be customized manually if needed.

In the video I wanted to point out how switching solution configuration affects the resulting scons call. And then I saw leftovers of previous refactoring and removed them.
https://youtu.be/zC5Cy1BZp0Y

@CadeEvs
Copy link

CadeEvs commented Oct 6, 2025

Was testing this PR out with 2025.3 EAP4 and running into a couple issues,

  1. Trying to build the sln results in a compile error. I've verified python is installed, scons is installed, and my Path environmental variable is setup properly. It is only not recognized within Rider
0>------- Started building project: gdext
scons platform=windows arch=x86_64 target=template_debug dev_build=yes
'scons' is not recognized as an internal or external command,
operable program or batch file.
0>Microsoft.MakeFile.Targets(45,5): Error MSB3073 : The command "scons platform=windows arch=x86_64 target=template_debug dev_build=yes" exited with code 9009.
0>------- Finished building project: gdext. Succeeded: False. Errors: 1. Warnings: 0
  1. In example_class.h I'm getting an error at line 10 for GDCLASS. If I run the scons build in cmd it builds fine, so this error is purely visual within Rider
Cannot resolve symbol 'uint32_t'
  1. Rider doesn't seem to be helping autocomplete/add the header files for Godot classes
2025-10-06.11-49-31.mp4

@van800
Copy link
Contributor Author

van800 commented Oct 6, 2025

@CadeEvs

  1. I have checked - there is some issue with Path on Windows. Not sure how to immediatelly fix.
  2. uint32_t might be caused by the missing PlatformToolset - I will check.

…Brains Rider on all major OS or Visual Studio on Windows. The main addition is a sln project file that configures build settings for all major platforms including Windows, Linux, macOS, iOS, Android, and WebAssembly with different architectures. It includes platform-specific property groups that map to SCons build commands and sets up proper include paths for the Godot C++ bindings. The solution file ties together both the C++ extension project and a demo project, while additional target files provide cross-platform toolchain resolution and macOS debugging entitlements.
@van800 van800 marked this pull request as draft October 6, 2025 20:36
@Chkoupinator
Copy link
Contributor

Chkoupinator commented Oct 14, 2025

hello @van800

I'm a big fan of Rider and I am considering using it as my main IDE to start working on a game I'm making as a hobby. I noticed this was the way GDExtensions are planned to be supported in 2025.3 so I decided to get the files in your fork of this template to try to use it with my IDE but trying to run it seems to try to run the .sln file itself and causes this error:
image

I'm on ArchLinux running Rider 2025.3 EAP 5

Edit: I managed to fix this by simply changing the exe path to my the location of godot on my system ( /usr/bin/godot ) I assumed this would be the right thing to do given how we run the project in this video

image

Edit 2:
Running the game from the editor does not seem to trigger breakpoints in the example project's cpp code
Adding a Game configuration that does not launch Godot in editor mode fixes it
However once a breakpoint is hit even trivial types like String show as "opaque" in the debugger. I assume this is because the pdbs aren't being properly loaded... I think I'll give this a try another day I already spent too much time on this 😅

image

PS: Could be a bit off topic but attaching the game folder does not seem to make Rider recognize it as a Godot project folder, your Readme is unclear about how we're supposed to enable gdscript support for the demo/game (I renamed everything from demo to game and opening the game folder directly in Rider works)

@van800
Copy link
Contributor Author

van800 commented Oct 27, 2025

Just fixed

  1. Cannot resolve symbol 'uint32_t' on Windows with MSVC
  2. scons not found on Windows
    cc: @CadeEvs

@van800
Copy link
Contributor Author

van800 commented Oct 27, 2025

@Chkoupinator to debug the game, you'd need not only exe path but also arguments and working directory.

image

@van800
Copy link
Contributor Author

van800 commented Oct 27, 2025

@Chkoupinator
Regarding opaque presentation in debugger, there are workarounds:

Regarding "Attach Folder" RIDER-131693

@Chkoupinator
Copy link
Contributor

Chkoupinator commented Oct 30, 2025

@van800 I had already tried that but it seems the version of python bundled with the lldb plugin of Rider (version 3.8) does not contain the Never type which was introduced to typing in 3.11 as per the logs:

error: module importing failed: Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/chkoupinator/Projekts/Godot/GodotFormatters/godot_formatters/__init__.py", line 18, in <module>
    import godot_formatters.godot_providers
  File "/home/chkoupinator/Projekts/Godot/GodotFormatters/godot_formatters/godot_providers.py", line 19, in <module>
    from typing import Any, Callable, Generic, Never, TypeVar, final, Optional
ImportError: cannot import name 'Never' from 'typing' (/home/chkoupinator/.local/share/JetBrains/Toolbox/apps/rider-2/plugins/cidr-debugger/bin/lldb/linux/x64/lib/python38.zip/typing.py)```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants