Skip to content

Commit

Permalink
fix: enable pch for clang on windows (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanStojanovic authored Oct 8, 2024
1 parent 8282f01 commit cc5838c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pylib/gyp/generator/msvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3412,7 +3412,11 @@ def _FinalizeMSBuildSettings(spec, configuration):
)
# Turn on precompiled headers if appropriate.
if precompiled_header:
precompiled_header = os.path.split(precompiled_header)[1]
# While MSVC works with just file name eg. "v8_pch.h", ClangCL requires
# the full path eg. "tools/msvs/pch/v8_pch.h" to find the file.
# P.S. Only ClangCL defines msbuild_toolset, for MSVC it is None.
if configuration.get("msbuild_toolset") != 'ClangCL':
precompiled_header = os.path.split(precompiled_header)[1]
_ToolAppend(msbuild_settings, "ClCompile", "PrecompiledHeader", "Use")
_ToolAppend(
msbuild_settings, "ClCompile", "PrecompiledHeaderFile", precompiled_header
Expand Down

0 comments on commit cc5838c

Please sign in to comment.