Skip to content

Commit

Permalink
compat with our public only xcframework with static framework support
Browse files Browse the repository at this point in the history
I redid this by copying the dynamic fw impl again and changing the small
pieces needed to make it static instead
  • Loading branch information
keith committed Aug 14, 2023
1 parent 7e242cd commit f0124dd
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/testdata/xcframeworks/generate_xcframework.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,11 @@ def _generate_static_xcframework_impl(ctx):

# Copy Swift module files to intermediate directory
if include_module_interface_files:
swiftmodule_path = paths.join(library_path, label.name + ".swiftmodule")
module_interfaces = [
generation_support.copy_file(
actions = actions,
base_path = swiftmodule_path,
file = interface_file,
label = label,
target_filename = "{architecture}.{extension}".format(
Expand Down Expand Up @@ -448,26 +450,27 @@ def _generate_static_framework_xcframework_impl(ctx):
xcode_config = xcode_config,
)

dynamic_library = generation_support.create_static_library(
# Create static library
static_library = generation_support.create_static_library(
actions = actions,
apple_fragment = apple_fragment,
binary = binary,
label = label,
xcode_config = xcode_config,
)

# Create (static) framework bundle
framework_files = generation_support.create_framework(
actions = actions,
base_path = paths.join("intermediates", library_identifier),
base_path = library_identifier,
bundle_name = label.name,
library = dynamic_library,
label = label,
headers = hdrs,
label = label,
library = static_library,
)

framework_path = paths.join(
target_dir,
"intermediates",
binary.dirname,
library_identifier,
label.name + ".framework",
)
Expand Down

0 comments on commit f0124dd

Please sign in to comment.