Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
Simplify the paths to module maps generated by the Swift build rules.
Browse files Browse the repository at this point in the history
Since we pass these module maps directly to the compiler with `-fmodule-map-file`, we don't need them to be named exactly `module.modulemap`, so the extra subdirectory is also unnecessary.

PiperOrigin-RevId: 354151400
  • Loading branch information
allevato authored and swiple-rules-gardener committed Jan 27, 2021
1 parent 0ad70ff commit 71998c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions swift/internal/derived_files.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ def _intermediate_object_file(actions, target_name, src):
)

def _module_map(actions, target_name):
"""Declares the module map for the generated header of a target.
"""Declares the module map for a target.
These module maps are used when generating a Swift-compatible module map for
a C/Objective-C target, and also when generating the module map for the
generated header of a Swift target.
Args:
actions: The context's actions object.
Expand All @@ -117,9 +121,7 @@ def _module_map(actions, target_name):
Returns:
The declared `File`.
"""
return actions.declare_file(
"{}.modulemaps/module.modulemap".format(target_name),
)
return actions.declare_file("{}.swift.modulemap".format(target_name))

def _modulewrap_object(actions, target_name):
"""Declares the object file used to wrap Swift modules for ELF binaries.
Expand Down
4 changes: 2 additions & 2 deletions test/private_deps_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ def private_deps_test_suite():
private_deps_provider_test(
name = "{}_client_cc_deps_modulemaps".format(name),
expected_files = [
"/test/fixtures/private_deps/public_cc.modulemaps/module.modulemap",
"-/test/fixtures/private_deps/private_cc.modulemaps/module.modulemap",
"/test/fixtures/private_deps/public_cc.swift.modulemap",
"-/test/fixtures/private_deps/private_cc.swift.modulemap",
],
field = "transitive_modules.clang!.module_map",
provider = "SwiftInfo",
Expand Down

0 comments on commit 71998c8

Please sign in to comment.