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 #147

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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ gluonfx {
jniList = []

compilerArgs = []
linkerArgs = []
runtimeArgs = []

javaStaticSdkVersion = ""
Expand Down
17 changes: 16 additions & 1 deletion src/main/java/com/gluonhq/gradle/ClientExtension.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
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -86,6 +86,11 @@ public class ClientExtension {
*/
private final List<String> compilerArgs;

/**
* List of optional linker arguments
*/
private final List<String> linkerArgs;

/**
* List of optional runtime arguments
*/
Expand Down Expand Up @@ -148,6 +153,7 @@ public ClientExtension(Project project, ObjectFactory objectFactory) {
this.reflectionList = new ArrayList<>();
this.jniList = new ArrayList<>();
this.compilerArgs = new ArrayList<>();
this.linkerArgs = new ArrayList<>();
this.runtimeArgs = new ArrayList<>();

attachConfiguration = objectFactory.newInstance(AttachConfiguration.class, project);
Expand Down Expand Up @@ -231,6 +237,15 @@ public List<String> getCompilerArgs() {
return compilerArgs;
}

public void setLinkerArgs(List<String> linkerArgs) {
this.linkerArgs.clear();
this.linkerArgs.addAll(linkerArgs);
}

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

public void setRuntimeArgs(List<String> compilerArgs) {
this.runtimeArgs.clear();
this.runtimeArgs.addAll(compilerArgs);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/gluonhq/gradle/tasks/ConfigBuild.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
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -128,6 +128,7 @@ private ProjectConfiguration createSubstrateConfiguration() {
clientConfig.setResourcesList(clientExtension.getResourcesList());
clientConfig.setJniList(clientExtension.getJniList());
clientConfig.setCompilerArgs(clientExtension.getCompilerArgs());
clientConfig.setLinkerArgs(clientExtension.getLinkerArgs());
clientConfig.setRuntimeArgs(clientExtension.getRuntimeArgs());
clientConfig.setReflectionList(clientExtension.getReflectionList());
String appId = clientExtension.getAppIdentifier();
Expand Down