diff options
| author | Bert Belder <bertbelder@gmail.com> | 2018-09-07 20:19:44 +0200 |
|---|---|---|
| committer | Bert Belder <bertbelder@gmail.com> | 2018-09-08 23:55:18 +0200 |
| commit | 30b268dd7d8da498c15907470bc5d7b642664317 (patch) | |
| tree | fbfe7d79c80b2ad82c20f0402f08665ac5d55ba1 /build_extra/toolchain | |
| parent | 3deaf99a92aeea347e1530f309fd4b226e9677d3 (diff) | |
build: override host_toolchain on windows to use sccache with v8
Diffstat (limited to 'build_extra/toolchain')
| -rw-r--r-- | build_extra/toolchain/validate.gni | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/build_extra/toolchain/validate.gni b/build_extra/toolchain/validate.gni index 79c013e8d..a1fe7189b 100644 --- a/build_extra/toolchain/validate.gni +++ b/build_extra/toolchain/validate.gni @@ -2,14 +2,18 @@ import("//build/toolchain/cc_wrapper.gni") -# Verify that cc_wrapper is correctly set up on Windows. -if (is_win && cc_wrapper != "" && custom_toolchain == "") { - suggested_toolchain = "//build_extra/toolchain/win:win_clang_$target_cpu" +# Verify that the cc_wrapper/toolchain combo correctly set up on Windows. +if (is_win && cc_wrapper != "") { + cc_wrapper_toolchain = "//build_extra/toolchain/win:win_clang_$target_cpu" + toolchain_supports_cc_wrapper = cc_wrapper_toolchain == default_toolchain && + cc_wrapper_toolchain == host_toolchain - # Use print instead of assert with message for readability. - print( - "The 'cc_wrapper' option isn't supported by the default Windows toolchain.") - print("To make it work, add the option:") - print(" custom_toolchain=\"$suggested_toolchain\"") - assert(custom_toolchain != "") + if (!toolchain_supports_cc_wrapper) { + # Using print instead of assert-with-message for readability of the output. + print("The 'cc_wrapper' option isn't supported by the default Windows" + + " toolchain. To make it work, add these gn arguments:") + print(" custom_toolchain=\"$cc_wrapper_toolchain\"") + print(" host_toolchain=\"$cc_wrapper_toolchain\"") + assert(toolchain_supports_cc_wrapper) + } } |
