Skip to content

Commit 76b7e5f

Browse files
committed
move sln and all the dependencies to the .sln folder, make it invisible in vscode
1 parent 5041fb6 commit 76b7e5f

File tree

12 files changed

+56
-31
lines changed

12 files changed

+56
-31
lines changed

.sln/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.idea/*

.sln/.idea/.idea.godot-cpp-example/.idea/indexLayout.xml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sln/demo.vcxproj

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<!-- link all the files from here, to avoid polluting the demo folder with a vcxproj file, which is unexpected-->
4+
<!-- https://github.com/godotengine/godot-cpp-template/pull/95 -->
5+
<ItemGroup>
6+
<None Include="../demo/**">
7+
</None>
8+
</ItemGroup>
9+
10+
<!-- fake build target -->
11+
<Target Name="Build" Condition="!Exists('$(VCTargetsPath)/Microsoft.Cpp.targets')">
12+
</Target>
13+
</Project>

gdext.vcxproj renamed to .sln/gdext.vcxproj

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<RepoRoot>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..'))</RepoRoot>
5+
</PropertyGroup>
6+
37
<PropertyGroup Label="Globals">
48
<ProjectGuid>{9A2FB295-38D9-4994-9497-26FF91C85465}</ProjectGuid>
59
<RootNamespace>godot</RootNamespace>
@@ -172,11 +176,11 @@
172176
<ConfigurationType>Makefile</ConfigurationType>
173177
<UseOfMfc>false</UseOfMfc>
174178
<PlatformToolset>v143</PlatformToolset> <!--Makes Visual Studio happy. Might be overridden in the platform specific import or godot.user.props -->
175-
<DefaultPlatformToolset Condition="'$(DefaultPlatformToolset)'==''"/> <!--Workaround until https://youtrack.jetbrains.com/issue/RIDER-123783 is resolved. -->
176-
<NMakeIncludeSearchPath>godot-cpp/gen/include;godot-cpp/include;godot-cpp/gdextension;$(NMakeIncludeSearchPath);</NMakeIncludeSearchPath>
177-
<!-- Default debugger command should point to GodotEditor; if env var GODOT is provided, use it -->
178-
<LocalDebuggerCommand Condition="'$(LocalDebuggerCommand)' == '' and '$(GODOT)' != ''">$(GODOT)</LocalDebuggerCommand>
179-
<LocalDebuggerCommand Condition="'$(LocalDebuggerCommand)' == '' and '$(GODOT)' == ''">godot</LocalDebuggerCommand>
179+
<NMakeWorkingDirectory>$(RepoRoot)</NMakeWorkingDirectory>
180+
<NMakeOutput Condition="'$(NMakeOutput)' == ''">dylib</NMakeOutput> <!--any non empty value required for automatic run configuration generation in Rider -->
181+
<LocalDebuggerWorkingDirectory Condition="'$(LocalDebuggerWorkingDirectory)' == ''">$(NMakeWorkingDirectory)/demo</LocalDebuggerWorkingDirectory>
182+
<LocalDebuggerCommandArguments>--editor</LocalDebuggerCommandArguments>
183+
<NMakeIncludeSearchPath>$(RepoRoot)/godot-cpp/gen/include;$(RepoRoot)/godot-cpp/include;$(RepoRoot)/godot-cpp/gdextension;$(NMakeIncludeSearchPath);</NMakeIncludeSearchPath>
180184
<!-- Commands executed by Build/Rebuild/Clean in the IDE (Rider, VS) -->
181185
<NMakeBuildCommandLine>scons platform=$(GodotPlatform) arch=$(Arch) target=$(GodotTemplate) $(BuildType)</NMakeBuildCommandLine>
182186
<NMakeReBuildCommandLine>scons --clean platform=$(GodotPlatform) arch=$(Arch) target=$(GodotTemplate) &amp;&amp; scons platform=$(GodotPlatform) arch=$(Arch) target=$(GodotTemplate)</NMakeReBuildCommandLine>
@@ -186,8 +190,12 @@
186190
<ImportGroup Label="ExtensionSettings">
187191
</ImportGroup>
188192
<ItemGroup>
189-
<None Include="src/**/*.h"/>
190-
<None Include="src/**/*.cpp"/>
193+
<None Include="$(RepoRoot)/src/**/*.h">
194+
<Link>src/%(RecursiveDir)%(Filename).%(Extension)</Link>
195+
</None>
196+
<None Include="$(RepoRoot)/src/**/*.cpp">
197+
<Link>src/%(RecursiveDir)%(Filename).%(Extension)</Link>
198+
</None>
191199
</ItemGroup>
192200

193201
<!-- Build/Rebuild/Clean targets for NMake are defined in MSVC, so we need to provide them, when using MSBuild without MSVC targets -->

godot-cpp-example.sln renamed to .sln/godot-cpp-example.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ VisualStudioVersion = 17.7.34221.43
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gdext", "gdext.vcxproj", "{9A2FB295-38D9-4994-9497-26FF91C85465}"
66
EndProject
7-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "game", "demo\demo.csproj", "{5E7DBDBD-898E-4278-9432-B8BBADEDA80F}"
7+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "game", "demo.vcxproj", "{5E7DBDBD-898E-4278-9432-B8BBADEDA80F}"
88
EndProject
99
Global
1010
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -81,7 +81,7 @@ Global
8181
{9A2FB295-38D9-4994-9497-26FF91C85465}.Release-wasm32|web.ActiveCfg = Release-wasm32|web
8282
{9A2FB295-38D9-4994-9497-26FF91C85465}.Release-wasm32|web.Build.0 = Release-wasm32|web
8383

84-
# demo.csproj part
84+
# demo.vcxproj part
8585
{5E7DBDBD-898E-4278-9432-B8BBADEDA80F}.Debug-x86_32|windows.ActiveCfg = Debug|Any CPU
8686
{5E7DBDBD-898E-4278-9432-B8BBADEDA80F}.Debug-x86_32|windows.Build.0 = Debug|Any CPU
8787
{5E7DBDBD-898E-4278-9432-B8BBADEDA80F}.Release-x86_32|windows.ActiveCfg = Debug|Any CPU

targets/JetBrains.Rider.Cpp.targets renamed to .sln/targets/JetBrains.Rider.Cpp.targets

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2-
32
<!-- do not rename this target, Rider calls it on the properties evaluation -->
43
<Target Name="CollectPackageReferences" Condition="'$(DesignTimeBuild)' == 'true'">
5-
<Message Text="Resolving toolchain..." Importance="High" />
6-
4+
<Message Text="Resolving toolchain..." Importance="High"/>
5+
76
<!-- Query clang include paths -->
87
<Exec Command="clang++ -v -E -x c++ /dev/null 2&gt;&amp;1 | sed -n '/#include &lt;...&gt; search starts here:/,/End of search list/p' | tail -n +2 | grep -v 'End of search list' | xargs -I{} echo -n '{};'" ConsoleToMsBuild="true">
98
<Output TaskParameter="ConsoleOutput" PropertyName="ClangIncludeDirs"/>
109
</Exec>
1110

1211
<PropertyGroup>
13-
<NMakeIncludeSearchPath>$(ClangIncludeDirs)$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
12+
<NMakeIncludeSearchPath>$(ClangIncludeDirs);$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
1413
</PropertyGroup>
1514

1615
<Message Text="NMakeIncludeSearchPath: $(NMakeIncludeSearchPath)"/>
File renamed without changes.
File renamed without changes.

targets/nmake.substitution.props renamed to .sln/targets/nmake.substitution.props

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@
44
<!-- override the PlatformToolset, which is set in the godot.vcxproj-->
55
<!-- Unknown matches to a set of conservative rules for the code analysis-->
66
<PlatformToolset>Unknown</PlatformToolset>
7-
<LocalDebuggerCommand Condition="'$(LocalDebuggerCommand)' == ''">$(NMakeOutput)</LocalDebuggerCommand>
87
</PropertyGroup>
98
<!-- Build/Rebuild/Clean targets for NMake are defined in MSVC, so we need to provide them, when using MSBuild without MSVC targets -->
109
<Target Name="Build">
11-
<Exec Command="$(NMakeBuildCommandLine)"/>
10+
<Exec Command="$(NMakeBuildCommandLine)"
11+
WorkingDirectory="$(NMakeWorkingDirectory)"/>
1212
</Target>
1313
<Target Name="Rebuild">
14-
<Exec Command="$(NMakeReBuildCommandLine)"/>
14+
<Exec Command="$(NMakeReBuildCommandLine)"
15+
WorkingDirectory="$(NMakeWorkingDirectory)"/>
1516
</Target>
1617
<Target Name="Clean">
17-
<Exec Command="$(NMakeCleanCommandLine)"/>
18+
<Exec Command="$(NMakeCleanCommandLine)"
19+
WorkingDirectory="$(NMakeWorkingDirectory)"/>
1820
</Target>
1921
<ItemDefinitionGroup>
2022
<ClCompile>

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"files.exclude": {
3+
".sln":true
4+
}
5+
}

0 commit comments

Comments
 (0)