New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Xcodeproj] Allow adding to LD_RUNPATH_SEARCH_PATHS with a custom xcconfig #1343
[Xcodeproj] Allow adding to LD_RUNPATH_SEARCH_PATHS with a custom xcconfig #1343
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks good! Some minor comments inline.
Sources/Xcodeproj/pbxproj().swift
Outdated
@@ -431,7 +431,7 @@ func xcodeProject( | |||
targetSettings.common.SWIFT_FORCE_STATIC_LINK_STDLIB = "NO" | |||
targetSettings.common.SWIFT_FORCE_DYNAMIC_LINK_STDLIB = "YES" | |||
|
|||
targetSettings.common.LD_RUNPATH_SEARCH_PATHS += ["@executable_path"] | |||
targetSettings.common.LD_RUNPATH_SEARCH_PATHS += ["@executable_path", "$(inherited)"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not required I think. It will add the $(inherited)
again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, didn't see the "+" there
Sources/Xcodeproj/pbxproj().swift
Outdated
} else { | ||
// We currently force a search path to the toolchain, since we can't | ||
// establish an expected location for the Swift standard libraries. | ||
// | ||
// Note that this means that the built binaries are not suitable for | ||
// distribution, among other things. | ||
targetSettings.common.LD_RUNPATH_SEARCH_PATHS = ["$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"] | ||
targetSettings.common.LD_RUNPATH_SEARCH_PATHS = ["$(TOOLCHAIN_DIR)/usr/lib/swift/macosx", "$(inherited)"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it more common for $(inherited)
to be the first element? If not, this looks fine.
/cc @abertelrud
381d171
to
644adf5
Compare
@aciidb0mb3r thanks for the review, I've addressed the two comments |
@swift-ci please smoke test |
Thanks @segiddins! |
I ran into this while trying to allow a project to link against
libclang.dylib
.In my
--xcconfig-overrides
, I includedLD_RUNPATH_SEARCH_PATHS = ... $(inherited)
, but those search paths were being completely overwritten by the target's settings.