Skip to content

Commit

Permalink
[darwin-framework-tool] Some macosx variants does not use the right o…
Browse files Browse the repository at this point in the history
…utput dir
  • Loading branch information
vivien-apple committed Nov 6, 2024
1 parent 4fce9b9 commit 0c93a70
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions examples/darwin-framework-tool/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ sdk_build_dir_suffix = ""
if (getenv("SDKROOT") != "") {
sdk = getenv("SDKROOT")
sdk_root_parts = string_split(getenv("SDKROOT"), ".")
sdk_build_dir_suffix = "-${sdk_root_parts[0]}"
if (sdk_root_parts[0] != "macosx") {
sdk_build_dir_suffix = "-${sdk_root_parts[0]}"
}
}
output_sdk_type = "Debug${sdk_build_dir_suffix}"

Expand Down Expand Up @@ -134,7 +136,7 @@ action("build-darwin-framework") {
"${root_out_dir}/macos_framework_output/Build",
]

if (sdk == "macosx") {
if (sdk == "macosx" || sdk_root_parts[0] == "macosx") {
outputs += [ "${root_out_dir}/macos_framework_output/Build/Intermediates.noindex/Matter.build/${output_sdk_type}/Matter.build/out/lib/libCHIP.a" ]
}
}
Expand Down Expand Up @@ -285,11 +287,12 @@ executable("darwin-framework-tool") {
"Foundation.framework",
"CoreBluetooth.framework",
"Network.framework",
"IOKit.framework",
]

# Other SDKs are linked statically to Matter.framework but the macosx SDK is linked dynamically but needs some symbols that are
# not exposed by the dylib.
if (sdk == "macosx") {
if (sdk == "macosx" || sdk_root_parts[0] == "macosx") {
libs = [ "${root_out_dir}/macos_framework_output/Build/Intermediates.noindex/Matter.build/${output_sdk_type}/Matter.build/out/lib/libCHIP.a" ]
}

Expand Down

0 comments on commit 0c93a70

Please sign in to comment.