Skip to content

Commit 43c9b49

Browse files
committed
[Xcodeproj] Add search path to ClangModule's own include dir
- SR-2526 - <rdar://problem/28074850> SR-2526 [xcodeproj] Add "include" dir to C target's header search paths
1 parent e7aa948 commit 43c9b49

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/Xcodeproj/Module+PBXProj.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ extension Module {
157157

158158
var headerSearchPaths: (key: String, value: String)? {
159159
let headerPathKey = "HEADER_SEARCH_PATHS"
160-
let headerPaths = dependencies.flatMap { module -> AbsolutePath? in
160+
var headerPaths = dependencies.flatMap { module -> AbsolutePath? in
161161
switch module {
162162
case let cModule as CModule:
163163
return cModule.path
@@ -168,6 +168,11 @@ extension Module {
168168
}
169169
}
170170

171+
// For ClangModules add implicit search path to its own include directory.
172+
if case let clangModule as ClangModule = self {
173+
headerPaths.append(clangModule.includeDir)
174+
}
175+
171176
guard !headerPaths.isEmpty else { return nil }
172177

173178
if headerPaths.count == 1, let first = headerPaths.first {

0 commit comments

Comments
 (0)