From d28e443e6bb27797261f77fd0ce3689265a47305 Mon Sep 17 00:00:00 2001 From: dluga93 Date: Sat, 1 Jun 2024 12:01:02 +0200 Subject: [PATCH] Add --library arguments for jextract (#1) --- README.md | 3 +++ .../coffeelibs/maven/jextract/SourcesMojo.java | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/README.md b/README.md index 196660e..b73facf 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,9 @@ This is a Maven wrapper for the [`jextract`](https://github.com/openjdk/jextract point.h + + /path/to/shared/library.so + com.example.mypackage Point2d diff --git a/src/main/java/io/github/coffeelibs/maven/jextract/SourcesMojo.java b/src/main/java/io/github/coffeelibs/maven/jextract/SourcesMojo.java index 658fcfe..669ab28 100644 --- a/src/main/java/io/github/coffeelibs/maven/jextract/SourcesMojo.java +++ b/src/main/java/io/github/coffeelibs/maven/jextract/SourcesMojo.java @@ -127,6 +127,15 @@ public class SourcesMojo extends AbstractMojo { @Parameter(property = "jextract.includeVars", required = false) private String[] includeVars; + /** + *
+ *
--library
+ *
path to shared libraries to load
+ *
+ */ + @Parameter(property = "jextract.libraries", required = false) + private String[] libraries; + /** *
*
--output
@@ -161,6 +170,10 @@ public void execute() throws MojoFailureException { args.add(outputDirectory.getAbsolutePath()); args.add("--target-package"); args.add(targetPackage); + Arrays.stream(libraries).forEach(str -> { + args.add("--library"); + args.add(str); + }); Arrays.stream(headerSearchPaths).forEach(str -> { args.add("-I"); args.add(str);