diff --git a/examples/darwin-framework-tool/BUILD.gn b/examples/darwin-framework-tool/BUILD.gn index 51746d12455679..c114d430da203e 100644 --- a/examples/darwin-framework-tool/BUILD.gn +++ b/examples/darwin-framework-tool/BUILD.gn @@ -27,6 +27,11 @@ assert(chip_build_tools) declare_args() { chip_codesign = current_os == "ios" + + # When config_enable_yaml_tests is false, the Matter SDK options are not available. + if (!config_enable_yaml_tests) { + chip_inet_config_enable_ipv4 = true + } } sdk = "macosx" @@ -68,6 +73,10 @@ action("build-darwin-framework") { ] } + if (!chip_inet_config_enable_ipv4) { + args += [ "--no-ipv4" ] + } + output_name = "Matter.framework" outputs = [ "${root_out_dir}/macos_framework_output/Build/Products/${output_sdk_type}/${output_name}", diff --git a/scripts/build/build_darwin_framework.py b/scripts/build/build_darwin_framework.py index 77b033d019883f..7d638bdd2c708e 100644 --- a/scripts/build/build_darwin_framework.py +++ b/scripts/build/build_darwin_framework.py @@ -70,6 +70,11 @@ def build_darwin_framework(args): "GCC_INLINES_ARE_PRIVATE_EXTERN=NO", "GCC_SYMBOLS_PRIVATE_EXTERN=NO", ] + + if not args.ipv4: + command += [ + "CHIP_INET_CONFIG_ENABLE_IPV4=NO", + ] command_result = run_command(command) print("Build Framework Result: {}".format(command_result)) @@ -108,6 +113,7 @@ def build_darwin_framework(args): parser.add_argument("--log_path", help="Output log file destination", required=True) + parser.add_argument('--ipv4', action=argparse.BooleanOptionalAction) args = parser.parse_args() build_darwin_framework(args) diff --git a/src/darwin/Framework/chip_xcode_build_connector.sh b/src/darwin/Framework/chip_xcode_build_connector.sh index 0357064c6c626c..ab94517c93f2f8 100755 --- a/src/darwin/Framework/chip_xcode_build_connector.sh +++ b/src/darwin/Framework/chip_xcode_build_connector.sh @@ -113,6 +113,12 @@ declare -a args=( ) } +[[ $CHIP_INET_CONFIG_ENABLE_IPV4 == NO ]] && { + args+=( + 'chip_inet_config_enable_ipv4=false' + ) +} + # search current (or $2) and its parent directories until # a name match is found, which is output on stdout find_in_ancestors() {