mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[build] Fix MacOS binary rpath generation (#4376)
For RPATH on MacOS use '@loader_path' instead of '$ORIGIN' to reference the directory where the executable is located. The latter is the mechanism used on Linux. I think this was exposed due to newer OS X ignoring $DYLD_LIBRARY_PATH for security reasons.
This commit is contained in:
@@ -37,9 +37,11 @@ nativeUtils.platformConfigs.each {
|
||||
if (it.name.contains('windows')) {
|
||||
return
|
||||
}
|
||||
it.linker.args << '-Wl,-rpath,\'$ORIGIN\''
|
||||
if (it.name.contains('osx')) {
|
||||
it.linker.args << '-Wl,-rpath,\'@loader_path\''
|
||||
it.linker.args << "-headerpad_max_install_names"
|
||||
} else {
|
||||
it.linker.args << '-Wl,-rpath,\'$ORIGIN\''
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user