diff options
| author | Yong He <yonghe@outlook.com> | 2025-02-11 16:05:18 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-11 16:05:18 -0800 |
| commit | 96529df165daff39770db83f3ed62a0bce26ba7d (patch) | |
| tree | 520926d1e63fb38be0fdf5e55b72c6d1d997337c | |
| parent | 551bbb5fbd61b53253de8f6ba3303bb4d29f8c86 (diff) | |
Update build-llvm.ps1 (#6336)
Co-authored-by: Yong He <yongh@outlook.com>
| -rw-r--r-- | .gitmodules | 3 | ||||
| m--------- | external/WindowsToolchain | 0 | ||||
| -rw-r--r-- | external/build-llvm.ps1 | 9 |
3 files changed, 8 insertions, 4 deletions
diff --git a/.gitmodules b/.gitmodules index d5bfdc007..3d00fe8f1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -38,3 +38,6 @@ [submodule "external/slang-rhi"] path = external/slang-rhi url = https://github.com/shader-slang/slang-rhi.git +[submodule "external/WindowsToolchain"] + path = external/WindowsToolchain + url = https://github.com/MarkSchofield/WindowsToolchain/ diff --git a/external/WindowsToolchain b/external/WindowsToolchain new file mode 160000 +Subproject 675a6f7f78e27526424a281646b6d9599d1bc28 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 "##########################################################" |
