Skip to content

Commit 7c3b729

Browse files
committed
Update build-llvm.ps1
1 parent 3c2d46a commit 7c3b729

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@
3838
[submodule "external/slang-rhi"]
3939
path = external/slang-rhi
4040
url = https://github.com/shader-slang/slang-rhi.git
41+
[submodule "external/WindowsToolchain"]
42+
path = external/WindowsToolchain
43+
url = https://github.com/MarkSchofield/WindowsToolchain/

external/WindowsToolchain

Submodule WindowsToolchain added at 675a6f7

external/build-llvm.ps1

+5-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function New-TemporaryDirectory {
3232
}
3333

3434
# Check if required programs are available
35-
$requiredPrograms = "cmake", "git"
35+
$requiredPrograms = "cmake", "git", "ninja"
3636
foreach ($prog in $requiredPrograms) {
3737
if (-not (Get-Command $prog -ErrorAction SilentlyContinue)) {
3838
Msg "This script needs $prog, but it isn't in PATH"
@@ -105,7 +105,7 @@ if (-not $installPrefix) { Fail "please set --install-prefix" }
105105
Msg "##########################################################"
106106
Msg "# Fetching LLVM from $repo at $branch"
107107
Msg "##########################################################"
108-
# git clone --depth 1 --branch $branch $repo $sourceDir
108+
git clone --depth 1 --branch $branch $repo $sourceDir
109109

110110
# Configure LLVM with CMake
111111
Msg "##########################################################"
@@ -138,8 +138,9 @@ $cmakeArgumentsForSlang = @(
138138

139139
$buildDir = Join-Path $sourceDir "build"
140140
New-Item -Path $buildDir -ItemType Directory -Force
141-
142-
cmake -S $sourceDir\llvm -B $buildDir $cmakeArgumentsForSlang + $extraArguments
141+
$myScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
142+
$toolchainFile = Join-Path $myScriptDir "WindowsToolchain\Windows.MSVC.toolchain.cmake"
143+
cmake -S $sourceDir\llvm -B $buildDir $cmakeArgumentsForSlang + $extraArguments -G "Ninja" --toolchain $toolchainFile
143144

144145
# Build LLVM
145146
Msg "##########################################################"

0 commit comments

Comments
 (0)