Skip to content

Commit

Permalink
Start switching platforms to C++17 (linux, mac) (#28170)
Browse files Browse the repository at this point in the history
* Switch linux, mac, android to C++17 by default

* Update build/config/compiler/compiler.gni

Co-authored-by: Boris Zbarsky <[email protected]>

* Restyled by gn

---------

Co-authored-by: Andrei Litvin <[email protected]>
Co-authored-by: Boris Zbarsky <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
4 people authored and pull[bot] committed May 7, 2024
1 parent c80219a commit 1128792
Show file tree
Hide file tree
Showing 18 changed files with 3 additions and 51 deletions.
3 changes: 2 additions & 1 deletion build/config/compiler/compiler.gni
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ declare_args() {
c_standard = "gnu11"

# C++ standard level (value for -std flag).
if (current_os == "android") {
if (current_os == "linux" || current_os == "mac" || current_os == "ios" ||
current_os == "android") {
cpp_standard = "gnu++17"
} else {
cpp_standard = "gnu++14"
Expand Down
3 changes: 0 additions & 3 deletions examples/all-clusters-app/linux/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,3 @@ chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ]
matter_enable_tracing_support = true
matter_log_json_payload_decode_full = true
matter_log_json_payload_hex = true

# Perfetto requires C++17
cpp_standard = "gnu++17"
3 changes: 0 additions & 3 deletions examples/all-clusters-minimal-app/linux/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,3 @@ chip_project_config_include_dirs =
chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ]

matter_enable_tracing_support = true

# Perfetto requires C++17
cpp_standard = "gnu++17"
3 changes: 0 additions & 3 deletions examples/bridge-app/linux/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,3 @@ chip_project_config_include_dirs =
chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ]

matter_enable_tracing_support = true

# Perfetto requires C++17
cpp_standard = "gnu++17"
2 changes: 0 additions & 2 deletions examples/chef/linux/with_pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import("${chip_root}/config/standalone/args.gni")

import("//build_overrides/pigweed.gni")

cpp_standard = "gnu++17"

pw_log_BACKEND = "$dir_pw_log_basic"
pw_assert_BACKEND = "$dir_pw_assert_log:check_backend"
pw_sys_io_BACKEND = "$dir_pw_sys_io_stdio"
Expand Down
3 changes: 0 additions & 3 deletions examples/contact-sensor-app/linux/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@ chip_project_config_include_dirs =
[ "${chip_root}/examples/contact-sensor-app/linux/include" ]
chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ]
matter_enable_tracing_support = true

# Perfetto requires C++17
cpp_standard = "gnu++17"
3 changes: 0 additions & 3 deletions examples/lighting-app/linux/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,3 @@ chip_project_config_include_dirs =
chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ]

matter_enable_tracing_support = true

# Perfetto requires C++17
cpp_standard = "gnu++17"
2 changes: 0 additions & 2 deletions examples/lighting-app/linux/with_pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import("${chip_root}/config/standalone/args.gni")

import("//build_overrides/pigweed.gni")

cpp_standard = "gnu++17"

pw_log_BACKEND = "$dir_pw_log_basic"
pw_assert_BACKEND = "$dir_pw_assert_log:check_backend"
pw_sys_io_BACKEND = "$dir_pw_sys_io_stdio"
Expand Down
3 changes: 0 additions & 3 deletions examples/lock-app/linux/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,3 @@ chip_project_config_include_dirs =
[ "${chip_root}/examples/lock-app/linux/include" ]
chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ]
matter_enable_tracing_support = true

# Perfetto requires C++17
cpp_standard = "gnu++17"
3 changes: 0 additions & 3 deletions examples/log-source-app/linux/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,3 @@ import("//build_overrides/chip.gni")
import("${chip_root}/config/standalone/args.gni")

matter_enable_tracing_support = true

# Perfetto requires C++17
cpp_standard = "gnu++17"
3 changes: 0 additions & 3 deletions examples/ota-provider-app/linux/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,3 @@ chip_project_config_include_dirs =
[ "${chip_root}/examples/ota-provider-app/linux/include" ]
chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ]
matter_enable_tracing_support = true

# Perfetto requires C++17
cpp_standard = "gnu++17"
3 changes: 0 additions & 3 deletions examples/ota-requestor-app/linux/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@ chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ]

chip_enable_ota_requestor = true
matter_enable_tracing_support = true

# Perfetto requires C++17
cpp_standard = "gnu++17"
3 changes: 0 additions & 3 deletions examples/persistent-storage/linux/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,3 @@ import("//build_overrides/chip.gni")

import("${chip_root}/config/standalone/args.gni")
matter_enable_tracing_support = true

# Perfetto requires C++17
cpp_standard = "gnu++17"
3 changes: 0 additions & 3 deletions examples/placeholder/linux/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,3 @@ chip_project_config_include_dirs =
[ "${chip_root}/examples/placeholder/linux/include" ]
chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ]
matter_enable_tracing_support = true

# Perfetto requires C++17
cpp_standard = "gnu++17"
3 changes: 0 additions & 3 deletions examples/thermostat/linux/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,3 @@ import("//build_overrides/chip.gni")

import("${chip_root}/config/standalone/args.gni")
matter_enable_tracing_support = true

# Perfetto requires C++17
cpp_standard = "gnu++17"
3 changes: 0 additions & 3 deletions examples/tv-app/linux/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,3 @@ chip_enable_additional_data_advertising = true
chip_enable_rotating_device_id = true

matter_enable_tracing_support = true

# Perfetto requires C++17
cpp_standard = "gnu++17"
3 changes: 0 additions & 3 deletions examples/tv-casting-app/linux/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,3 @@ chip_enable_rotating_device_id = true
chip_max_discovered_ip_addresses = 20

matter_enable_tracing_support = true

# Perfetto requires C++17
cpp_standard = "gnu++17"
5 changes: 1 addition & 4 deletions src/tracing/tracing_args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ declare_args() {
# since tracing is very noisy, we generally expect it to be explicitly
# set up.
#
# TODO: cpp_standard check is not ideal, it should be >= 17,
# however for now this is what we use in compilations
if ((current_os == "linux" || current_os == "android") &&
cpp_standard == "gnu++17") {
if (current_os == "linux" || current_os == "android") {
matter_trace_config = "${chip_root}/src/tracing/perfetto:perfetto_tracing"
} else {
matter_trace_config = "${chip_root}/src/tracing/none"
Expand Down

0 comments on commit 1128792

Please sign in to comment.