Skip to content

Commit

Permalink
Build Bazel with C++17.
Browse files Browse the repository at this point in the history
In upcoming changes, we'd like to have the ability to use C++17 features.
This ensures that such code will build successfully on the various CI
platforms, regardless of the C++ standard version the compiler defaults to.

Closes bazelbuild#20085.

PiperOrigin-RevId: 581952933
Change-Id: I0753249e2182b3ab499bc91a384ad93ec59d65f8
  • Loading branch information
tjgq authored and copybara-github committed Nov 13, 2023
1 parent dbaa074 commit ba38aa2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ common:bzlmod --experimental_downloader_config=bazel_downloader.cfg
common --config=bzlmod
common --lockfile_mode=update

# Enable modern C++ features
build:linux --cxxopt=-std=c++17
build:linux --host_cxxopt=-std=c++17
build:macos --cxxopt=-std=c++17
build:macos --host_cxxopt=-std=c++17
build:windows --cxxopt=/std:c++17
build:windows --host_cxxopt=/std:c++17

# Enable Java 11 language features (https://github.com/bazelbuild/bazel/issues/14592)
build --java_language_version=11
build --tool_java_language_version=11
Expand Down

0 comments on commit ba38aa2

Please sign in to comment.