11.08., 9:00 - 11:00: Due to updates GitLab will be unavailable for some minutes between 09:00 and 11:00.

Commit dad8338a authored by Salomon Sickert's avatar Salomon Sickert Committed by Salomon Sickert-Zehnter

Generate C library using GraalVM/native-image and remove hand-written JNI wrapper code.

parent bff176c7
......@@ -7,14 +7,12 @@ stages:
- build
- check
- test
- deploy
variables:
GRADLE: ./.gradle
GRADLE_HOME: $GRADLE
GRADLE_USER_HOME: $GRADLE
# Building
Build:
......@@ -24,11 +22,13 @@ Build:
paths:
- $GRADLE
script:
- java -version
- ./gradlew minimizedDistZip
- apt-get update && apt-get install -y --no-install-recommends build-essential zlib1g-dev # TODO: Remove this after Docker update
- ./gradlew distZip
artifacts:
paths:
- build/distributions/
- build/clibrary/reports
- build/distributions
- build/reports
when: on_success
expire_in: 1 week
......@@ -55,24 +55,6 @@ Check:
dependencies:
- Build
# Artifact
Assemble:
stage:
deploy
cache:
paths:
- $GRADLE
script:
- ./gradlew distZip javadoc
dependencies:
- Build
artifacts:
paths:
- build/distributions/
expire_in: 1 week
# Templates
.ltlcross: &ltlcross_template
......
......@@ -31,6 +31,9 @@ Modules:
API:
* Replace the hand-written C++ API by an automatically generated C API that
embeds Owl into a C application as a native library.
* Removed unused and unmaintained `FrequencyG` class and forbid subclassing
of `GOperator`.
......
......@@ -49,8 +49,7 @@ Before implementing your own methods, double check that none of owl's utility li
## Immutable tuples
For classes which are nothing more than immutable structs, i.e. data containers / tuples, [Immutables](http://immutables.github.io/) should be used.
See `@Tuple` / `@HashedTuple` and their usages for examples.
For classes that are simple structured carriers, i.e. data containers or tuples, [AutoValue](https://github.com/google/auto/tree/master/value) should be used.
Hiding the implementation class (by, e.g., giving it package visibility) is recommended, since Java may support value types natively in the near future.
Finally, for performance critical code, double-check that the generated code is doing what you expect from it (e.g., no superfluous copies are performed).
......@@ -99,4 +98,4 @@ Then, add
<trust file=".*-sources[.]jar" regex="true"/>
</trusted-artifacts>
```
to the `<configuration>` section, otherwise IntelliJ complains.
\ No newline at end of file
to the `<configuration>` section, otherwise IntelliJ complains.
# Owl
A Java tool collection and library for **O**mega-**w**ords, ω-automata and **L**inear Temporal Logic (LTL). Batteries included.
A tool collection and library for <b>O</b>mega-<b>w</b>ords, ω-automata and <b>L</b>inear Temporal Logic (LTL). Batteries included.
Major functionality (e.g., translations, simplifiers) is available through command-line tools and for fine-grained access there exists a Java and C++ API. Details on how to use Owl are given in the [usage instructions](doc/USAGE.md) and [build instructions](doc/BUILDING.md). Owl requires at least [JDK 12](http://jdk.java.net/12/).
Note that the distribution only contains compiled code and the necessary sources to build Owl can be found in the [repository](https://gitlab.lrz.de/i7/owl).
If you want to contribute to Owl, read the [contribution guidelines](CONTRIBUTING.md) which are mandatory if you want your changes to be merged into the main branch.
Functionality (e.g., translations, simplifiers) is available through command-line tools and a Java and C-API. Details on how to use Owl are given in the [usage instructions](doc/USAGE.md). If you want to contribute to Owl, read the [contribution guidelines](CONTRIBUTING.md) which are mandatory if you want your changes to be merged into the main branch.
Read the javadoc of the respective packages of the infrastructure you plan to use, e.g., `owl.automaton`. It contains links to the relevant classes and typical use cases.
For further information see the official [website](https://owl.model.in.tum.de/).
## Publications
## Prerequisites
Building the project from the repository requires [GraalVM 20.1: JDK 11](https://www.graalvm.org/), a C build environment with the `glibc` and `zlib` header files installed, and [pandoc](https://pandoc.org/). On Ubuntu the required dependencies can be installed via the following commands:
```
$ apt-get -q install -y --no-install-recommends build-essential zlib1g-dev pandoc gcc
$ wget -q https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.1.0/graalvm-ce-java11-linux-amd64-20.1.0.tar.gz \
&& echo '18f2dc19652c66ccd5bd54198e282db645ea894d67357bf5e4121a9392fc9394 graalvm-ce-java11-linux-amd64-20.1.0.tar.gz' | sha256sum --check \
&& tar -zxvf graalvm-ce-java11-linux-amd64-20.1.0.tar.gz \
&& rm graalvm-ce-java11-linux-amd64-20.1.0.tar.gz \
&& mv graalvm-ce-java11-20.1.0 /opt/
$ gu install native-image
```
Do not forget to add the installed tools to the search path:
```
PATH=/opt/graalvm-ce-java11-20.1.0/bin/:$PATH
JAVA_HOME=/opt/graalvm-ce-java11-20.1.0/
```
## Building
The standard distribution can be obtained with:
```
$ ./gradlew distZip
```
The resulting `.zip` is located in `build/distributions`. It includes the scripts for the CLI tools, Jars usable as a Java library, and a C library. If only the Java components are required, you can exclude native code by executing:
```
$ ./gradlew distZip -Pdisable-native
```
## Citing
Please see the [citing section of the official website for an updated list](https://owl.model.in.tum.de/#citing).
/*
* Copyright (C) 2016 - 2019 (See AUTHORS)
* Copyright (C) 2016 - 2020 (See AUTHORS)
*
* This file is part of Owl.
*
......@@ -20,26 +20,22 @@
plugins {
// https://github.com/tbroyer/gradle-errorprone-plugin
// https://plugins.gradle.org/plugin/net.ltgt.errorprone
// TODO: Reenable
// id 'net.ltgt.errorprone' version '0.8.1'
// https://github.com/johnrengelman/shadow
// https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow
id 'com.github.johnrengelman.shadow' version '5.2.0'
}
// Languages
apply plugin: 'antlr'
apply plugin: 'c'
apply plugin: 'cpp'
apply plugin: 'java'
// Static Analysis
apply plugin: 'pmd'
apply plugin: 'checkstyle'
apply plugin: 'pmd'
// IDE Support
apply plugin: 'idea'
apply plugin: 'application'
apply plugin: 'idea'
project.group = 'de.tum.in'
project.version = '20.XX-development'
......@@ -62,11 +58,11 @@ tasks.withType(Javadoc) {
options.encoding = defaultEncoding
}
def buildNatives = !project.hasProperty("disable-native")
def disablePandoc = project.hasProperty("disable-pandoc")
def disableNative = project.hasProperty("disable-native")
apply from: 'gradle/analysis.gradle'
apply from: 'gradle/antlr.gradle'
apply from: 'gradle/natives.gradle'
repositories {
mavenCentral()
......@@ -76,21 +72,31 @@ repositories {
dependencies {
// https://github.com/google/guava
implementation 'com.google.guava:guava:29.0-jre'
// https://commons.apache.org/proper/commons-cli/
implementation 'commons-cli:commons-cli:1.4'
// https://github.com/incaseoftrouble/jbdd
implementation 'de.tum.in:jbdd:0.5.2'
// https://github.com/incaseoftrouble/naturals-util
implementation 'de.tum.in:naturals-util:0.15.0'
// https://github.com/vigna/fastutil
// https://mvnrepository.com/artifact/it.unimi.dsi/fastutil
implementation 'it.unimi.dsi:fastutil:8.3.1'
// http://www.antlr.org/
// https://mvnrepository.com/artifact/org.antlr/antlr4-runtime
implementation 'org.antlr:antlr4-runtime:4.8-1'
// https://automata.tools/hoa/jhoafparser/
implementation files('lib/jhoafparser-1.1.1-patched.jar')
// https://www.graalvm.org/
// https://mvnrepository.com/artifact/org.graalvm.sdk/graal-sdk
implementation 'org.graalvm.sdk:graal-sdk:20.1.0'
implementation group: 'com.zaxxer', name: 'SparseBitSet', version: '1.2'
// https://github.com/google/gson
......@@ -101,8 +107,10 @@ dependencies {
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.2'
antlr 'org.antlr:antlr4:4.8-1' // Introduces unused runtime dependencies; fixed in antlr.gradle
// https://mvnrepository.com/artifact/com.google.errorprone/error_prone_core
// errorprone 'com.google.errorprone:error_prone_core:2.3.3'
// TODO: Reenable
// errorprone 'com.google.errorprone:error_prone_core:2.3.4'
// https://mvnrepository.com/artifact/com.google.auto.value/auto-value
......@@ -138,6 +146,23 @@ tasks.withType(Test) {
maxHeapSize = "16G"
}
model {
components {
owlClient(NativeExecutableSpec) {
baseName "owl-client"
sources {
c {
source {
srcDir "src/main/c"
include "owl-client.c"
}
}
}
}
}
}
// ---------------- Startup Scripts ----------------
// Create startup scripts for each tool
......@@ -161,12 +186,10 @@ def scripts = [
'delag' : 'owl.translations.delag.DelagBuilder',
// LTL -> **A
// TODO: Deprecate and replace by delag!
'ltl2da' : 'owl.translations.modules.LTL2DAModule',
'ltl2na' : 'owl.translations.modules.LTL2NAModule',
// Miscellaneous
'synth' : 'owl.translations.Synthesis',
'nba2dpa' : 'owl.translations.nba2dpa.NBA2DPA',
'nba2ldba' : 'owl.translations.nba2ldba.NBA2LDBA',
'dra2dpa' : 'owl.translations.dra2dpa.IARBuilder',
......@@ -215,10 +238,6 @@ jar {
}
}
shadowJar {
minimize()
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
......@@ -231,6 +250,27 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
task mavenJars(dependsOn: [jar, sourcesJar, javadocJar])
task buildCLibrary(type: Exec, dependsOn: [classes]) {
mkdir "${buildDir}/clibrary"
workingDir "${buildDir}/clibrary"
def graalHome = System.getenv("GRAAL_HOME")
def command = (graalHome != null ? graalHome + "/bin/" : "") + "native-image"
commandLine command,
"owl.cinterface.CInterface", "libowl",
"-cp", sourceSets.main.runtimeClasspath.asPath,
"-DowlHeader=${projectDir}/src/main/headers",
'--shared',
'--initialize-at-build-time=owl,it,com,org,jhoafparser',
'--no-fallback',
'--no-server',
'-H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime',
'-H:+PrintAnalysisCallTree',
'-H:+ReportExceptionStackTraces',
'-H:-UseServiceLoaderFeature'
}
// ---------------- Script Jobs ----------------
def allStartScripts = createStartScriptTasks("", jar.outputs.files + project.getConfigurations().getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME), scripts)
......@@ -238,14 +278,9 @@ allStartScripts.each() {
it.dependsOn(jar)
}
def shadedJarStartScripts = createStartScriptTasks("ShadedJar", shadowJar.outputs.files, scripts + ['owl': mainClassName])
shadedJarStartScripts.each() {
it.dependsOn(shadowJar)
}
def rabinizerStartScripts = createStartScriptTasks("Rabinizer", shadowJar.outputs.files, rabinizerScripts)
def rabinizerStartScripts = createStartScriptTasks("Rabinizer", jar.outputs.files + project.getConfigurations().getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME), rabinizerScripts)
rabinizerStartScripts.each() {
it.dependsOn(shadowJar)
it.dependsOn(jar)
}
// ---------------- Documentation ----------------
......@@ -258,7 +293,7 @@ if (Os.isFamily(Os.FAMILY_WINDOWS)) {
logger.warn("Cannot compile markdown on windows, skipping")
}
}.onlyIf {
buildNatives
!disablePandoc
}
} else {
tasks.create(name: "compileMarkdown", type: Exec) {
......@@ -266,7 +301,7 @@ if (Os.isFamily(Os.FAMILY_WINDOWS)) {
outputs.dir "$project.docsDir/markdown"
args = ["$project.docsDir/markdown"]
}.onlyIf {
buildNatives
!disablePandoc
}
}
......@@ -297,44 +332,31 @@ distributions {
into("bin") {
from allStartScripts
if (buildNatives) {
from 'build/exe/owlClient/owl-client'
if (!disableNative) {
from "${buildDir}/exe/owlClient/owl-client"
}
fileMode = 0755
}
into("javadoc") {
from javadoc
if (!disableNative) {
into("clib") {
from "$projectDir/src/main/headers"
from "$buildDir/clibrary" include "*.h"
from "$buildDir/clibrary" include "*.so"
}
}
}
}
minimized {
distributionBaseName = 'owl-minimized'
contents {
from "AUTHORS"
from "LICENSE"
into("bin") {
from shadedJarStartScripts
if (buildNatives) {
from 'build/exe/owlClient/owl-client'
}
fileMode = 0755
}
into("lib") {
from shadowJar
into("jars") {
from jar
from javadocJar
from sourcesJar
}
}
}
rabinizer {
baseName = 'rabinizer'
distributionBaseName = 'rabinizer'
contents {
from "AUTHORS"
......@@ -344,19 +366,15 @@ distributions {
from rabinizerStartScripts
fileMode = 0755
}
into("lib") {
from shadowJar
}
}
}
}
if (buildNatives) {
if (!disableNative) {
tasks.getByPath(":distZip").dependsOn(tasks.getByPath(":owlClientExecutable"))
tasks.getByPath(":distTar").dependsOn(tasks.getByPath(":owlClientExecutable"))
tasks.getByPath(":minimizedDistZip").dependsOn(tasks.getByPath(":owlClientExecutable"))
tasks.getByPath(":minimizedDistTar").dependsOn(tasks.getByPath(":owlClientExecutable"))
tasks.getByPath(":distZip").dependsOn(tasks.getByPath(":buildCLibrary"))
tasks.getByPath(":distTar").dependsOn(tasks.getByPath(":buildCLibrary"))
}
apply from: 'gradle/idea.gradle'
......@@ -9,7 +9,7 @@
<suppress files="owl[\\/]grammar[\\/]" checks=".*"/>
<!-- Suppress broken file -->
<suppress files="owl[\\/]cinterface[\\/]DeterministicAutomaton" checks=".*"/>
<suppress files="owl[\\/]cinterface[\\/]CAutomaton" checks=".*"/>
<suppress files="owl[\\/]automaton[\\/]acceptance[\\/]BooleanExpressions" checks=".*"/>
<suppress files="FG.*|.+2.+|.*DPA.*" checks="AbbreviationAsWordInName"/>
......
# Building
## Prerequisites
Building the project from source requires an installed [JDK 12](http://jdk.java.net/12/) and an installed C++17 compiler. Furthermore to generate HTML documentation [pandoc](https://pandoc.org/) is needed.
Owl is built with [Gradle](http://gradle.org/), which is automatically bootstrapped. You can view the available tasks with:
```
$ ./gradlew tasks
```
## Standard Distribution
The standard distribution can be obtained with:
```
$ ./gradlew distZip
```
The resulting `.zip` is located in `build/distributions`. In order to run all tests and checks please use:
```
$ ./gradlew check
```
Lastly you can install the distribution to the default location using:
```
$ ./gradlew installDist
```
## Minimized Distribution
In order to save space and reduce load time of the application a minimized `jar` can be produced with:
```
$ ./gradlew minimizedDistZip
```
The minimization removes unused `class`-files from the jar and produces a single jar.
## Documentation
The corresponding javadoc can be obtained with:
```
$ ./gradlew javadoc
```
......@@ -13,7 +13,7 @@ ENV LANG C.UTF-8
RUN apt-get -q update \
&& apt-get -q upgrade -y \
&& apt-get -q install -y --no-install-recommends ca-certificates pandoc python3 python3-tabulate graphviz time gcc g++ make netcat unzip wget \
&& apt-get -q install -y --no-install-recommends build-essential zlib1g-dev ca-certificates pandoc python3 python3-tabulate graphviz time gcc g++ make netcat unzip wget \
&& rm -rf /var/lib/apt/lists/*
# GraalVM
......
/*
* Copyright (C) 2016 - 2019 (See AUTHORS)
*
* This file is part of Owl.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// C and C++
model {
repositories {
libs(PrebuiltLibraries) {
jdk {
headers.srcDirs "${System.properties['java.home']}/include",
"${System.properties['java.home']}/include/win32",
"${System.properties['java.home']}/include/darwin",
"${System.properties['java.home']}/include/linux"
}
internal {
headers.srcDirs "src/main/headers",
"src/main/cpp/library"
}
}
}
components {
owl(NativeLibrarySpec) {
sources {
cpp {
source {
srcDirs "src/main/cpp/library"
include "**.cc"
}
exportedHeaders {
srcDir "src/main/headers"
}
}
}
binaries.all {
cppCompiler.args "-O2", "-std=c++1z", "-W", "-Wall"
linker.args "-L${System.properties['java.home']}/lib/server/", "-ljvm"
lib library: 'internal', linkage: 'api'
lib library: 'jdk', linkage: 'api'
}
}
owlClient(NativeExecutableSpec) {
baseName "owl-client"
sources {
c {
source {
srcDir "src/main/c"
include "owl-client.c"
}
}
}
}
owlExample(NativeExecutableSpec) {
baseName "owl-cinterface-example"
sources {
cpp {
source {
srcDir "src/main/cpp/example"
include "example.cc"
}
}
}
binaries.all {
cppCompiler.args "-O2", "-std=c++1z", "-W", "-Wall"
linker.args "-L${System.properties['java.home']}/lib/server/", "-ljvm"
lib library: 'jdk', linkage: 'api'
lib library: 'owl', linkage: 'static'
}
}
}
}
\ No newline at end of file
......@@ -288,6 +288,11 @@
<sha256 value="b7d0a6968c4de06ef304534dd5742d769aa57415aff890e1990f105a3cc19ee1" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="net.sourceforge.pmd" name="pmd" version="6.22.0">
<artifact name="pmd-6.22.0.pom">
<sha256 value="60210f17321bd4c7a8d096238de7583d4d31c6f37284e89d5e1475d1d167841c" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="net.sourceforge.pmd" name="pmd-core" version="6.15.0">
<artifact name="pmd-core-6.15.0.jar">
<sha256 value="776c6315798e58cc362abba33b69fc074f7a25673706ddc6355cdbd54dc1f572" origin="Generated by Gradle"/>
......@@ -296,6 +301,14 @@
<sha256 value="06df5d01fecfb2374fc95cc81e2bf0f73580b12f5e384e64a92a76bb5aab45f6" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="net.sourceforge.pmd" name="pmd-core" version="6.22.0">
<artifact name="pmd-core-6.22.0.jar">
<sha256 value="cc41ea801138e0285dbb84931a5bef288363445159070e101d749eb530bdfcaa" origin="Generated by Gradle"/>
</artifact>
<artifact name="pmd-core-6.22.0.pom">
<sha256 value="35c60e84fbab23d37bdc4f472ec5875ba7b8e14fd43d6b20125475d2e7b4f009" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="net.sourceforge.pmd" name="pmd-java" version="6.15.0">
<artifact name="pmd-java-6.15.0.jar">
<sha256 value="3a7d4f8c6054c46cc0954dc34fa28d627d827906f1a183fa98fcdaeb26a574fa" origin="Generated by Gradle"/>
......@@ -304,6 +317,14 @@
<sha256 value="2b88416d88726c44c27ad8214d20022eb5161b031a56a1419bf29928802c307f" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="net.sourceforge.pmd" name="pmd-java" version="6.22.0">
<artifact name="pmd-java-6.22.0.jar">
<sha256 value="030288c430991998620bd443a3ba287f82036899ef8071ef394dab9f21652aaf" origin="Generated by Gradle"/>
</artifact>
<artifact name="pmd-java-6.22.0.pom">
<sha256 value="264369a0e78657ce8825dd1d33767fb46fd023b9d279f290a49d71a3370e393c" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="net.sourceforge.saxon" name="saxon" version="9.1.0.8">
<artifact name="saxon-9.1.0.8-dom.jar">
<sha256 value="c6cf3ecc7f4b65ab8b613d00fd9e9c0648a5aa03264a941ba0fd2da5339f917a" origin="Generated by Gradle"/>
......@@ -549,6 +570,22 @@
<sha256 value="6d7c68423115f921718d944f859924b4c685217ec03a49f70455a8b2caa972e6" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.graalvm.sdk" name="graal-sdk" version="20.0.0">
<artifact name="graal-sdk-20.0.0.jar">
<sha256 value="01e509f18543b879efc590e56641916bd18311a58a7b5f8d54bd5f40a4fd555e" origin="Generated by Gradle"/>
</artifact>
<artifact name="graal-sdk-20.0.0.pom">
<sha256 value="67a759557822485e228e12710cd04e905ac29472d038d3ed446ea9c4d9991265" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.graalvm.sdk" name="graal-sdk" version="20.1.0">
<artifact name="graal-sdk-20.1.0.jar">
<sha256 value="5322cd829d0485eec2c491dca803ebed5b86c4b658f6427c9424db574afae350" origin="Generated by Gradle"/>
</artifact>
<artifact name="graal-sdk-20.1.0.pom">
<sha256 value="883812f43e808b48006adacf423124dd4f57d4e112d2abcac078634644b4f4db" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.immutables" name="immutables" version="2.7.1">
<artifact name="immutables-2.7.1.pom">
<sha256 value="29de7ef0ec634578f077b03a1657cb4257a7bb4601e4757dbd37d7c4dd3b4173" origin="Generated by Gradle"/>
......@@ -574,9 +611,9 @@
<artifact name="junit-bom-5.6.2.module">
<sha256 value="7f48f82f55efc1f0cc59583c2d474a3410e24179dd2d1d22164515cce33d7643" origin="Generated by Gradle"/>
</artifact>
<artifact name="junit-bom-5.6.2.pom">
<sha256 value="e8ad601b3181b23787a18e71d26ac86a49c56dc5f85606764bc3c51b5e45fe13" origin="Manually generated"/>
</artifact>
<artifact name="junit-bom-5.6.2.pom">
<sha256 value="e8ad601b3181b23787a18e71d26ac86a49c56dc5f85606764bc3c51b5e45fe13" origin="Manually generated"/>
</artifact>
</component>
<component group="org.junit.jupiter" name="junit-jupiter-api" version="5.6.2">
<artifact name="junit-jupiter-api-5.6.2.jar">
......@@ -647,6 +684,14 @@
<sha256 value="0f29742eada6588a46c679f499a6755e4b3939767004f2bd9c02019cfd1d3180" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.ow2.asm" name="asm" version="7.3.1">
<artifact name="asm-7.3.1.jar">
<sha256 value="2f67e11ceec819ebd88ddee5300aba699b1cbab2e20c22e97cf027d3be93959b" origin="Generated by Gradle"/>
</artifact>
<artifact name="asm-7.3.1.pom">
<sha256 value="eacdcd500d6527e963888daeda31923e4bc241a25424dcc38acca2e601e7fde2" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.ow2.asm" name="asm-analysis" version="7.0-beta">
<artifact name="asm-analysis-7.0-beta.jar">
<sha256 value="4d2b20a1fb44acb33b0ddb80be58b2ad7838c1fb520282a655a1217b3c6acf19" origin="Generated by Gradle"/>
......
cmake_minimum_required(VERSION 3.10.3)
project(Owl)
# Setup C++
set(CMAKE_CXX_STANDARD 17)
# Add Library
add_subdirectory(cpp/library)
# Add Executable
add_subdirectory(cpp/example)
cmake_minimum_required(VERSION 3.12)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
# Define Executable
find_package(JNI REQUIRED)
# Check JNI
message("JNI Headers:")
message(${JNI_INCLUDE_DIRS})
message("JNI Libraries:")
message(${JNI_LIBRARIES})
include_directories(${JNI_INCLUDE_DIRS} "../../headers")
add_executable(owl-example example.cc)
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# Link JDK 10 first to work around macOS Java Fuckup.
set(DARWIN_FIX "/Library/Java/JavaVirtualMachines/jdk-10.jdk/Contents/Home/lib/jli/libjli.dylib")
target_link_libraries(owl-example ${DARWIN_FIX} ${JNI_LIBRARIES} owl)