Skip to content

Commit 9716e99

Browse files
committed
hooked linker.prefix option to aol.properties; also now skip adding prefix when link type is static and not using msvc
1 parent 4b92031 commit 9716e99

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/main/java/com/github/maven_nar/Linker.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.util.HashSet;
2525
import java.util.LinkedList;
2626
import java.util.List;
27+
import java.util.Properties;
2728
import java.util.Set;
2829
import java.util.Arrays;
2930
import java.util.Collections;
@@ -282,7 +283,20 @@ public final LinkerDef getLinker(final AbstractCompileMojo mojo, final CCTask ta
282283
linker.setSkipDepLink(this.skipDepLink);
283284

284285
// incremental, map
285-
linker.setLinkerPrefix(this.prefix);
286+
String linkerPrefix;
287+
if (this.prefix == null || this.prefix.equals("")) {
288+
String key = mojo.getAOL().getKey() + ".linker.prefix";
289+
linkerPrefix = NarProperties.getInstance(mojo.getMavenProject()).getProperty(key);
290+
}
291+
else {
292+
linkerPrefix = this.prefix;
293+
}
294+
295+
// don't add prefix to ar-like commands FIXME should be done in cpptasks
296+
if (type.equals(Library.STATIC) && !getName(null, null).equals("msvc")) {
297+
linkerPrefix = null;
298+
}
299+
linker.setLinkerPrefix(linkerPrefix);
286300
linker.setIncremental(this.incremental);
287301
linker.setMap(this.map);
288302

0 commit comments

Comments
 (0)