Skip to content

Commit

Permalink
minor refactor of swift framework support
Browse files Browse the repository at this point in the history
Summary: Minor tidy moving some flags around

Reviewed By: maxovtsin

Differential Revision: D66713567

fbshipit-source-id: 19318c2b427b5f1d162f9c9b70d810312fe58161
  • Loading branch information
rmaz authored and facebook-github-bot committed Dec 4, 2024
1 parent bde1837 commit 0558806
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions apple/swift/swift_compilation.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,6 @@ def _compile_swiftmodule(
argfile_cmd = cmd_args(shared_flags)
argfile_cmd.add([
"-disable-cmo",
"-emit-module",
"-experimental-emit-module-separately",
"-wmo",
])
Expand All @@ -454,28 +453,33 @@ def _compile_swiftmodule(
"-experimental-skip-non-inlinable-function-bodies-without-types",
])

if _should_compile_with_evolution(ctx):
argfile_cmd.add(["-enable-library-evolution"])
argfile_cmd.add(["-emit-module-interface"])

cmd = cmd_args([
"-emit-objc-header",
"-emit-objc-header-path",
output_header.as_output(),
"-emit-module",
"-emit-module-path",
output_swiftmodule.as_output(),
])

if swift_framework_output:
# this is generated implicitly once we pass -emit-module
cmd.add(cmd_args(hidden = swift_framework_output.swiftdoc.as_output()))
if _should_compile_with_evolution(ctx):
if not swift_framework_output:
fail("Building with library evolution but missing outputs")

argfile_cmd.add([
"-enable-library-evolution",
])
cmd.add([
"-emit-parseable-module-interface-path",
"-emit-module-interface",
"-emit-module-interface-path",
swift_framework_output.swiftinterface.as_output(),
"-emit-private-module-interface-path",
swift_framework_output.private_swiftinterface.as_output(),
])

# There is no driver flag to specify the swiftdoc output path
cmd.add(cmd_args(hidden = swift_framework_output.swiftdoc.as_output()))

output_tbd = None
if output_symbols != None:
# Two step process, first we need to emit the TBD
Expand Down

0 comments on commit 0558806

Please sign in to comment.