mirror of https://github.com/acidanthera/audk.git
Update cpptaks to support LIBPATH and INCLUDEPATH which will defined in TOOLS_DEF file.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1754 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
aa197375d8
commit
51f9486371
|
@ -220,20 +220,36 @@ public class CommandLineUserDefine {
|
|||
// }
|
||||
// project.log(logLine.toString(), Project.MSG_VERBOSE);
|
||||
|
||||
int retval = 0;
|
||||
Environment newEnv = new Environment();
|
||||
|
||||
if (userdefine.getDpath() == null || userdefine.getDpath().trim().length() == 0) {
|
||||
retval = runCommand(cctask, workdir, cmd, null);
|
||||
} else {
|
||||
String existPath = System.getenv(getPathName());
|
||||
Environment newEnv = new Environment();
|
||||
if (userdefine.getDpath() != null && userdefine.getDpath().trim().length() != 0) {
|
||||
String existPath = System.getenv(getPathName("PATH"));
|
||||
|
||||
Variable var = new Variable();
|
||||
var.setKey(getPathName());
|
||||
var.setKey(getPathName("PATH"));
|
||||
var.setPath(new Path(project, userdefine.getDpath() + ";" + existPath));
|
||||
newEnv.addVariable(var);
|
||||
retval = runCommand(cctask, workdir, cmd, newEnv);
|
||||
}
|
||||
|
||||
if (userdefine.getLibpath() != null && userdefine.getLibpath().trim().length() != 0) {
|
||||
String existPath = System.getenv(getPathName("LIB"));
|
||||
|
||||
Variable var = new Variable();
|
||||
var.setKey(getPathName("LIB"));
|
||||
var.setPath(new Path(project, userdefine.getLibpath() + ";" + existPath));
|
||||
newEnv.addVariable(var);
|
||||
}
|
||||
|
||||
if (userdefine.getInclude() != null && userdefine.getInclude().trim().length() != 0) {
|
||||
String existPath = System.getenv(getPathName("INCLUDE"));
|
||||
|
||||
Variable var = new Variable();
|
||||
var.setKey(getPathName("INCLUDE"));
|
||||
var.setPath(new Path(project, userdefine.getInclude() + ";" + existPath));
|
||||
newEnv.addVariable(var);
|
||||
}
|
||||
|
||||
int retval = runCommand(cctask, workdir, cmd, newEnv);
|
||||
|
||||
if (retval != 0) {
|
||||
throw new BuildException(userdefine.getCmd()
|
||||
|
@ -242,7 +258,7 @@ public class CommandLineUserDefine {
|
|||
}
|
||||
}
|
||||
|
||||
private String getPathName() {
|
||||
private String getPathName(String variableName) {
|
||||
if (pathName != null) {
|
||||
return pathName;
|
||||
}
|
||||
|
@ -250,7 +266,7 @@ public class CommandLineUserDefine {
|
|||
Iterator iter = allEnv.keySet().iterator();
|
||||
while (iter.hasNext()) {
|
||||
String key = (String)iter.next();
|
||||
if(key.equalsIgnoreCase("PATH")) {
|
||||
if(key.equalsIgnoreCase(variableName)) {
|
||||
pathName = key;
|
||||
break ;
|
||||
}
|
||||
|
|
|
@ -63,6 +63,10 @@ public class UserDefineDef extends ProcessorDef {
|
|||
private Vector allLibraries = new Vector();
|
||||
|
||||
private String dpath = null;
|
||||
|
||||
private String libpath = null;
|
||||
|
||||
private String include = null;
|
||||
|
||||
public void addLibset(LibrarySet libset) {
|
||||
if (isReference()) {
|
||||
|
@ -310,4 +314,20 @@ public class UserDefineDef extends ProcessorDef {
|
|||
this.dpath = dpath;
|
||||
}
|
||||
|
||||
public String getLibpath() {
|
||||
return libpath;
|
||||
}
|
||||
|
||||
public void setLibpath(String libpath) {
|
||||
this.libpath = libpath;
|
||||
}
|
||||
|
||||
public String getInclude() {
|
||||
return include;
|
||||
}
|
||||
|
||||
public void setInclude(String include) {
|
||||
this.include = include;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue