Skip to content

Commit c1381ac

Browse files
Add sccache option to bootstrap (electron#12582)
* Add sccache option to bootstrap Couldn't see a CC wrapper style option for gyp so we inject the sccache commands directly into the generated ninja files. * Use CC_wrapper * Update toolchain.gypi * s/sccache/cc_wrapper
1 parent 51b7322 commit c1381ac

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

script/bootstrap.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ def parse_args():
110110
help='The static library path of libchromiumcontent.')
111111
parser.add_argument('--defines', default='',
112112
help='The build variables passed to gyp')
113+
parser.add_argument('--cc_wrapper',
114+
help='Sets cc_wrapper for build. E.g. $(which sccache)')
113115
return parser.parse_args()
114116

115117

@@ -120,6 +122,8 @@ def args_to_defines(args):
120122
if args.clang_dir:
121123
defines += ' make_clang_dir=' + args.clang_dir
122124
defines += ' clang_use_chrome_plugins=0'
125+
if args.cc_wrapper is not None:
126+
defines += ' cc_wrapper=' + args.cc_wrapper
123127
return defines
124128

125129

toolchain.gypi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
# Set this to true when building with Clang.
66
'clang%': 1,
77

8+
# Set this to the absolute path to sccache when building with sccache
9+
'cc_wrapper%': '',
10+
811
# Path to mips64el toolchain.
912
'make_mips64_dir%': 'vendor/gcc-4.8.3-d197-n64-loongson/usr',
1013

@@ -101,6 +104,15 @@
101104
],
102105
},
103106
'conditions': [
107+
# Setup cc_wrapper
108+
['cc_wrapper!=""', {
109+
'make_global_settings': [
110+
['CC_wrapper', '<(cc_wrapper)'],
111+
['CXX_wrapper', '<(cc_wrapper)'],
112+
['CC.host_wrapper', '<(cc_wrapper)'],
113+
['CXX.host_wrapper', '<(cc_wrapper)']
114+
],
115+
}],
104116
# Setup building with clang.
105117
['clang==1', {
106118
'make_global_settings': [

0 commit comments

Comments
 (0)