From bcbd29880801ffde9989c7d0c4938ee7a0dee5b4 Mon Sep 17 00:00:00 2001 From: Ben Liblit Date: Mon, 26 Feb 2018 21:55:27 -0600 Subject: [PATCH] Extra help for finding "cast" native library on macOS Unlike Linux, macOS has no "RPATH" facility for embedding additional search paths within shared libraries. Instead, we need to set "DYLD_LIBRARY_PATH" appropriately in the environment. This environment variable is the macOS analogue of "LD_LIBRARY_PATH" on Linux. Note that adding the required path to the "java.library.path" system property will *not* work. This property only affects where the JVM looks for shared objects that it is loading directly. This property does not influence the search for other, transitively-required shared objects. Fixes #3. --- com.ibm.wala.cast.test/build.gradle | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/com.ibm.wala.cast.test/build.gradle b/com.ibm.wala.cast.test/build.gradle index c2e3707eb..9e0af4268 100644 --- a/com.ibm.wala.cast.test/build.gradle +++ b/com.ibm.wala.cast.test/build.gradle @@ -97,9 +97,9 @@ model { def lib = linkXlator_testSharedLibrary dependsOn lib systemProperty 'java.library.path', lib.destinationDir + + // TODO: compute path on following line from 'cast' library properties somehow + def castLibDir = "${project(':com.ibm.wala.cast').buildDir}/libs/cast/shared" + environment 'DYLD_LIBRARY_PATH', castLibDir } } - -// https://github.com/liblit/WALA/issues/3 -if (System.getProperty('os.name') == 'Mac OS X') - test.exclude '**/TestNativeTranslator.class'