godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.31k stars 20k forks source link

Cannot generate godot.sln for Rider under MacOS #83771

Open p10tr3k opened 10 months ago

p10tr3k commented 10 months ago

Godot version

4.1

System information

MacOS 14.0 (23A344) (intel)

Issue description

According to documentation, to use Rider IDE I have to run this command: scons platform=windows arch=x86_64 target=editor vsproj=yes dev_build=yes

And I get this error: Invalid target platform "windows". The following platforms were detected: ios macOS

Seems reasonable because I am using MacOS, so I tried this: scons platform=osx arch=x86_64 target=editor vsproj=yes dev_build=yes

and this gives me another error: 'Error: The vsproj option is only usable on Windows with Visual Studio.'

Is there a way to build godot.sln for Rider under MacOS?

Steps to reproduce

See above

Minimal reproduction project

not required

bruvzg commented 10 months ago

vsproj is specifically for MSVC build on Windows. For any other platform/compiler use, you can use compile_commands.json (compiledb=yes in the build command).

p10tr3k commented 10 months ago

vsproj is specifically for MSVC build on Windows. For any other platform/compiler use, you can use compile_commands.json (compiledb=yes in the build command).

Rider runs on both Mac and Windows platforms, and it uses solely .sln files from the msbuild system. There has to be a way to generate these files on Mac, as Rider is currently the most preferred option (for me), especially after the gradual discontinuation of Visual Studio for Mac.

brno32 commented 9 months ago

I don't think this is a bug but a feature request. running scons vsproj=yes on MacOS should indeed throw the given error since it's not (yet) supported

akien-mga commented 3 months ago

Could you test if this works out of the box in the current master branch?

We improved the VS proj generation with #84885.

I suspect the new system may still not support Rider, but it might be possible to implement Rider support using the framework @shana designed, IIUC.

shana commented 3 months ago

So after talking to Jetbrains about this, the conclusion is that Rider doesn't support the vcxproj (C++) project format. It does support .sln, but only for csproj (C#) projects. The alternative is to use a json project format that Rider does support (https://github.com/ubisoft/Sharpmake/pull/248).

TV4Fun commented 2 months ago

@akien-mga I am running a mac with the latest master branch of Godot. I've generated the project files with scons dev_build=yes debug_symbols=yes module_mono_enabled=yes vsproj=yes. Loading in Rider or building with msbuild produces this error:

"/Users/jcroteau/code/godot/godot.sln" (default target) (1) ->
"/Users/jcroteau/code/godot/godot.vcxproj" (default target) (2) ->
  /Users/jcroteau/code/godot/godot.vcxproj(59,3): error MSB4019: The imported project "/Microsoft.Cpp.Default.props" was not found. Confirm that the expression in the Import declaration "/Microsoft.Cpp.Default.props" is correct, and that the file exists on disk.

Rider also completely fails to find any of the standard or project include files, so none of its code analysis tools work. See this screenshot from variant_utility.cpp:

Screenshot 2024-06-27 at 3 26 31 PM
citizenmatt commented 5 days ago

Just to clarify, Rider does support .vcxproj files, but not on Mac, because it requires the appropriate Visual C++ target files, and the VC++ toolchain isn't available for Mac. Rider works with Unreal Engine on Mac by loading the .uproject files directly, and using them to generate an internal project model. To work with other C++ projects on Mac and Linux, the only option right now is to use CLion, which is designed to work with CMake and compilation database.

(It might seem odd to have two products here, but it's a result of evolution. Rider was initially designed to work with dotnet solutions, which is a Visual Studio project model, and is powered by the ReSharper engine, a Visual Studio plugin. ReSharper C++ had better support for Unreal than CLion, so it was easier to integrate ReSharper C++ than teach CLion the VS project model as well as Unreal features. Plus, Unreal solutions are described with C#, which is again a better fit for Rider)