Skip to content

Commit 8af2bd8

Browse files
authored
Fix some configuration differences between GN & automake (#1582)
The standalone project configs now apply unless specifically overriden, which matches configure's behavior. Previously the project configs were disabled by default, so the defaults inline in CHIPConfig.h applied. Note there are at 3 sources of defaults here which lead to this confusion: (1) The defaults used by scripts/build/bootstrap.sh, which calls configure with very few arguments. This uses the standalone project configs and builds tests. (2) The defaults used by config/standalone/standalone-chip.mk, which calls configure and overrides a few arguments. This uses the standalone project configs, but disables some components, and does not build tests. (3) The defaults specified directly in CHIPConfig.h et al. These defaults may have no effect because configure always overrides them using BuildConfig.h. GN currently doesn't use BuildConfig.h, but uses the command line to get the same result.
1 parent 7df78e5 commit 8af2bd8

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

config/standalone/args.gni

+5-6
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
# Options from standalone-chip.mk that differ from configure defaults. These
16+
# options are used from examples/.
1517
chip_build_tests = false
16-
1718
config_network_layer_ble = false
18-
inet_config_enable_async_dns_sockets = false
19-
20-
project_config_include_dirs = rebase_path([ "." ])
21-
chip_project_config_include = "<CHIPProjectConfig.h>"
22-
system_project_config_include = "<SystemProjectConfig.h>"
19+
inet_config_enable_tun_endpoint = false
20+
inet_config_enable_raw_endpoint = false
21+
inet_config_enable_dns_resolver = false

src/lib/support/BUILD.gn

+8
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@ static_library("support") {
9898
"${nlassert_root}:nlassert",
9999
]
100100

101+
# These are needed because we include CHIPCore.h, which uses config
102+
# options for src/ble and src/inet, however we cannot depend on those
103+
# directly as such a dependency is cyclic.
104+
public_deps += [
105+
"${chip_root}/src/ble:ble_config_header",
106+
"${chip_root}/src/inet:inet_config_header",
107+
]
108+
101109
public_configs = [ ":support_config" ]
102110

103111
if (chip_config_memory_management == "simple") {

src/system/BUILD.gn

+8-2
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ import("system.gni")
2222
declare_args() {
2323
# Extra header to include in CHIPConfig.h for project.
2424
# TODO - This should probably be in src/core but src/system also uses it.
25-
chip_project_config_include = ""
25+
chip_project_config_include = "<CHIPProjectConfig.h>"
2626

2727
# Extra header to include in CHIPConfig.h for platform.
2828
# TODO - This should probably be in src/core but src/system also uses it.
2929
chip_platform_config_include = ""
3030

3131
# Extra header to include in SystemConfig.h for project.
32-
system_project_config_include = ""
32+
system_project_config_include = "<SystemProjectConfig.h>"
3333

3434
# Extra header to include in SystemConfig.h for platform.
3535
system_platform_config_include = ""
@@ -38,6 +38,12 @@ declare_args() {
3838
project_config_include_dirs = []
3939
}
4040

41+
if (project_config_include_dirs == [] &&
42+
chip_project_config_include == "<CHIPProjectConfig.h>" &&
43+
system_project_config_include == "<SystemProjectConfig.h>") {
44+
project_config_include_dirs += [ "${chip_root}/config/standalone" ]
45+
}
46+
4147
config("system_config") {
4248
configs = [ "${chip_root}/src:includes" ]
4349

0 commit comments

Comments
 (0)