Set CMAKE_BUILD_PARALLEL_LEVEL to available_parallelism

cmake-rs' jobserver doesn't work reliably, if at all. One workaround is
to set CMAKE_BUILD_PARALLEL_LEVEL to available_parallelism(). On my
machine it shaves ~35 seconds off of boring-sys builds.
This commit is contained in:
Rushil Mehra 2024-01-26 16:57:08 -08:00 committed by Rushil Mehra
parent c95d764cdd
commit e6833b0074
1 changed files with 4 additions and 0 deletions

View File

@ -576,6 +576,10 @@ fn built_boring_source_path(config: &Config) -> &PathBuf {
let mut cfg = get_boringssl_cmake_config(config);
if let Ok(threads) = std::thread::available_parallelism() {
cfg.env("CMAKE_BUILD_PARALLEL_LEVEL", threads.to_string());
}
if config.features.fips {
let (clang, clangxx) = verify_fips_clang_version();
cfg.define("CMAKE_C_COMPILER", clang)