Skip to content

Commit

Permalink
hooked linker.prefix option to aol.properties; also now skip adding p…
Browse files Browse the repository at this point in the history
…refix when link type is static and not using msvc
  • Loading branch information
bchiodo committed Apr 23, 2020
1 parent 4b92031 commit 9716e99
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/main/java/com/github/maven_nar/Linker.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -282,7 +283,20 @@ public final LinkerDef getLinker(final AbstractCompileMojo mojo, final CCTask ta
linker.setSkipDepLink(this.skipDepLink);

// incremental, map
linker.setLinkerPrefix(this.prefix);
String linkerPrefix;
if (this.prefix == null || this.prefix.equals("")) {
String key = mojo.getAOL().getKey() + ".linker.prefix";
linkerPrefix = NarProperties.getInstance(mojo.getMavenProject()).getProperty(key);
}
else {
linkerPrefix = this.prefix;
}

// don't add prefix to ar-like commands FIXME should be done in cpptasks
if (type.equals(Library.STATIC) && !getName(null, null).equals("msvc")) {
linkerPrefix = null;
}
linker.setLinkerPrefix(linkerPrefix);
linker.setIncremental(this.incremental);
linker.setMap(this.map);

Expand Down

0 comments on commit 9716e99

Please sign in to comment.