Skip to content

Commit

Permalink
[7.0.0] Build Bazel with C++17. (bazelbuild#20174)
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.

Commit
bazelbuild@ba38aa2

PiperOrigin-RevId: 581952933
Change-Id: I0753249e2182b3ab499bc91a384ad93ec59d65f8

Co-authored-by: Tiago Quelhas <[email protected]>
  • Loading branch information
bazel-io and tjgq authored Nov 13, 2023
1 parent ca62ca1 commit 2bd3592
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 2bd3592

Please sign in to comment.