diff --git a/.sln/readme.md b/.sln/readme.md new file mode 100644 index 00000000..caed02e4 --- /dev/null +++ b/.sln/readme.md @@ -0,0 +1,30 @@ +# JetBrains Rider C++ support files (.sln folder) + +Rider uses these files to resolve C++, provide code insight, and create/run build configs. They also supply MSBuild/NMake metadata so projects index and build correctly. + +- godot-cpp-example.sln + - Solution that groups the C++ projects and lists all Configuration|Platform pairs shown in the Solution Configuration selector. + +- gdext.vcxproj + - GDExtension C++ project. Rider reads compiler options/defines/includes and also calls scons to build the extension library (.dll/.so/.dylib). + +- targets/JetBrains.Rider.Cpp.targets (for non-Windows) + - MSBuild target that resolves C++ standard library headers. + +- targets/nmake.substitution.props (for non-Windows) + - Substitutes Build/Rebuild/Clean targets. + - Reference: [godot/misc/msvs/nmake.substitution.props](https://github.com/godotengine/godot/blob/master/misc/msvs/nmake.substitution.props) + + +Sln to vcxproj relation: +- The .sln file lists all Configuration|Platform pairs in SolutionConfigurationPlatforms (e.g., Debug|linux-x86_64). +- The same pairs are mapped to the gdext project in ProjectConfigurationPlatforms, so the project gets the exact Configuration and Platform selected in the IDE. +- In gdext.vcxproj, $(Configuration) toggles Debug/Release props, while $(Platform) is matched by Condition blocks to set GodotPlatform and Arch. +- Those values feed the NMake commands, which call scons with platform=$(GodotPlatform) arch=$(Arch) target=$(GodotTemplate). +- Result: choosing a Solution configuration in Rider/VS selects the matching vcxproj config and builds the right target for your OS/arch. +- sln and vcxproj are meant to be manually edited in Rider. + +Notes: +- Full `godot-cpp-template` folder can be linked by context menu of the solution root (Add | Existing folder) +- Auxiliary project linking `demo` game contents can be added optionally in the `demo` folder. Rider plugins for Godot would provide language support, run configurations and other features for such projects. +- Theoretically there is an option to use non-msvc toolchain on Windows, but there are known problems with it in Rider debugger [RIDER-106816], so for now for this project on Windows MSBuild with MSVC toolchain is a requirement to work in Rider. diff --git a/.sln/targets/JetBrains.Rider.Cpp.targets b/.sln/targets/JetBrains.Rider.Cpp.targets new file mode 100644 index 00000000..1fa25153 --- /dev/null +++ b/.sln/targets/JetBrains.Rider.Cpp.targets @@ -0,0 +1,18 @@ + + + + + + + + + + + + $(ClangIncludeDirs);$(NMakeIncludeSearchPath) + + + + + + diff --git a/.sln/targets/nmake.substitution.props b/.sln/targets/nmake.substitution.props new file mode 100644 index 00000000..e286e8b9 --- /dev/null +++ b/.sln/targets/nmake.substitution.props @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + MachineARM64 + + + MachineX64 + + + MachineX86 + + + diff --git a/gdext.vcxproj b/gdext.vcxproj new file mode 100644 index 00000000..89afd6f8 --- /dev/null +++ b/gdext.vcxproj @@ -0,0 +1,135 @@ + + + + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)')) + + + + {9A2FB295-38D9-4994-9497-26FF91C85465} + godot + MakeFileProj + NoUpgrade + + + + template_debug + dev_build=yes + + + + template_release + + + + + windows + x86_32 + + + windows + x86_64 + + + + + linux + x86_64 + + + linux + arm64 + + + linux + rv64 + + + + + macos + + + + + + ios + arm64 + + + + + android + x86_64 + + + android + arm64 + + + + + web + wasm32 + + + + $([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows))) + $([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX))) + $([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux))) + + + + + + + single + threads + + + + + Makefile + false + + + v143 + Clang_Mac + Clang_Linux + Clang_Linux + Clang_Linux + + v143 + $(PlatformToolset) + + $(RepoRoot) + dylib + $(NMakeWorkingDirectory)/demo + --editor + $(RepoRoot)/godot-cpp/gen/include;$(RepoRoot)/godot-cpp/include;$(RepoRoot)/godot-cpp/gdextension;$(NMakeIncludeSearchPath); + + + + + scons platform=$(GodotPlatform) arch=$(Arch) target=$(GodotTemplate) $(BuildType) + scons --clean platform=$(GodotPlatform) arch=$(Arch) target=$(GodotTemplate) && scons platform=$(GodotPlatform) arch=$(Arch) target=$(GodotTemplate) + scons --clean platform=$(GodotPlatform) arch=$(Arch) target=$(GodotTemplate) + + + + cmd /V /C set "PATH=$(PATH)" ^& scons platform=$(GodotPlatform) arch=$(Arch) target=$(GodotTemplate) $(BuildType) + cmd /V /C set "PATH=$(PATH)" ^& scons --clean platform=$(GodotPlatform) arch=$(Arch) target=$(GodotTemplate) ^& scons platform=$(GodotPlatform) arch=$(Arch) target=$(GodotTemplate) + cmd /V /C set "PATH=$(PATH)" ^& scons --clean platform=$(GodotPlatform) arch=$(Arch) target=$(GodotTemplate) + + + + + + + + + + + + + + diff --git a/godot-cpp b/godot-cpp index 6388e26d..d502d8e8 160000 --- a/godot-cpp +++ b/godot-cpp @@ -1 +1 @@ -Subproject commit 6388e26dd8a42071f65f764a3ef3d9523dda3d6e +Subproject commit d502d8e8aae35248bad69b9f40b98150ab694774 diff --git a/godot-cpp-example.sln b/godot-cpp-example.sln new file mode 100644 index 00000000..228e2f44 --- /dev/null +++ b/godot-cpp-example.sln @@ -0,0 +1,83 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34221.43 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gdext", "gdext.vcxproj", "{9A2FB295-38D9-4994-9497-26FF91C85465}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|windows-x86_32 = Debug|windows-x86_32 + Release|windows-x86_32 = Release|windows-x86_32 + Debug|windows-x86_64 = Debug|windows-x86_64 + Release|windows-x86_64 = Release|windows-x86_64 + + Debug|linux-x86_64 = Debug|linux-x86_64 + Release|linux-x86_64 = Release|linux-x86_64 + Debug|linux-arm64 = Debug|linux-arm64 + Release|linux-arm64 = Release|linux-arm64 + Debug|linux-rv64 = Debug|linux-rv64 + Release|linux-rv64 = Release|linux-rv64 + + Debug|macos = Debug|macos + Release|macos = Release|macos + + Debug|ios-arm64 = Debug|ios-arm64 + Release|ios-arm64 = Release|ios-arm64 + + Debug|android-x86_64 = Debug|android-x86_64 + Release|android-x86_64 = Release|android-x86_64 + Debug|android-arm64 = Debug|android-arm64 + Release|android-arm64 = Release|android-arm64 + + Debug|web-wasm32 = Debug|web-wasm32 + Release|web-wasm32 = Release|web-wasm32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9A2FB295-38D9-4994-9497-26FF91C85465}.Debug|windows-x86_32.ActiveCfg = Debug|Win32 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Debug|windows-x86_32.Build.0 = Debug|Win32 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Release|windows-x86_32.ActiveCfg = Release|Win32 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Release|windows-x86_32.Build.0 = Release|Win32 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Debug|windows-x86_64.ActiveCfg = Debug|x64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Debug|windows-x86_64.Build.0 = Debug|x64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Release|windows-x86_64.ActiveCfg = Release|x64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Release|windows-x86_64.Build.0 = Release|x64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Debug|linux-x86_64.ActiveCfg = Debug|linux-x86_64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Debug|linux-x86_64.Build.0 = Debug|linux-x86_64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Release|linux-x86_64.ActiveCfg = Release|linux-x86_64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Release|linux-x86_64.Build.0 = Release|linux-x86_64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Debug|linux-arm64.ActiveCfg = Debug|linux-arm64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Debug|linux-arm64.Build.0 = Debug|linux-arm64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Release|linux-arm64.ActiveCfg = Release|linux-arm64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Release|linux-arm64.Build.0 = Release|linux-arm64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Debug|linux-rv64.ActiveCfg = Debug|linux-rv64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Debug|linux-rv64.Build.0 = Debug|linux-rv64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Release|linux-rv64.ActiveCfg = Release|linux-rv64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Release|linux-rv64.Build.0 = Release|linux-rv64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Debug|macos.ActiveCfg = Debug|macos + {9A2FB295-38D9-4994-9497-26FF91C85465}.Debug|macos.Build.0 = Debug|macos + {9A2FB295-38D9-4994-9497-26FF91C85465}.Release|macos.ActiveCfg = Release|macos + {9A2FB295-38D9-4994-9497-26FF91C85465}.Release|macos.Build.0 = Release|macos + {9A2FB295-38D9-4994-9497-26FF91C85465}.Debug|ios-arm64.ActiveCfg = Debug|ios-arm64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Debug|ios-arm64.Build.0 = Debug|ios-arm64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Release|ios-arm64.ActiveCfg = Release|ios-arm64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Release|ios-arm64.Build.0 = Release|ios-arm64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Debug|android-x86_64.ActiveCfg = Debug|android-x86_64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Debug|android-x86_64.Build.0 = Debug|android-x86_64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Release|android-x86_64.ActiveCfg = Release|android-x86_64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Release|android-x86_64.Build.0 = Release|android-x86_64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Debug|android-arm64.ActiveCfg = Debug|android-arm64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Debug|android-arm64.Build.0 = Debug|android-arm64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Release|android-arm64.ActiveCfg = Release|android-arm64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Release|android-arm64.Build.0 = Release|android-arm64 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Debug|web-wasm32.ActiveCfg = Debug|web-wasm32 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Debug|web-wasm32.Build.0 = Debug|web-wasm32 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Release|web-wasm32.ActiveCfg = Release|web-wasm32 + {9A2FB295-38D9-4994-9497-26FF91C85465}.Release|web-wasm32.Build.0 = Release|web-wasm32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {75408944-4e38-4094-a91b-4730439ab8ee} + EndGlobalSection +EndGlobal