mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
build: add option to enable clang-cl on Windows
Most changes are gated by the `clang==1` condition to avoid breaking MSVC builds. Select C/C++ language standard with ClCompile options. This avoids passing the `-std:c++20` flag while compiling C code. Do it only under clang option to avoid breaking addons until node-gyp supports the new LanguageStandard options. Disable precompiled header configuration for now as it doesn't seem to work with clang-cl. Disable C++20 warnings emitted by the Visual Studio C++ STL. They're very noisy and not our responsibility to fix. Co-authored-by: Daniel Lemire <daniel@lemire.me> Co-authored-by: Stefan Stojanovic <stefan.stojanovic@janeasystems.com> PR-URL: https://github.com/nodejs/node/pull/52870 Reviewed-By: Daniel Lemire <daniel@lemire.me> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
dcd8b82e15
commit
efa63f3d05
8 changed files with 120 additions and 53 deletions
20
node.gypi
20
node.gypi
|
@ -65,11 +65,15 @@
|
|||
'NODE_PLATFORM="win32"',
|
||||
'_UNICODE=1',
|
||||
],
|
||||
'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)',
|
||||
'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)',
|
||||
],
|
||||
}],
|
||||
],
|
||||
}, { # POSIX
|
||||
'defines': [ '__POSIX__' ],
|
||||
|
@ -148,7 +152,7 @@
|
|||
'msvs_settings': {
|
||||
'VCLinkerTool': {
|
||||
'AdditionalOptions': [
|
||||
'/WHOLEARCHIVE:zlib<(STATIC_LIB_SUFFIX)',
|
||||
'/WHOLEARCHIVE:<(PRODUCT_DIR)/lib/zlib<(STATIC_LIB_SUFFIX)',
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -187,7 +191,7 @@
|
|||
'msvs_settings': {
|
||||
'VCLinkerTool': {
|
||||
'AdditionalOptions': [
|
||||
'/WHOLEARCHIVE:libuv<(STATIC_LIB_SUFFIX)',
|
||||
'/WHOLEARCHIVE:<(PRODUCT_DIR)/lib/libuv<(STATIC_LIB_SUFFIX)',
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -370,7 +374,7 @@
|
|||
'msvs_settings': {
|
||||
'VCLinkerTool': {
|
||||
'AdditionalOptions': [
|
||||
'/WHOLEARCHIVE:<(openssl_product)',
|
||||
'/WHOLEARCHIVE:<(PRODUCT_DIR)/lib/<(openssl_product)',
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue