From e3a9c95d32a69fcd0e30831621e126247c99b1f8 Mon Sep 17 00:00:00 2001 From: xermicus Date: Wed, 7 May 2025 11:10:58 +0200 Subject: [PATCH] llvm-builder: use the ninja generator for building the builtins on windows (#299) The builtins build should use the Ninja generator (MSVC does not build a valid archive). Tested and verified here: https://github.com/paritytech/revive-alex-workflowtest/releases/tag/untagged-f02d0f574bab8404fead Closes #305 Signed-off-by: Cyrill Leutwiler --- .github/workflows/release-llvm.yml | 5 +++++ crates/llvm-builder/src/builtins.rs | 10 ++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release-llvm.yml b/.github/workflows/release-llvm.yml index 10778be..4c301a7 100644 --- a/.github/workflows/release-llvm.yml +++ b/.github/workflows/release-llvm.yml @@ -87,6 +87,11 @@ jobs: run: | brew install ninja + - name: Install Dependencies + if: ${{ matrix.host == 'windows' }} + run: | + choco install ninja + - name: Install LLVM Builder run: | cargo install --path crates/llvm-builder diff --git a/crates/llvm-builder/src/builtins.rs b/crates/llvm-builder/src/builtins.rs index 94aad80..8970f85 100644 --- a/crates/llvm-builder/src/builtins.rs +++ b/crates/llvm-builder/src/builtins.rs @@ -117,13 +117,7 @@ pub fn build( log::info!("building compiler-rt for rv64emac"); crate::utils::check_presence("cmake")?; - - let generator = if cfg!(target_os = "windows") { - "Visual Studio 17 2022" - } else { - crate::utils::check_presence("ninja")?; - "Ninja" - }; + crate::utils::check_presence("ninja")?; let llvm_module_compiler_rt = crate::LLVMPath::llvm_module_compiler_rt()?; let llvm_compiler_rt_build = crate::LLVMPath::llvm_build_compiler_rt()?; @@ -136,7 +130,7 @@ pub fn build( "-B", llvm_compiler_rt_build.to_string_lossy().as_ref(), "-G", - generator, + "Ninja", ]) .args(CMAKE_STATIC_ARGS) .args(cmake_dynamic_args(build_type, target_env)?)