Skip to content

Commit

Permalink
Move matter_enable_recommended into /config/recommended.gni
Browse files Browse the repository at this point in the history
This allows it to be uesd from args.gni (i.e. in the context of a default_args
scope, where variables like current_os are not defined) as well as within a
build / toolchain context.
  • Loading branch information
ksperling-apple committed Sep 10, 2024
1 parent 50a9365 commit c7371c7
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 20 deletions.
31 changes: 31 additions & 0 deletions config/recommended.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright (c) 2024 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

declare_args() {
# Note for SDK developers: As additional features with their own settings
# are added to the SDK, consider using the `matter_enable_recommended`
# meta-setting instead of a default value of 'true', especially where a
# different default is used based on platform (current_os): Often various
# debugging features have previously been defaulted to on for Linux and/or
# Mac but off for embedded platforms (on the assumption that Linux / Mac
# don't have resource constraints?); build settings of that nature should
# instead reference this meta-setting. E.g.
# enable_flux_capacitor = matter_enable_recommended && current_os == "linux"

# Enable recommended settings by default. This is a meta-setting
# that is enabled by default, and acts as a default for various
# other settings. Setting it to false produces a more conservative /
# minimal set of defaults.
matter_enable_recommended = true
}
3 changes: 1 addition & 2 deletions examples/shell/shell_common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
# limitations under the License.

import("//build_overrides/chip.gni")
import("//build_overrides/openthread.gni")
import("${chip_root}/src/lib/core/core.gni")
import("${chip_root}/config/recommended.gni")
import("${chip_root}/src/platform/device.gni")

declare_args() {
Expand Down
2 changes: 1 addition & 1 deletion src/app/common_flags.gni
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

import("//build_overrides/chip.gni")
import("${chip_root}/src/lib/core/core.gni")
import("${chip_root}/config/recommended.gni")

declare_args() {
# Temporary flag for interaction model and echo protocols, set it to true to enable
Expand Down
17 changes: 3 additions & 14 deletions src/lib/core/core.gni
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

declare_args() {
# Enable recommended settings by default. This is a meta-setting
# that is enabled by default, and acts as a default for various
# other settings. Setting it to false produces a more conservative /
# minimal set of defaults.
#
# As additional features with their own settings are added to the SDK,
# consider using this meta-setting instead of a default value of 'true',
# especially where a different default is used based on platform (current_os):
# E.g. various debugging features have previously been defaulted to on
# for Linux and/or Mac but off for embedded platforms (on the assumption
# that Linux / Mac don't have resource constraints?); build settings of that
# nature should instead reference this meta-setting.
matter_enable_recommended = true
import("//build_overrides/chip.gni")
import("${chip_root}/config/recommended.gni")

declare_args() {
# Enable logging. Shorthand for chip_error_logging, etc.
chip_logging = true
}
Expand Down
4 changes: 1 addition & 3 deletions src/tracing/tracing_args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("${build_root}/config/compiler/compiler.gni")
import("${chip_root}/src/lib/core/core.gni")
import("${chip_root}/config/recommended.gni")
import("${chip_root}/src/platform/device.gni")

declare_args() {
Expand Down

0 comments on commit c7371c7

Please sign in to comment.