From 01acd0e338eb186ae6906ca59bc4cf17a779c70a Mon Sep 17 00:00:00 2001 From: Ben Liblit Date: Tue, 16 Jan 2018 16:40:59 -0600 Subject: [PATCH] RPath settings apply only to Linux; some only to Linux on x86_64 I don't know whether Windows or MacOS needs anything similar. If they do, the details will differ, and should be handled by adding suitable cases to these switch statements. --- com.ibm.wala.cast.test/build.gradle | 22 ++++++++++++++-------- com.ibm.wala.cast/build.gradle | 7 +++++-- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/com.ibm.wala.cast.test/build.gradle b/com.ibm.wala.cast.test/build.gradle index 439d6d8cc..cf293a2b1 100644 --- a/com.ibm.wala.cast.test/build.gradle +++ b/com.ibm.wala.cast.test/build.gradle @@ -61,10 +61,13 @@ model { buildable = false } all { - // TODO: compute path on following line from 'cast' library properties somehow - linker.args '-Wl,-rpath', "${project(':com.ibm.wala.cast').buildDir}/libs/cast/shared" - // TODO: compute path on following line from 'jdk' library properties somehow - linker.args '-Wl,-rpath', "${currentJvm.javaHome}/jre/lib/amd64/server" + switch ("$targetPlatform.operatingSystem.name/$targetPlatform.architecture.name") { + case 'linux/x86-64': + // TODO: compute path on following line from 'cast' library properties somehow + linker.args '-Wl,-rpath', "${project(':com.ibm.wala.cast').buildDir}/libs/cast/shared" + // TODO: compute path on following line from 'jdk' library properties somehow + linker.args '-Wl,-rpath', "${currentJvm.javaHome}/jre/lib/amd64/server" + } } } } @@ -79,10 +82,13 @@ model { } } binaries.all { - // TODO: compute path on following line from 'cast' library properties somehow - linker.args '-Wl,-rpath', "${project(':com.ibm.wala.cast').buildDir}/libs/cast/shared" - // TODO: compute path on following line from 'jdk' library properties somehow - linker.args '-Wl,-rpath', "${currentJvm.javaHome}/jre/lib/amd64/server" + switch ("$targetPlatform.operatingSystem.name/$targetPlatform.architecture.name") { + case 'linux/x86-64': + // TODO: compute path on following line from 'cast' library properties somehow + linker.args '-Wl,-rpath', "${project(':com.ibm.wala.cast').buildDir}/libs/cast/shared" + // TODO: compute path on following line from 'jdk' library properties somehow + linker.args '-Wl,-rpath', "${currentJvm.javaHome}/jre/lib/amd64/server" + } } } } diff --git a/com.ibm.wala.cast/build.gradle b/com.ibm.wala.cast/build.gradle index aa26fc59f..78355107e 100644 --- a/com.ibm.wala.cast/build.gradle +++ b/com.ibm.wala.cast/build.gradle @@ -70,8 +70,11 @@ model { lib library: 'jdk' } binaries.all { - // TODO: compute path on following line from 'jdk' library properties somehow - linker.args '-Wl,-rpath', "$currentJavaHome/jre/lib/amd64/server" + switch ("$targetPlatform.operatingSystem.name/$targetPlatform.architecture.name") { + case 'linux/x86-64': + // TODO: compute path on following line from 'jdk' library properties somehow + linker.args '-Wl,-rpath', "$currentJavaHome/jre/lib/amd64/server" + } } } }