Skip to content

Commit

Permalink
add 'linkerArgs' config option (#1103)
Browse files Browse the repository at this point in the history
* add 'linkerArgs' config option

* update copyright year
  • Loading branch information
kristofdho authored Feb 3, 2022
1 parent e6638d4 commit a42b3d2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
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

0 comments on commit a42b3d2

Please sign in to comment.