aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Peress <peress@google.com>2023-11-08 00:16:27 +0000
committerCQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-11-08 00:16:27 +0000
commit81a298f8e62ec70852fa41f4d4716c6ed0f78158 (patch)
tree6a67cf76d24936fd05ced6de670b31d120ddb8d2
parentf5ac6f817e989b00bc7a39619073a69d91a1d0b8 (diff)
downloadpigweed-81a298f8e62ec70852fa41f4d4716c6ed0f78158.tar.gz
build: Update the default C++ standard
Remove the C++17 from the pw_build INTERFACE library and set C++20 as the standard for the host toolchains. Change-Id: Iec4963ae81d86ff298980b1a20cfa15e80f90401 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/178913 Reviewed-by: Ewout van Bekkum <ewout@google.com> Reviewed-by: Wyatt Hepler <hepler@google.com> Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> Commit-Queue: Yuval Peress <peress@google.com>
-rw-r--r--pw_build/CMakeLists.txt1
-rw-r--r--pw_toolchain/host_clang/toolchain.cmake2
-rw-r--r--pw_toolchain/host_gcc/toolchain.cmake2
3 files changed, 4 insertions, 1 deletions
diff --git a/pw_build/CMakeLists.txt b/pw_build/CMakeLists.txt
index 62a310549..4d22be379 100644
--- a/pw_build/CMakeLists.txt
+++ b/pw_build/CMakeLists.txt
@@ -27,7 +27,6 @@ pw_add_library_generic(pw_build INTERFACE
$<$<CXX_COMPILER_ID:GNU>:-fdiagnostics-color=always>
PUBLIC_DEPS
pw_build.reduced_size
- pw_build.cpp17
)
if(ZEPHYR_PIGWEED_MODULE_DIR)
target_link_libraries(pw_build INTERFACE zephyr_interface)
diff --git a/pw_toolchain/host_clang/toolchain.cmake b/pw_toolchain/host_clang/toolchain.cmake
index 6cb29c09b..37d8586c1 100644
--- a/pw_toolchain/host_clang/toolchain.cmake
+++ b/pw_toolchain/host_clang/toolchain.cmake
@@ -29,6 +29,8 @@ include($ENV{PW_ROOT}/pw_trace/backend.cmake)
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
+pw_add_global_compile_options(-std=c++20 LANGUAGES CXX)
+
# Configure backend for assert facade.
pw_set_backend(pw_assert.check pw_assert.print_and_abort_check_backend)
pw_set_backend(pw_assert.assert pw_assert.print_and_abort_assert_backend)
diff --git a/pw_toolchain/host_gcc/toolchain.cmake b/pw_toolchain/host_gcc/toolchain.cmake
index ed011e21c..019c3ae95 100644
--- a/pw_toolchain/host_gcc/toolchain.cmake
+++ b/pw_toolchain/host_gcc/toolchain.cmake
@@ -29,6 +29,8 @@ include($ENV{PW_ROOT}/pw_trace/backend.cmake)
set(CMAKE_C_COMPILER gcc)
set(CMAKE_CXX_COMPILER g++)
+pw_add_global_compile_options(-std=c++20 LANGUAGES CXX)
+
# Configure backend for assert facade.
pw_set_backend(pw_assert.check pw_assert.print_and_abort_check_backend)
pw_set_backend(pw_assert.assert pw_assert.print_and_abort_assert_backend)