Skip to content

Commit

Permalink
build,win: enable pch for clang-cl
Browse files Browse the repository at this point in the history
Fixes: #55208
PR-URL: #55249
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
  • Loading branch information
StefanStojanovic authored and marco-ippolito committed Jan 22, 2025
1 parent 2a7725a commit b63437c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/gyp/pylib/gyp/generator/msvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3416,7 +3416,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 b63437c

Please sign in to comment.