Skip to content

Commit

Permalink
PlatformToolset and imports based on existabce of msvc props
Browse files Browse the repository at this point in the history
  • Loading branch information
van800 committed Mar 4, 2025
1 parent 8ed78e9 commit ef95056
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
6 changes: 0 additions & 6 deletions methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -1389,12 +1389,6 @@ def get_dependencies(file, env, exts, headers, sources, others):
proj_template = proj_template.replace("%%IMPORTS%%", "\n ".join(imports))
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
7 changes: 4 additions & 3 deletions misc/msvs/vcxproj.template
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
<PropertyGroup Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>%%PlatformToolset%%</PlatformToolset>
<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=" '$(PlatformToolset)' != 'Clang' "/>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" Condition=" exists('$(VCTargetsPath)\Microsoft.Cpp.props') "/>
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
Expand All @@ -34,7 +35,7 @@
<ItemGroup Condition="'$(IncludeListImported)'==''">
%%DEFAULT_ITEMS%%
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" Condition=" '$(PlatformToolset)' != 'Clang' "/>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" Condition=" exists('$(VCTargetsPath)\Microsoft.Cpp.targets') "/>
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
Expand Down

0 comments on commit ef95056

Please sign in to comment.