Skip to content

Commit

Permalink
check llvm_install_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Sep 5, 2024
1 parent 55470e6 commit fb0a696
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
$env:cache_dir = "${{ env.CACHE_DIR }}"
$env:CCACHE_COMPILERCHECK = "string:$(clang-cl.exe --version)"
powershell build_tools/build_llvm.ps1
Remove-Item -Path llvm-build -Force
Remove-Item -Path "$pwd/llvm-build" -Force
powershell build_tools/build_test_cpp.ps1
- name: Create artifacts
Expand Down
14 changes: 8 additions & 6 deletions build_tools/build_test_cpp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ if (-not (Test-Path "$build_dir"))
{
New-Item -Path $build_dir -ItemType Directory | Out-Null
}
$build_dir = Resolve-Path -Path $build_dir
$cache_dir = $env:cache_dir
$llvm_install_dir = $env:llvm_install_dir
$build_dir = Resolve-Path -Path "$build_dir"
$cache_dir = "$env:cache_dir"
$llvm_install_dir = "$env:llvm_install_dir"

if (-not $cache_dir)
{
$cache_dir = "$repo_root/.build-cache"
if (-not (Test-Path "$cache_dir"))
{
New-Item -Path $cache_dir -ItemType Directory | Out-Null
New-Item -Path "$cache_dir" -ItemType Directory | Out-Null
}
$cache_dir = Resolve-Path -Path $cache_dir
$cache_dir = Resolve-Path -Path "$cache_dir"
}
echo "Caching to $cache_dir"

Expand Down Expand Up @@ -80,8 +80,9 @@ $CMAKE_ARGS = @(
"-DIREE_EXTERNAL_HAL_DRIVERS=xrt"
)

if (Test-Path "$llvm_install_dir")
if ($llvm_install_dir -and (Test-Path "$llvm_install_dir"))
{
echo "using existing llvm install @ $llvm_install_dir"
# TODO(max): send IREE a fix for this
# target_compile_definitions may only set INTERFACE properties on IMPORTED
$cmake_file = Resolve-Path -Path "$iree_dir/compiler/src/iree/compiler/API/CMakeLists.txt"
Expand All @@ -102,6 +103,7 @@ if (Test-Path "$llvm_install_dir")
}
else
{
echo "building bundled llvm"
$CMAKE_ARGS += @("-DIREE_BUILD_PYTHON_BINDINGS=ON")
}

Expand Down

0 comments on commit fb0a696

Please sign in to comment.