Skip to content

Commit

Permalink
disable CMO when compiling swiftmodule files
Browse files Browse the repository at this point in the history
Summary: Disable CMO when compiling swiftmodules in a separate action. This is required to compile correctly, otherwise we end up with swiftmodule inlining issues that fail at link time.

Reviewed By: milend

Differential Revision: D62244498

fbshipit-source-id: 3d667f686c0354486b0d2b49d75f3e86c67e37de
  • Loading branch information
rmaz authored and facebook-github-bot committed Sep 5, 2024
1 parent 1b84d0b commit 31715c0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions prelude/apple/swift/swift_compilation.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,9 @@ def _compile_swiftmodule(
swift_framework_output: SwiftLibraryForDistributionOutput | None) -> CompileArgsfiles:
argfile_cmd = cmd_args(shared_flags)
argfile_cmd.add([
"-disable-cmo",
"-emit-module",
"-experimental-emit-module-separately",
])

if ctx.attrs.swift_module_skip_function_bodies:
Expand Down

0 comments on commit 31715c0

Please sign in to comment.