Skip to content

Commit

Permalink
On Windows, use c++20 mode as correctly needed for designated initial…
Browse files Browse the repository at this point in the history
…izers.

Designated initializers is technically only supported starting with c++20,
and the compiler on Windows points that out with an error.
  • Loading branch information
hzeller committed Dec 14, 2023
1 parent cfcbb82 commit 818e899
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ common:macos --features=-supports_dynamic_linker --linkopt=-framework --linkopt=
# Force the use clang-cl on Windows instead of MSVC. MSVC has some issues with
# the codebase, so we focus the effort for now is to have a Windows Verible
# compiled with clang-cl before fixing the issues unique to MSVC.
common:windows --compiler=clang-cl --cxxopt=/std:c++17 --host_cxxopt=/std:c++17 --client_env=BAZEL_CXXOPTS=/std:c++17
# Since we use designated initializers (C99 ... but >= c++20), compiler really wants the c++20 mode
common:windows --compiler=clang-cl --cxxopt=/std:c++20 --host_cxxopt=/std:c++20 --client_env=BAZEL_CXXOPTS=/std:c++20

# Address sanitizer settings.
build:asan --strip=never
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/verible-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -500,17 +500,20 @@ jobs:
restore-keys: bazelcache_windows2_

- name: Install dependencies
# Bazel breaks on Windows with LLVM 16. Will be fixed in bazel 6.4
run: choco install llvm --force --version=15.0.7
run: |
choco install bazel --force --version=6.4.0
choco install llvm --force
choco list -lo
BAZEL_BIN=C:/ProgramData/chocolatey/lib/bazel/bazel.exe

- name: Debug bazel directory settings
run: bazel info
run: $BAZEL_BIN info

- name: Run Tests
run: bazel test --keep_going --noshow_progress --test_output=errors //...
run: bazel-6 test --keep_going --noshow_progress --test_output=errors //...

- name: Build Verible Binaries
run: bazel build --keep_going --noshow_progress -c opt :install-binaries
run: bazel-6 build --keep_going --noshow_progress -c opt :install-binaries

- name: Prepare release
run: |
Expand Down

0 comments on commit 818e899

Please sign in to comment.