Skip to content

Commit

Permalink
[darwin-framework-tool] Propagate chip_inet_config_enable_ipv4 to chi…
Browse files Browse the repository at this point in the history
…p_xcode_build_connector.sh (#23683)
  • Loading branch information
vivien-apple authored and pull[bot] committed Jul 5, 2023
1 parent 4a94566 commit bba0323
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/darwin-framework-tool/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -68,6 +73,10 @@ action("build-darwin-framework") {
]
}

if (defined(chip_inet_config_enable_ipv4) && !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}",
Expand Down
6 changes: 6 additions & 0 deletions scripts/build/build_darwin_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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)
6 changes: 6 additions & 0 deletions src/darwin/Framework/chip_xcode_build_connector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit bba0323

Please sign in to comment.