Skip to content

Commit

Permalink
explicit set PlatformToolset
Browse files Browse the repository at this point in the history
  • Loading branch information
van800 committed Mar 4, 2025
1 parent 128509b commit c38e031
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -1390,6 +1390,11 @@ def get_dependencies(file, env, exts, headers, sources, others):
proj_template = proj_template.replace("%%DEFAULT_ITEMS%%", "\n ".join(all_items))
proj_template = proj_template.replace("%%PROPERTIES%%", "\n ".join(properties))

toolset = "v143"
if not env.msvc:
toolset = "CLang"
proj_template = proj_template.replace("%%PlatformToolset%%", toolset)

with open(f"{project_name}.vcxproj", "w", encoding="utf-8", newline="\r\n") as f:
f.write(proj_template)

Expand Down
11 changes: 6 additions & 5 deletions misc/msvs/vcxproj.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@
<VCProjectUpgraderObjectName>NoUpgrade</VCProjectUpgraderObjectName>
</PropertyGroup>
%%PROPERTIES%%
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" Condition=" exists('$(VCTargetsPath)\Microsoft.Cpp.Default.props') "/>
<PropertyGroup Label="Configuration">
<PlatformToolset>%%PlatformToolset%%</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" Condition="'$(PlatformToolset)' != 'Clang'" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset Condition="exists('$(VCTargetsPath)\Microsoft.Cpp.Default.props')">v143</PlatformToolset>
<PlatformToolset Condition="!exists('$(VCTargetsPath)\Microsoft.Cpp.Default.props')">CLang</PlatformToolset>
<OutDir>$(SolutionDir)\bin\$(GodotPlatform)\$(GodotConfiguration)\</OutDir>
<IntDir>obj\$(GodotPlatform)\$(GodotConfiguration)\</IntDir>
<LayoutDir>$(OutDir)\Layout</LayoutDir>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" Condition=" exists('$(VCTargetsPath)\Microsoft.Cpp.props') "/>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" Condition="'$(PlatformToolset)' != 'Clang'" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
Expand All @@ -35,7 +36,7 @@
<ItemGroup Condition="'$(IncludeListImported)'==''">
%%DEFAULT_ITEMS%%
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" Condition=" exists('$(VCTargetsPath)\Microsoft.Cpp.targets') "/>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" Condition="'$(PlatformToolset)' != 'Clang'" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
Expand Down

0 comments on commit c38e031

Please sign in to comment.