Skip to content

Commit 253c925

Browse files
authored
Update to C++17 [AP-3454] (#1512)
# Description @swift-nav/algint-team This updates the few C++ targets in this repo to C++17. The change consists of - Update Bazel and CMake build systems to compile C++ targets according to the C++17 standard # API compatibility Does this change introduce a API compatibility risk? No ## API compatibility plan If the above is "Yes", please detail the compatibility (or migration) plan: <!-- Provide a short explanation plan here --> # JIRA Reference https://swift-nav.atlassian.net/browse/AP-3454
1 parent 48a0b4c commit 253c925

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.bazelrc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Causes the build to default to the custom toolchain
22
build --incompatible_enable_cc_toolchain_resolution
33

4-
build --action_env=BAZEL_CXXOPTS='-std=c++14'
4+
# Compile all swift targets and all other codes with C++17 standards
5+
build --@rules_swiftnav//cc:cxx_standard=17
6+
build --@rules_swiftnav//cc:global_cxx_standard=17
57

68
build:clang-tidy --aspects @rules_swiftnav//clang_tidy:clang_tidy.bzl%clang_tidy_aspect
79
build:clang-tidy --output_groups=report
@@ -23,7 +25,7 @@ common:sanitize --@rules_swiftnav//cc:enable_symbolizer=true
2325
# the compiler falls back to a linear register allocator. This
2426
# shouldn't cause a sanitizer build to fail.
2527
common:sanitize --cxxopt=-Wno-error=disabled-optimization
26-
common:sanitize --copt=-Wno-error=disabled-optimization
28+
common:sanitize --copt=-Wno-error=disabled-optimization
2729
common:sanitize --linkopt=-Wno-error=disabled-optimization
2830
# https://github.com/bazelbuild/bazel/issues/12797#issuecomment-980641064
2931
common:sanitize --linkopt='-fsanitize-link-c++-runtime'

c/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ project(libsbp C CXX)
33

44
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake" "${CMAKE_CURRENT_LIST_DIR}/cmake/common")
55
option(I_KNOW_WHAT_I_AM_DOING_AND_HOW_DANGEROUS_IT_IS__LIBSBP_DISABLE_CRC_VALIDATION "Disable all CRC validation in Libsbp" OFF)
6+
set(SWIFT_CXX_STANDARD 17 CACHE STRING "Default C++ version for all swift targets")
67

78
include(GNUInstallDirs)
89
include(CCache)

0 commit comments

Comments
 (0)