From fb0a696db22ab27ce82eca96f1af5504313844be Mon Sep 17 00:00:00 2001 From: Maksim Levental Date: Thu, 5 Sep 2024 01:00:45 -0500 Subject: [PATCH] check llvm_install_dir --- .github/workflows/ci-windows.yml | 2 +- build_tools/build_test_cpp.ps1 | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index 2bfae7de5..7c3cebd79 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -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 diff --git a/build_tools/build_test_cpp.ps1 b/build_tools/build_test_cpp.ps1 index d6645a886..fbff491cd 100644 --- a/build_tools/build_test_cpp.ps1 +++ b/build_tools/build_test_cpp.ps1 @@ -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" @@ -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" @@ -102,6 +103,7 @@ if (Test-Path "$llvm_install_dir") } else { + echo "building bundled llvm" $CMAKE_ARGS += @("-DIREE_BUILD_PYTHON_BINDINGS=ON") }