build,win: enable ccache · nodejs/node@901685c · GitHub
Skip to content

Commit 901685c

Browse files
StefanStojanovicRafaelGSS
authored andcommitted
build,win: enable ccache
PR-URL: #56847 Refs: #56705 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent 257d22e commit 901685c

5 files changed

Lines changed: 48 additions & 2 deletions

File tree

BUILDING.md

Lines changed: 18 additions & 0 deletions

configure.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,11 @@
10151015
default=None,
10161016
help='Configure for clang-cl on Windows. This flag sets the GYP "clang" ' +
10171017
'variable to 1 and "llvm_version" to the specified value.')
1018+
parser.add_argument('--use-ccache-win',
1019+
action='store_true',
1020+
dest='use_ccache_win',
1021+
default=None,
1022+
help='Use ccache for compiling on Windows. ')
10181023

10191024
(options, args) = parser.parse_known_args()
10201025

@@ -1191,6 +1196,8 @@ def get_gas_version(cc):
11911196
# check involves checking the build number against an allowlist. I'm not
11921197
# quite prepared to go that far yet.
11931198
def check_compiler(o):
1199+
o['variables']['use_ccache_win'] = 0
1200+
11941201
if sys.platform == 'win32':
11951202
if options.clang_cl:
11961203
o['variables']['clang'] = 1
@@ -1199,6 +1206,9 @@ def check_compiler(o):
11991206
o['variables']['clang'] = 0
12001207
o['variables']['llvm_version'] = '0.0'
12011208

1209+
if options.use_ccache_win:
1210+
o['variables']['use_ccache_win'] = 1
1211+
12021212
if not options.openssl_no_asm and options.dest_cpu in ('x86', 'x64'):
12031213
nasm_version = get_nasm_version('nasm')
12041214
o['variables']['nasm_version'] = nasm_version

tools/msvs/props_4_ccache.props

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project>
2+
<PropertyGroup>
3+
<UseMultiToolTask>true</UseMultiToolTask>
4+
<TrackFileAccess>false</TrackFileAccess>
5+
</PropertyGroup>
6+
<ItemDefinitionGroup>
7+
<ClCompile>
8+
<!-- /Z7 of cl.exe, ref: https://learn.microsoft.com/en-us/cpp/build/reference/z7-zi-zi-debug-information-format -->
9+
<DebugInformationFormat>OldStyle</DebugInformationFormat>
10+
<ObjectFileName>$(IntDir)%(FileName).obj</ObjectFileName>
11+
</ClCompile>
12+
</ItemDefinitionGroup>
13+
</Project>

tools/v8_gypfiles/v8.gyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
'type': 'none',
6262
'toolsets': ['host', 'target'],
6363
'conditions': [
64-
['OS=="win"', {
64+
['OS == "win" and (clang != 1 or use_ccache_win != 1)', {
6565
'direct_dependent_settings': {
6666
'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h',
6767
'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc',

vcbuild.bat

Lines changed: 6 additions & 1 deletion

0 commit comments

Comments
 (0)