mirror of
https://github.com/nlohmann/json.git
synced 2024-08-22 04:52:35 +02:00
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]: 4fe34b2d29
31 lines
842 B
YAML
31 lines
842 B
YAML
name: Windows
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
clang-cl-10-x64:
|
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- name: cmake
|
|
run: cmake -S . -B build -G "Visual Studio 16 2019" -A x64 -T ClangCL -DJSON_BuildTests=On
|
|
- name: build
|
|
run: cmake --build build --config Debug --parallel 10
|
|
- name: test
|
|
run: cd build ; ctest -j 10 -C Debug --exclude-regex "test-unicode" --output-on-failure
|
|
|
|
clang-cl-10-x86:
|
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- name: cmake
|
|
run: cmake -S . -B build -G "Visual Studio 16 2019" -A Win32 -T ClangCL -DJSON_BuildTests=On
|
|
- name: build
|
|
run: cmake --build build --config Debug --parallel 10
|
|
- name: test
|
|
run: cd build ; ctest -j 10 -C Debug --exclude-regex "test-unicode" --output-on-failure
|