Skip to content

Commit d0d0a57

Browse files
committed
[Xcodeproj] conditionally add default linker path
<rdar://problem/28253740> Don't add add the default linker search path in Xcode generation if there are no C Targets dependees on Swift target
1 parent eed742c commit d0d0a57

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sources/Xcodeproj/Module+PBXProj.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,13 @@ extension Module {
219219
var buildSettings = [String: Any]()
220220
let plistPath = xcodeProjectPath.appending(component: infoPlistFileName)
221221

222-
// Add default library search path to the directory where symlinks to framework
222+
// Add default library search path to the directory where symlinks to C target framework
223223
// binaries will be put with name `lib<library-name>.dylib` so that autolinking
224224
// can proceed without providing another modulemap for Xcode projects.
225225
// See: https://bugs.swift.org/browse/SR-2465
226-
buildSettings["LIBRARY_SEARCH_PATHS"] = ["$(PROJECT_TEMP_DIR)/SymlinkLibs/"]
226+
if recursiveDependencies.first(where: { $0 is ClangModule }) != nil {
227+
buildSettings["LIBRARY_SEARCH_PATHS"] = ["$(PROJECT_TEMP_DIR)/SymlinkLibs/"]
228+
}
227229

228230
if isTest {
229231
buildSettings["EMBEDDED_CONTENT_CONTAINS_SWIFT"] = "YES"

0 commit comments

Comments
 (0)