Skip to content

Commit

Permalink
Added logging for native flags
Browse files Browse the repository at this point in the history
  • Loading branch information
leventeBajczi committed Jul 24, 2023
1 parent a4c9aab commit 808a884
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions subprojects/frontends/llvm/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
* limitations under the License.
*/

import org.codehaus.plexus.util.Os
import org.gradle.internal.os.OperatingSystem.current
import java.io.ByteArrayOutputStream
import java.io.IOException

plugins {
id("cpp-library")
}

val enabled = Os.isFamily(Os.FAMILY_UNIX) &&
val enabled = current().isLinux &&
try {
runCommandForOutput("llvm-config")
true
Expand Down Expand Up @@ -52,7 +52,7 @@ fun llvmConfigFlags(vararg args: String): Array<String> {
} catch (e: IOException) {
e.printStackTrace()
arrayOf()
}
}.also { println("LLVM flags (${args.toList()}): ${it.toList()}") }
}

fun jniConfigFlags(): Array<String> {
Expand All @@ -65,7 +65,7 @@ fun jniConfigFlags(): Array<String> {
return arrayOf(
"-I${mainInclude.absolutePath}",
"-I${linuxInclude.absolutePath}",
)
).also { println("JNI flags: ${it.toList()}") }
}

library {
Expand All @@ -77,7 +77,7 @@ library {
*jniConfigFlags(),
*llvmConfigFlags("--cxxflags")))
onlyIf {
this@Build_gradle.enabled
enabled
}
}

Expand All @@ -87,7 +87,7 @@ library {
*llvmConfigFlags("--cxxflags", "--ldflags", "--libs", "core", "bitreader"),
"-ldl"))
onlyIf {
this@Build_gradle.enabled
enabled
}
}
}
4 changes: 2 additions & 2 deletions subprojects/xcfa/llvm2xcfa/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import org.codehaus.plexus.util.Os
import org.gradle.internal.os.OperatingSystem

plugins {
id("java-common")
Expand All @@ -28,7 +28,7 @@ dependencies {
}

tasks.test {
if (Os.isFamily(Os.FAMILY_UNIX)) {
if (OperatingSystem.current().isLinux) {
val nativeLibTasks = project(":theta-llvm").tasks
dependsOn(nativeLibTasks.build)

Expand Down

0 comments on commit 808a884

Please sign in to comment.