Skip to content
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

Merged

Conversation

segiddins
Copy link
Contributor

I ran into this while trying to allow a project to link against libclang.dylib.
In my --xcconfig-overrides, I included LD_RUNPATH_SEARCH_PATHS = ... $(inherited), but those search paths were being completely overwritten by the target's settings.

Copy link
Member

@ankitspd ankitspd left a 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.

@@ -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)"]
Copy link
Member

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.

Copy link
Contributor Author

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

} 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)"]
Copy link
Member

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

@segiddins segiddins force-pushed the seg-inherit-LD_RUNPATH_SEARCH_PATHS branch from 381d171 to 644adf5 Compare September 19, 2017 18:31
@segiddins
Copy link
Contributor Author

@aciidb0mb3r thanks for the review, I've addressed the two comments

@ankitspd
Copy link
Member

@swift-ci please smoke test

@ankitspd
Copy link
Member

Thanks @segiddins!

@ankitspd ankitspd merged commit ef9899e into apple:master Sep 20, 2017
@segiddins segiddins deleted the seg-inherit-LD_RUNPATH_SEARCH_PATHS branch September 26, 2017 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants