Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 'linkerArgs' config option #1103

Merged
merged 2 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/main/java/com/gluonhq/substrate/ProjectConfiguration.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2021, Gluon
* Copyright (c) 2019, 2022, Gluon
*
* 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
Expand Down Expand Up @@ -58,6 +58,7 @@ public class ProjectConfiguration {
private List<String> reflectionList = Collections.emptyList();
private List<String> jniList = Collections.emptyList();
private List<String> compilerArgs = Collections.emptyList();
private List<String> linkerArgs = Collections.emptyList();
private List<String> runtimeArgs = Collections.emptyList();

private String appId;
Expand Down Expand Up @@ -236,6 +237,19 @@ public void setCompilerArgs(List<String> compilerArgs) {
this.compilerArgs = compilerArgs;
}

public List<String> getLinkerArgs() {
return linkerArgs;
}

/**
* Sets an additional list of linker arguments that will be added to the linker command "as is",
* without any form of validation on these arguments.
* @param linkerArgs a list of additional linker arguments.
*/
public void setLinkerArgs(List<String> linkerArgs) {
this.linkerArgs = linkerArgs;
}

/**
* Sets additional lists
* @param runtimeArgs a list of optional runtime arguments
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2021, Gluon
* Copyright (c) 2019, 2022, Gluon
*
* 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
Expand Down Expand Up @@ -380,6 +380,11 @@ public List<String> getCompilerArgs() {
.orElse(Collections.emptyList());
}

public List<String> getLinkerArgs() {
return Optional.ofNullable(publicConfig.getLinkerArgs())
.orElse(Collections.emptyList());
}

public List<String> getInitBuildTimeList() {
return initBuildTimeList;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2021, Gluon
* Copyright (c) 2019, 2022, Gluon
*
* 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
Expand Down Expand Up @@ -223,6 +223,7 @@ public boolean link() throws IOException, InterruptedException {

linkRunner.addArgs(getLinkerLibraryPathFlags());
linkRunner.addArgs(getNativeLibsLinkFlags());
linkRunner.addArgs(projectConfiguration.getLinkerArgs());
linkRunner.setInfo(true);
linkRunner.setLogToFile(true);
int result = linkRunner.runProcess("link");
Expand Down