Skip to content

Commit 25a59b5

Browse files
committed
Github Actions: Add ClangCL on Windows
MS Visual Studio 2019 has builtin support for other compiler toolsets [1]. This commit adds support for compiling using LLVM/Clang 10 using Visual Studio. ClangCL pretends to be MSVC so the usual MSVC flags apply, see also [2]. For detecting if ClangCL is used, newer cmake verisons (>= 3.15) have builtin support using CMAKE_CXX_COMPILER_FRONTEND_VARIANT [3], for older ones a workaround is available using CMAKE_CXX_SIMULATE_ID [4]. [1]: https://devblogs.microsoft.com/cppblog/clang-llvm-support-in-visual-studio/ [2]: https://clang.llvm.org/docs/UsersManual.html#clang-cl [3]: https://stackoverflow.com/a/10055571 [4]: microsoft/CMake@4fe34b2
1 parent 6d7f8b3 commit 25a59b5

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Windows
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
clang-cl-10-x64:
7+
8+
runs-on: windows-latest
9+
10+
steps:
11+
- uses: actions/checkout@v1
12+
- name: cmake
13+
run: cmake -S . -B build -G "Visual Studio 16 2019" -A x64 -T ClangCL -DJSON_BuildTests=On
14+
- name: build
15+
run: cmake --build build --config Debug --parallel 10
16+
- name: test
17+
run: cd build ; ctest -j 10 -C Debug --exclude-regex "test-unicode" --output-on-failure
18+
19+
clang-cl-10-x86:
20+
21+
runs-on: windows-latest
22+
23+
steps:
24+
- uses: actions/checkout@v1
25+
- name: cmake
26+
run: cmake -S . -B build -G "Visual Studio 16 2019" -A Win32 -T ClangCL -DJSON_BuildTests=On
27+
- name: build
28+
run: cmake --build build --config Debug --parallel 10
29+
- name: test
30+
run: cd build ; ctest -j 10 -C Debug --exclude-regex "test-unicode" --output-on-failure

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,7 @@ The following compilers are currently used in continuous integration at [Travis]
12541254
| MSVC 19.16.27035.0 (15.9.21+g9802d43bc3 for .NET Framework) | Windows-10.0.14393 | AppVeyor |
12551255
| MSVC 19.25.28614.0 (Build Engine version 16.5.0+d4cbfca49 for .NET Framework) | Windows-10.0.17763 | AppVeyor |
12561256
| MSVC 19.25.28614.0 (Build Engine version 16.5.0+d4cbfca49 for .NET Framework) | Windows-10.0.17763 | GitHub Actions |
1257+
| MSVC 19.25.28614.0 (Build Engine version 16.5.0+d4cbfca49 for .NET Framework) with ClangCL 10.0.0 | Windows-10.0.17763 | GitHub Actions |
12571258
12581259
## License
12591260

0 commit comments

Comments
 (0)