Skip to content

Commit

Permalink
Set CMAKE_BUILD_PARALLEL_LEVEL to available_parallelism
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rushilmehra committed Feb 19, 2025
1 parent c95d764 commit e6833b0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions boring-sys/build/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e6833b0

Please sign in to comment.