Use sccache for rust builds

This commit is contained in:
Mikhail f. Shiryaev 2023-08-10 16:17:00 +02:00
parent dbd3fdd437
commit ed7ade255a
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4
2 changed files with 8 additions and 0 deletions

View File

@ -5,6 +5,7 @@ CXXFLAGS = "@RUST_CXXFLAGS@"
[build] [build]
rustflags = @RUSTFLAGS@ rustflags = @RUSTFLAGS@
rustdocflags = @RUSTFLAGS@ rustdocflags = @RUSTFLAGS@
@RUSTCWRAPPER@
[unstable] [unstable]
@RUST_CARGO_BUILD_STD@ @RUST_CARGO_BUILD_STD@

View File

@ -14,6 +14,13 @@ macro(configure_rustc)
set(RUST_CFLAGS "${RUST_CFLAGS} --sysroot ${CMAKE_SYSROOT}") set(RUST_CFLAGS "${RUST_CFLAGS} --sysroot ${CMAKE_SYSROOT}")
endif() endif()
if(CCACHE_EXECUTABLE MATCHES "/sccache$")
message(STATUS "Using RUSTC_WRAPPER: ${CCACHE_EXECUTABLE}")
set(RUSTCWRAPPER "rustc-wrapper = \"${CCACHE_EXECUTABLE}\"")
else()
set(RUSTCWRAPPER "")
endif()
set(RUSTFLAGS "[]") set(RUSTFLAGS "[]")
set(RUST_CARGO_BUILD_STD "") set(RUST_CARGO_BUILD_STD "")
# For more info: https://doc.rust-lang.org/beta/unstable-book/compiler-flags/sanitizer.html#memorysanitizer # For more info: https://doc.rust-lang.org/beta/unstable-book/compiler-flags/sanitizer.html#memorysanitizer