[darwin-framework-tool] Some macosx variants does not use the right output dir (#36384)

diff --git a/examples/darwin-framework-tool/BUILD.gn b/examples/darwin-framework-tool/BUILD.gn
index f5333c9..fbe1c4d 100644
--- a/examples/darwin-framework-tool/BUILD.gn
+++ b/examples/darwin-framework-tool/BUILD.gn
@@ -53,7 +53,9 @@
 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}"
 
@@ -134,7 +136,7 @@
     "${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" ]
   }
 }
@@ -285,11 +287,12 @@
     "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" ]
   }