Skip to content

Commit 95f868a

Browse files
committed
choose appropriate PlatformToolset based on the GodotPlatform
1 parent 8e42e28 commit 95f868a

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

.sln/gdext.vcxproj

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,16 @@
9090
<PropertyGroup Label="Configuration">
9191
<ConfigurationType>Makefile</ConfigurationType>
9292
<UseOfMfc>false</UseOfMfc>
93-
<PlatformToolset>v143</PlatformToolset> <!--Makes Visual Studio happy. Might be overridden in the platform specific import or godot.user.props -->
93+
<!-- Possible values: V143, Clang_Mac, Clang_Linux, llvm, Clang, ClangCL, MSFS, Unknown-->
94+
<!-- Select toolset based on target GodotPlatform. Switches Cpp dialect a bit -->
95+
<PlatformToolset Condition="'$(GodotPlatform)'=='windows'">v143</PlatformToolset>
96+
<PlatformToolset Condition="'$(GodotPlatform)'=='macos' or '$(GodotPlatform)'=='ios'">Clang_Mac</PlatformToolset>
97+
<PlatformToolset Condition="'$(GodotPlatform)'=='linux'">Clang_Linux</PlatformToolset>
98+
<PlatformToolset Condition="'$(GodotPlatform)'=='android'">Clang_Linux</PlatformToolset>
99+
<PlatformToolset Condition="'$(GodotPlatform)'=='web'">Clang_Linux</PlatformToolset>
100+
<!-- Fallback when platform is not matched -->
101+
<PlatformToolset Condition="'$(PlatformToolset)'==''">Unknown</PlatformToolset>
102+
94103
<NMakeWorkingDirectory>$(RepoRoot)</NMakeWorkingDirectory>
95104
<NMakeOutput Condition="'$(NMakeOutput)' == ''">dylib</NMakeOutput> <!--any non empty value required for automatic run configuration generation in Rider -->
96105
<LocalDebuggerWorkingDirectory Condition="'$(LocalDebuggerWorkingDirectory)' == ''">$(NMakeWorkingDirectory)/demo</LocalDebuggerWorkingDirectory>

.sln/targets/nmake.substitution.props

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<PropertyGroup>
4-
<!-- override the PlatformToolset, which is set in the godot.vcxproj-->
5-
<!-- Unknown matches to a set of conservative rules for the code analysis-->
6-
<PlatformToolset>Unknown</PlatformToolset>
7-
</PropertyGroup>
83
<!-- Build/Rebuild/Clean targets for NMake are defined in MSVC, so we need to provide them, when using MSBuild without MSVC targets -->
94
<Target Name="Build">
105
<Exec Command="$(NMakeBuildCommandLine)"
@@ -19,12 +14,6 @@
1914
WorkingDirectory="$(NMakeWorkingDirectory)"/>
2015
</Target>
2116
<ItemDefinitionGroup>
22-
<ClCompile>
23-
<AdditionalOptions>$(AdditionalOptions)</AdditionalOptions>
24-
<ForcedIncludeFiles>$(NMakeForcedIncludes)</ForcedIncludeFiles>
25-
<ForcedUsingFiles>$(NMakeForcedUsingAssemblies)</ForcedUsingFiles>
26-
<PreprocessorDefinitions>$(NMakePreprocessorDefinitions)</PreprocessorDefinitions>
27-
</ClCompile>
2817
<!-- Reflects what Platform.Common.props does. -->
2918
<Link Condition="'$(Arch)' == 'arm64'">
3019
<TargetMachine>MachineARM64</TargetMachine>

0 commit comments

Comments
 (0)