Skip to content

Commit cc5838c

Browse files
fix: enable pch for clang on windows (#268)
1 parent 8282f01 commit cc5838c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pylib/gyp/generator/msvs.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -3412,7 +3412,11 @@ def _FinalizeMSBuildSettings(spec, configuration):
34123412
)
34133413
# Turn on precompiled headers if appropriate.
34143414
if precompiled_header:
3415-
precompiled_header = os.path.split(precompiled_header)[1]
3415+
# While MSVC works with just file name eg. "v8_pch.h", ClangCL requires
3416+
# the full path eg. "tools/msvs/pch/v8_pch.h" to find the file.
3417+
# P.S. Only ClangCL defines msbuild_toolset, for MSVC it is None.
3418+
if configuration.get("msbuild_toolset") != 'ClangCL':
3419+
precompiled_header = os.path.split(precompiled_header)[1]
34163420
_ToolAppend(msbuild_settings, "ClCompile", "PrecompiledHeader", "Use")
34173421
_ToolAppend(
34183422
msbuild_settings, "ClCompile", "PrecompiledHeaderFile", precompiled_header

0 commit comments

Comments
 (0)