Skip to content

Commit 59ff857

Browse files
committed
Windows Clang-Cl: Powershell & Ninja
1 parent 07b43c8 commit 59ff857

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed

.github/ci/vcvarsall.ps1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# 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
2+
# https://gitlab.kitware.com/cmake/cmake/-/blob/master/.gitlab/ci/vcvarsall.ps1
3+
4+
$erroractionpreference = "stop"
5+
6+
cmd /c "`"$env:VCVARSALL`" $env:VCVARSPLATFORM -vcvars_ver=$env:VCVARSVERSION & set" |
7+
foreach {
8+
if ($_ -match "=") {
9+
$v = $_.split("=")
10+
[Environment]::SetEnvironmentVariable($v[0], $v[1])
11+
}
12+
}

.github/workflows/windows.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
clang:
3333
name: Clang w/o MPI shared debug
34-
runs-on: windows-latest
34+
runs-on: windows-2022
3535
if: github.event.pull_request.draft == false
3636
steps:
3737
- uses: actions/checkout@v3
@@ -41,15 +41,22 @@ jobs:
4141
- uses: seanmiddleditch/gha-setup-ninja@master
4242
- name: Build
4343
run: |
44+
$Env:VCVARSALL = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\vc\Auxiliary\build\vcvarsall.bat"
45+
$Env:VCVARSPLATFORM = "x64"
46+
$Env:VCVARSVERSION = "14.36.32532"
47+
Invoke-Expression -Command .github/ci/vcvarsall.ps1
48+
4449
python3 -m pip install -U pip setuptools wheel pytest
4550
python3 -m pip install -U cmake
4651
python3 -m pip install -r requirements.txt
4752
48-
cmake -S . -B build `
49-
-T "ClangCl" `
50-
-DCMAKE_VERBOSE_MAKEFILE=ON `
51-
-DBUILD_SHARED_LIBS=ON `
52-
-DAMReX_MPI=OFF `
53+
cmake -S . -B build `
54+
-G "Ninja" `
55+
-DCMAKE_C_COMPILER=clang-cl `
56+
-DCMAKE_CXX_COMPILER=clang-cl `
57+
-DCMAKE_VERBOSE_MAKEFILE=ON `
58+
-DBUILD_SHARED_LIBS=ON `
59+
-DAMReX_MPI=OFF `
5360
-DAMReX_SPACEDIM="1;2;3"
5461
if(!$?) { Exit $LASTEXITCODE }
5562

0 commit comments

Comments
 (0)