From 96529df165daff39770db83f3ed62a0bce26ba7d Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 11 Feb 2025 16:05:18 -0800 Subject: Update build-llvm.ps1 (#6336) Co-authored-by: Yong He --- external/WindowsToolchain | 1 + external/build-llvm.ps1 | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) create mode 160000 external/WindowsToolchain (limited to 'external') diff --git a/external/WindowsToolchain b/external/WindowsToolchain new file mode 160000 index 000000000..675a6f7f7 --- /dev/null +++ b/external/WindowsToolchain @@ -0,0 +1 @@ +Subproject commit 675a6f7f78e27526424a281646b6d9599d1bc282 diff --git a/external/build-llvm.ps1 b/external/build-llvm.ps1 index b777d2173..ff18ed12a 100644 --- a/external/build-llvm.ps1 +++ b/external/build-llvm.ps1 @@ -32,7 +32,7 @@ function New-TemporaryDirectory { } # Check if required programs are available -$requiredPrograms = "cmake", "git" +$requiredPrograms = "cmake", "git", "ninja" foreach ($prog in $requiredPrograms) { if (-not (Get-Command $prog -ErrorAction SilentlyContinue)) { Msg "This script needs $prog, but it isn't in PATH" @@ -105,7 +105,7 @@ if (-not $installPrefix) { Fail "please set --install-prefix" } Msg "##########################################################" Msg "# Fetching LLVM from $repo at $branch" Msg "##########################################################" -# git clone --depth 1 --branch $branch $repo $sourceDir +git clone --depth 1 --branch $branch $repo $sourceDir # Configure LLVM with CMake Msg "##########################################################" @@ -138,8 +138,9 @@ $cmakeArgumentsForSlang = @( $buildDir = Join-Path $sourceDir "build" New-Item -Path $buildDir -ItemType Directory -Force - -cmake -S $sourceDir\llvm -B $buildDir $cmakeArgumentsForSlang + $extraArguments +$myScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path +$toolchainFile = Join-Path $myScriptDir "WindowsToolchain\Windows.MSVC.toolchain.cmake" +cmake -S $sourceDir\llvm -B $buildDir $cmakeArgumentsForSlang + $extraArguments -G "Ninja" --toolchain $toolchainFile # Build LLVM Msg "##########################################################" -- cgit v1.2.3