Skip to content

Commit d28e443

Browse files
authored
Add --library arguments for jextract (#1)
1 parent c878569 commit d28e443

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ This is a Maven wrapper for the [`jextract`](https://github.com/openjdk/jextract
2121
</goals>
2222
<configuration>
2323
<headerFile>point.h</headerFile>
24+
<libraries>
25+
<library>/path/to/shared/library.so</library>
26+
</libraries>
2427
<targetPackage>com.example.mypackage</targetPackage>
2528
<headerClassName>Point2d</headerClassName>
2629
<includeStructs>

src/main/java/io/github/coffeelibs/maven/jextract/SourcesMojo.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,15 @@ public class SourcesMojo extends AbstractMojo {
127127
@Parameter(property = "jextract.includeVars", required = false)
128128
private String[] includeVars;
129129

130+
/**
131+
* <dl>
132+
* <dt>--library</dt>
133+
* <dd>path to shared libraries to load</dd>
134+
* </dl>
135+
*/
136+
@Parameter(property = "jextract.libraries", required = false)
137+
private String[] libraries;
138+
130139
/**
131140
* <dl>
132141
* <dt>--output</dt>
@@ -161,6 +170,10 @@ public void execute() throws MojoFailureException {
161170
args.add(outputDirectory.getAbsolutePath());
162171
args.add("--target-package");
163172
args.add(targetPackage);
173+
Arrays.stream(libraries).forEach(str -> {
174+
args.add("--library");
175+
args.add(str);
176+
});
164177
Arrays.stream(headerSearchPaths).forEach(str -> {
165178
args.add("-I");
166179
args.add(str);

0 commit comments

Comments
 (0)