Skip to content

Commit

Permalink
Adds headermap as a dep (bazel-xcode#162)
Browse files Browse the repository at this point in the history
When we `enableHeaderMap`, this is required to be a dependency. Note:
that this is a workaround for an issue with Bazel not including
`swiftc_inputs` as a pre-requisite
  • Loading branch information
jerrymarino authored Aug 3, 2020
1 parent ea20598 commit 58906de
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sources/PodToBUILD/SwiftLibrary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,13 @@ public struct SwiftLibrary: BazelTarget {
// Note: we don't expose this module map upwards.
// Dependent top level objc libraries will expose an extended module map
let headerMapName = self.name.replacingOccurrences(of: "_swift", with: "")
var deps = self.deps
if options.generateHeaderMap {
swiftcInputs = swiftcInputs <> AttrSet(basic: [
let hmapDep = AttrSet(basic: [
":" + headerMapName + "_hmap",
])
swiftcInputs = swiftcInputs <> hmapDep
deps = deps <> hmapDep
copts = copts <> AttrSet(basic: [
"-Xcc",
"-I$(execpath " + headerMapName + "_hmap)",
Expand All @@ -196,7 +199,6 @@ public struct SwiftLibrary: BazelTarget {
"-Xcc",
"-I.",
])
var deps = self.deps
if let moduleMap = self.moduleMap {
copts = copts <> AttrSet(basic: [
"-Xcc",
Expand Down

0 comments on commit 58906de

Please sign in to comment.