mirror of https://github.com/nodejs/node.git
build,win: enable pch for clang-cl
Fixes: https://github.com/nodejs/node/issues/55208 PR-URL: https://github.com/nodejs/node/pull/55249 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
This commit is contained in:
parent
82dab76d63
commit
27f8d9e9d2
14
node.gypi
14
node.gypi
|
@ -65,15 +65,11 @@
|
|||
'NODE_PLATFORM="win32"',
|
||||
'_UNICODE=1',
|
||||
],
|
||||
'conditions': [
|
||||
['clang==0', {
|
||||
'msvs_precompiled_header': 'tools/msvs/pch/node_pch.h',
|
||||
'msvs_precompiled_source': 'tools/msvs/pch/node_pch.cc',
|
||||
'sources': [
|
||||
'<(_msvs_precompiled_header)',
|
||||
'<(_msvs_precompiled_source)',
|
||||
],
|
||||
}],
|
||||
'msvs_precompiled_header': 'tools/msvs/pch/node_pch.h',
|
||||
'msvs_precompiled_source': 'tools/msvs/pch/node_pch.cc',
|
||||
'sources': [
|
||||
'<(_msvs_precompiled_header)',
|
||||
'<(_msvs_precompiled_source)',
|
||||
],
|
||||
}, { # POSIX
|
||||
'defines': [ '__POSIX__' ],
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
'type': 'none',
|
||||
'toolsets': ['host', 'target'],
|
||||
'conditions': [
|
||||
['OS=="win" and clang==0', {
|
||||
['OS=="win"', {
|
||||
'direct_dependent_settings': {
|
||||
'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h',
|
||||
'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc',
|
||||
|
|
Loading…
Reference in New Issue