Make binaries' rpath comply conventions on iOS and macOS

This simplifies linking embedded frameworks.
See #2555
This commit is contained in:
Svyatoslav Scherbina
2019-01-18 18:24:13 +03:00
committed by SvyatoslavScherbina
parent 50376a0975
commit cfcfecf19e
@@ -158,9 +158,19 @@ open class MacOSBasedLinker(targetProperties: AppleConfigurables)
if (compilerRtLibrary != null) +compilerRtLibrary!!
+libraries
+linkerArgs
+rpath(dynamic)
}) + if (debug) listOf(dsymUtilCommand(executable, outputDsymBundle)) else emptyList()
}
private fun rpath(dynamic: Boolean): List<String> = listOfNotNull(
when (target.family) {
Family.OSX -> "@executable_path/../Frameworks"
Family.IOS -> "@executable_path/Frameworks"
else -> error(target)
},
"@loader_path/Frameworks".takeIf { dynamic }
).flatMap { listOf("-rpath", it) }
fun dsymUtilCommand(executable: ExecutableFile, outputDsymBundle: String) =
object : Command(dsymutilCommand(executable, outputDsymBundle)) {
override fun runProcess(): Int =