| commit | 0e71ea71ed0b411a98039dfd888c4e8ffd45d5b7 | [log] [tgz] |
|---|---|---|
| author | Nicolas Capens <capn@google.com> | Thu Jun 22 00:31:47 2017 -0400 |
| committer | Nicolas Capens <capn@google.com> | Thu Jun 22 04:41:00 2017 +0000 |
| tree | 91c5cae2ae0d612061d08940abbf19c0d7972860 | |
| parent | 3e88aaf80b2965954638be88c29175aa34fc657a [diff] |
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/10228 Reviewed-by: Nicolas Capens <capn@google.com> Tested-by: Nicolas Capens <capn@google.com>
diff --git a/tests/unittests/BUILD.gn b/tests/unittests/BUILD.gn index 135ca8c..d5a106e 100644 --- a/tests/unittests/BUILD.gn +++ b/tests/unittests/BUILD.gn
@@ -42,8 +42,10 @@ "/DELAYLOAD:libGLESv2.dll", ] } else if (is_mac) { - # On Mac OS the rpath is part of the dylib and a full file path instead of - # a directory, which is added to the executable at link time. + ldflags = [ + "-rpath", + "@executable_path/swiftshader/", + ] } else { ldflags = [ "-Wl,-rpath=\$ORIGIN/swiftshader" ] }