Skip to content

Commit c6146b2

Browse files
authored
Rollup merge of rust-lang#57368 - petrhosek:cmake-compiler-launcher, r=alexcrichton
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.
2 parents ebbecac + 42e65c1 commit c6146b2

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/bootstrap/native.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -346,15 +346,13 @@ fn configure_cmake(builder: &Builder,
346346
if builder.config.llvm_clang_cl.is_some() && target.contains("i686") {
347347
cfg.env("SCCACHE_EXTRA_ARGS", "-m32");
348348
}
349-
350-
// If ccache is configured we inform the build a little differently how
351-
// to invoke ccache while also invoking our compilers.
352-
} else if let Some(ref ccache) = builder.config.ccache {
353-
cfg.define("CMAKE_C_COMPILER", ccache)
354-
.define("CMAKE_C_COMPILER_ARG1", sanitize_cc(cc))
355-
.define("CMAKE_CXX_COMPILER", ccache)
356-
.define("CMAKE_CXX_COMPILER_ARG1", sanitize_cc(cxx));
357349
} else {
350+
// If ccache is configured we inform the build a little differently how
351+
// to invoke ccache while also invoking our compilers.
352+
if let Some(ref ccache) = builder.config.ccache {
353+
cfg.define("CMAKE_C_COMPILER_LAUNCHER", ccache)
354+
.define("CMAKE_CXX_COMPILER_LAUNCHER", ccache);
355+
}
358356
cfg.define("CMAKE_C_COMPILER", sanitize_cc(cc))
359357
.define("CMAKE_CXX_COMPILER", sanitize_cc(cxx));
360358
}

0 commit comments

Comments
 (0)