Commit 0e71ea71 by Nicolas Capens

Fix non-component unittests on Mac OS.

Component builds automatically set the rpath to include dependent libraries, but with a non-component build these are assumed to be linked statically so the rpath of where to find the libraries to collect install_name info from is missing. Thus we set the rpath explicitly. Related articles and documentation: https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/RunpathDependentLibraries.html http://log.zyxar.com/blog/2012/03/10/install-name-on-os-x https://wincent.com/wiki/@executable_path,_@load_path_and_@rpath Bug swiftshader:68 Change-Id: I0cfe0d26fccf80ff7911846ef013d47daaeb09fd Reviewed-on: https://swiftshader-review.googlesource.com/10228Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent 3e88aaf8
...@@ -42,8 +42,10 @@ test("swiftshader_unittests") { ...@@ -42,8 +42,10 @@ test("swiftshader_unittests") {
"/DELAYLOAD:libGLESv2.dll", "/DELAYLOAD:libGLESv2.dll",
] ]
} else if (is_mac) { } else if (is_mac) {
# On Mac OS the rpath is part of the dylib and a full file path instead of ldflags = [
# a directory, which is added to the executable at link time. "-rpath",
"@executable_path/swiftshader/",
]
} else { } else {
ldflags = [ "-Wl,-rpath=\$ORIGIN/swiftshader" ] ldflags = [ "-Wl,-rpath=\$ORIGIN/swiftshader" ]
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment