Skip to content

Commit

Permalink
Windows Clang-Cl: Powershell & Ninja
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l committed Sep 11, 2023
1 parent 07b43c8 commit ffd6ac3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
12 changes: 12 additions & 0 deletions .github/ci/vcvarsall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# https://discourse.cmake.org/t/how-to-configure-cmake-on-windows-to-use-clang-cl-with-ninja-multi-config-for-intel-32-bits-intel-64-bits-and-arm64-coming-from-visual-studio/3430/10
# https://gitlab.kitware.com/cmake/cmake/-/blob/master/.gitlab/ci/vcvarsall.ps1

$erroractionpreference = "stop"

cmd /c "`"$env:VCVARSALL`" $env:VCVARSPLATFORM -vcvars_ver=$env:VCVARSVERSION & set" |
foreach {
if ($_ -match "=") {
$v = $_.split("=")
[Environment]::SetEnvironmentVariable($v[0], $v[1])
}
}
19 changes: 13 additions & 6 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

clang:
name: Clang w/o MPI shared debug
runs-on: windows-latest
runs-on: windows-2022
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v3
Expand All @@ -41,15 +41,22 @@ jobs:
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Build
run: |
$Env:VCVARSALL = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\vc\Auxiliary\build\vcvarsall.bat"
$Env:VCVARSPLATFORM = "x64"
$Env:VCVARSVERSION = "14.36"
Invoke-Expression -Command .github/ci/vcvarsall.ps1
python3 -m pip install -U pip setuptools wheel pytest
python3 -m pip install -U cmake
python3 -m pip install -r requirements.txt
cmake -S . -B build `
-T "ClangCl" `
-DCMAKE_VERBOSE_MAKEFILE=ON `
-DBUILD_SHARED_LIBS=ON `
-DAMReX_MPI=OFF `
cmake -S . -B build `
-G "Ninja" `
-DCMAKE_C_COMPILER=clang-cl `
-DCMAKE_CXX_COMPILER=clang-cl `
-DCMAKE_VERBOSE_MAKEFILE=ON `
-DBUILD_SHARED_LIBS=ON `
-DAMReX_MPI=OFF `
-DAMReX_SPACEDIM="1;2;3"
if(!$?) { Exit $LASTEXITCODE }
Expand Down

0 comments on commit ffd6ac3

Please sign in to comment.