1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-29 20:05:35 +02:00

Added libraries as input resources for the commands used by the internal builder. Without this, the libraries were being missed.

This commit is contained in:
Doug Schaefer 2007-02-05 04:24:54 +00:00
parent 55dcea05dd
commit 6279316f60

View file

@ -11,6 +11,7 @@
package org.eclipse.cdt.managedbuilder.internal.buildmodel;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@ -287,12 +288,44 @@ public class BuildStep implements IBuildStep {
fTool.getOutputFlag(),
fTool.getOutputPrefix(),
listToString(resourcesToStrings(cwd, getPrimaryResources(false)), " "), //$NON-NLS-1$
resourcesToStrings(cwd, getPrimaryResources(true)),
getInputResources(cwd, getPrimaryResources(true)),
fTool.getCommandLinePattern());
return createCommandsFromString(resolveMacros(info.getCommandLine(), data, true), cwd, getEnvironment());
}
private String[] getInputResources(IPath cwd, BuildResource[] rcs) {
String[] resources = resourcesToStrings(cwd, rcs);
// also need to get libraries
String[] libs = null;
IOption[] opts = fTool.getOptions();
for (int i = 0; i < opts.length; ++i) {
try {
IOption opt = opts[i];
if (opt.getValueType() == IOption.LIBRARIES) {
String[] l = opts[i].getLibraries();
if (l != null) {
libs = new String[l.length];
for (int j = 0; j < l.length; ++j) {
libs[j] = opt.getCommand() + l[j];
}
}
}
} catch (BuildException e) {
}
}
if (libs != null) {
String[] irs = new String[resources.length + libs.length];
System.arraycopy(resources, 0, irs, 0, resources.length);
System.arraycopy(libs, 0, irs, resources.length, libs.length);
return irs;
} else {
return resources;
}
}
private IPath calcCWD(){
IPath cwd = fBuildDescription.getDefaultBuildDirLocation();