Skip to content
This repository was archived by the owner on Apr 21, 2018. It is now read-only.

Change for break caused by NAR-109 fix #12

Closed
wants to merge 1 commit into from
Closed
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
9 changes: 6 additions & 3 deletions src/main/java/com/github/maven_nar/cpptasks/CCTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -1141,12 +1141,15 @@ private Map getTargets(LinkerConfiguration linkerConfig,
// Order according to "order" List followed by alphabetical order
public int compare( Object arg0, Object arg1 ) {
String f0 = (String)arg0;
f0 = f0.lastIndexOf('.') < 0 ? f0 : f0.substring(0, f0.lastIndexOf('.'));
String f1 = (String)arg1;
f1 = f1.lastIndexOf('.') < 0 ? f1 : f1.substring(0, f1.lastIndexOf('.'));

if (order.isEmpty()) return f0.compareTo(f1);

// Not sure why DUNS is trimming the trailing file extension - but this breaks multi compilers like resrouce/midl if same basename as c/cpp
// so moved the comparison to above to avoid trimming the extension if there is no order, which half fixes the issue.

f0 = f0.lastIndexOf('.') < 0 ? f0 : f0.substring(0, f0.lastIndexOf('.'));
f1 = f1.lastIndexOf('.') < 0 ? f1 : f1.substring(0, f1.lastIndexOf('.'));

// make sure we use only one core
ordered = true;

Expand Down