diff options
| author | Petr Hosek <phosek@google.com> | 2019-01-05 19:11:27 -0800 |
|---|---|---|
| committer | Petr Hosek <phosek@google.com> | 2019-01-05 19:11:27 -0800 |
| commit | 42e65c164d0ee00bd3bb3716b5aa50d490006632 (patch) | |
| tree | e92145db1ee333e7d68ea6037b93b126851362ce /src/bootstrap | |
| parent | 36500deb1a276e47e9780876c136e8ceea46a860 (diff) | |
| download | rust-42e65c164d0ee00bd3bb3716b5aa50d490006632.tar.gz rust-42e65c164d0ee00bd3bb3716b5aa50d490006632.zip | |
Use CMAKE_{C,CXX}_COMPILER_LAUNCHER for ccache
CMake 3.4 and newer which is the required minimum version for LLVM
supports CMAKE_{C,CXX}_COMPILER_LAUNCHER for settting the compiler
launcher such as ccache which doesn't require shifting arguments.
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/native.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index c548d7f6948..83212b131c8 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -347,15 +347,13 @@ fn configure_cmake(builder: &Builder, if builder.config.llvm_clang_cl.is_some() && target.contains("i686") { cfg.env("SCCACHE_EXTRA_ARGS", "-m32"); } - - // If ccache is configured we inform the build a little differently how - // to invoke ccache while also invoking our compilers. - } else if let Some(ref ccache) = builder.config.ccache { - cfg.define("CMAKE_C_COMPILER", ccache) - .define("CMAKE_C_COMPILER_ARG1", sanitize_cc(cc)) - .define("CMAKE_CXX_COMPILER", ccache) - .define("CMAKE_CXX_COMPILER_ARG1", sanitize_cc(cxx)); } else { + // If ccache is configured we inform the build a little differently how + // to invoke ccache while also invoking our compilers. + if let Some(ref ccache) = builder.config.ccache { + cfg.define("CMAKE_C_COMPILER_LAUNCHER", ccache) + .define("CMAKE_CXX_COMPILER_LAUNCHER", ccache); + } cfg.define("CMAKE_C_COMPILER", sanitize_cc(cc)) .define("CMAKE_CXX_COMPILER", sanitize_cc(cxx)); } |
