diff --git a/lib/config.js b/lib/config.js index 96ea63d49..9dbc10643 100644 --- a/lib/config.js +++ b/lib/config.js @@ -43,6 +43,7 @@ const Config = function () { this.mac_signing_identifier = getNPMConfig(['mac_signing_identifier']) || '' this.mac_signing_keychain = getNPMConfig(['mac_signing_keychain']) || 'login' this.channel = '' + this.sccache = getNPMConfig(['sccache']) } Config.prototype.buildArgs = function () { @@ -94,12 +95,9 @@ Config.prototype.buildArgs = function () { args.is_win_fastlink = true } - if (!this.officialBuild && process.platform === 'win32') { - let sccache = getNPMConfig(['sccache']) - if (sccache) { - args.clang_use_chrome_plugins = false - args.enable_precompiled_headers = false - } + if (this.sccache && process.platform === 'win32') { + args.clang_use_chrome_plugins = false + args.enable_precompiled_headers = false args.use_thin_lto = true } @@ -108,14 +106,6 @@ Config.prototype.buildArgs = function () { args.symbol_level = 1 } - // TODO: Build redirect-cc.cmd in such a way that it still works with ccache if configured - /* - let sccache = getNPMConfig(['sccache']) - if (sccache) { - args.cc_wrapper = sccache - } - */ - if (process.platform === 'win32') { args.cc_wrapper = path.join(this.srcDir, 'brave', 'script' ,'redirect-cc.cmd') } else { @@ -289,9 +279,8 @@ Object.defineProperty(Config.prototype, 'defaultOptions', { env.TARGET_ARCH = this.gypTargetArch // for brave scripts env.GYP_MSVS_VERSION = env.GYP_MSVS_VERSION || '2017' // enable 2017 - let sccache = getNPMConfig(['sccache']) - if (sccache) { - env.CC_WRAPPER = sccache + if (this.sccache) { + env.CC_WRAPPER = this.sccache } if (process.platform === 'linux') {