diff --git a/src/main/java/com/gluonhq/substrate/ProjectConfiguration.java b/src/main/java/com/gluonhq/substrate/ProjectConfiguration.java index 36a7fae9..990eb05e 100644 --- a/src/main/java/com/gluonhq/substrate/ProjectConfiguration.java +++ b/src/main/java/com/gluonhq/substrate/ProjectConfiguration.java @@ -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 @@ -58,6 +58,7 @@ public class ProjectConfiguration { private List reflectionList = Collections.emptyList(); private List jniList = Collections.emptyList(); private List compilerArgs = Collections.emptyList(); + private List linkerArgs = Collections.emptyList(); private List runtimeArgs = Collections.emptyList(); private String appId; @@ -236,6 +237,19 @@ public void setCompilerArgs(List compilerArgs) { this.compilerArgs = compilerArgs; } + public List 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 linkerArgs) { + this.linkerArgs = linkerArgs; + } + /** * Sets additional lists * @param runtimeArgs a list of optional runtime arguments diff --git a/src/main/java/com/gluonhq/substrate/model/InternalProjectConfiguration.java b/src/main/java/com/gluonhq/substrate/model/InternalProjectConfiguration.java index de8a554f..55fd6c4a 100644 --- a/src/main/java/com/gluonhq/substrate/model/InternalProjectConfiguration.java +++ b/src/main/java/com/gluonhq/substrate/model/InternalProjectConfiguration.java @@ -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 @@ -380,6 +380,11 @@ public List getCompilerArgs() { .orElse(Collections.emptyList()); } + public List getLinkerArgs() { + return Optional.ofNullable(publicConfig.getLinkerArgs()) + .orElse(Collections.emptyList()); + } + public List getInitBuildTimeList() { return initBuildTimeList; } diff --git a/src/main/java/com/gluonhq/substrate/target/AbstractTargetConfiguration.java b/src/main/java/com/gluonhq/substrate/target/AbstractTargetConfiguration.java index 8d964ce0..3ff4d718 100644 --- a/src/main/java/com/gluonhq/substrate/target/AbstractTargetConfiguration.java +++ b/src/main/java/com/gluonhq/substrate/target/AbstractTargetConfiguration.java @@ -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 @@ -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");