mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-14 03:35:37 +02:00
External commit for Leo Treggiari. The archList attribute of the target object specifies the list of architectures that the target is supported on. The valid list of architectures is the string values returned by BootLoader.getOSArch(). If the archList attribute is not specified, or if the value is "all", then the target is supported on all architectures. Otherwise, the target is only displayed when CDT is running on one of the specified architectures, unless the user has requested to see all targets.
This commit is contained in:
parent
e40dd5c703
commit
08c13e8969
5 changed files with 92 additions and 56 deletions
|
@ -22,12 +22,12 @@
|
||||||
point="org.eclipse.cdt.managedbuilder.core.ManagedBuildInfo">
|
point="org.eclipse.cdt.managedbuilder.core.ManagedBuildInfo">
|
||||||
<tool
|
<tool
|
||||||
natureFilter="both"
|
natureFilter="both"
|
||||||
sources="rc"
|
|
||||||
name="Target Independent Tool"
|
name="Target Independent Tool"
|
||||||
|
sources="rc"
|
||||||
headerExtensions="h"
|
headerExtensions="h"
|
||||||
outputFlag="/fo"
|
outputFlag="/fo"
|
||||||
outputs="free"
|
|
||||||
command="RC.EXE"
|
command="RC.EXE"
|
||||||
|
outputs="free"
|
||||||
id="target.independent.tool">
|
id="target.independent.tool">
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="target.independent.tool"
|
owner="target.independent.tool"
|
||||||
|
@ -38,8 +38,8 @@
|
||||||
defaultValue="Live free or die"
|
defaultValue="Live free or die"
|
||||||
name="String in Free"
|
name="String in Free"
|
||||||
category="indy.cat.free"
|
category="indy.cat.free"
|
||||||
id="org.eclipse.cdt.core.tests.option1"
|
valueType="string"
|
||||||
valueType="string">
|
id="org.eclipse.cdt.core.tests.option1">
|
||||||
</option>
|
</option>
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="indy.cat.free"
|
owner="indy.cat.free"
|
||||||
|
@ -50,8 +50,8 @@
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="Boolean in Chained"
|
name="Boolean in Chained"
|
||||||
category="indy.cat.chained"
|
category="indy.cat.chained"
|
||||||
id="org.eclipse.cdt.core.tests.option2"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="org.eclipse.cdt.core.tests.option2">
|
||||||
</option>
|
</option>
|
||||||
</tool>
|
</tool>
|
||||||
<target
|
<target
|
||||||
|
@ -62,17 +62,17 @@
|
||||||
defaultExtension="toor"
|
defaultExtension="toor"
|
||||||
isAbstract="false"
|
isAbstract="false"
|
||||||
makeCommand="make"
|
makeCommand="make"
|
||||||
makeArguments="-k"
|
|
||||||
binaryParser="org.eclipse.cdt.core.PE"
|
binaryParser="org.eclipse.cdt.core.PE"
|
||||||
|
makeArguments="-k"
|
||||||
osList="win32">
|
osList="win32">
|
||||||
<tool
|
<tool
|
||||||
natureFilter="cnature"
|
natureFilter="cnature"
|
||||||
name="Root Tool"
|
|
||||||
sources="foo,bar"
|
sources="foo,bar"
|
||||||
|
name="Root Tool"
|
||||||
headerExtensions="baz"
|
headerExtensions="baz"
|
||||||
outputFlag="-r"
|
outputFlag="-r"
|
||||||
command="doIt"
|
|
||||||
outputs="toor"
|
outputs="toor"
|
||||||
|
command="doIt"
|
||||||
id="root.tool">
|
id="root.tool">
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="root.tool"
|
owner="root.tool"
|
||||||
|
@ -82,47 +82,47 @@
|
||||||
<option
|
<option
|
||||||
name="List Option in Top"
|
name="List Option in Top"
|
||||||
command="-L"
|
command="-L"
|
||||||
id="list.option"
|
valueType="stringList"
|
||||||
valueType="stringList">
|
id="list.option">
|
||||||
<listOptionValue
|
<listOptionValue
|
||||||
value="a">
|
value="a">
|
||||||
</listOptionValue>
|
</listOptionValue>
|
||||||
<listOptionValue
|
<listOptionValue
|
||||||
builtIn="false"
|
value="b"
|
||||||
value="b">
|
builtIn="false">
|
||||||
</listOptionValue>
|
</listOptionValue>
|
||||||
<listOptionValue
|
<listOptionValue
|
||||||
builtIn="true"
|
value="c"
|
||||||
value="c">
|
builtIn="true">
|
||||||
</listOptionValue>
|
</listOptionValue>
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="Boolean Option in Top"
|
name="Boolean Option in Top"
|
||||||
command="-b"
|
command="-b"
|
||||||
id="boolean.option"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="boolean.option">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="x"
|
defaultValue="x"
|
||||||
name="String Option in Category"
|
name="String Option in Category"
|
||||||
category="category"
|
category="category"
|
||||||
id="string.option"
|
valueType="string"
|
||||||
valueType="string">
|
id="string.option">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue=""
|
defaultValue=""
|
||||||
name="Another String Option in Category"
|
name="Another String Option in Category"
|
||||||
category="category"
|
category="category"
|
||||||
command="-str"
|
command="-str"
|
||||||
valueType="string"
|
id="another.string.option"
|
||||||
id="another.string.option">
|
valueType="string">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
name="Enumerated Option in Category"
|
name="Enumerated Option in Category"
|
||||||
category="category"
|
category="category"
|
||||||
id="enumerated.option"
|
valueType="enumerated"
|
||||||
valueType="enumerated">
|
id="enumerated.option">
|
||||||
<enumeratedOptionValue
|
<enumeratedOptionValue
|
||||||
name="Default Enum"
|
name="Default Enum"
|
||||||
isDefault="true"
|
isDefault="true"
|
||||||
|
@ -139,8 +139,8 @@
|
||||||
commandFalse="-nob"
|
commandFalse="-nob"
|
||||||
name="Boolean Option in Category"
|
name="Boolean Option in Category"
|
||||||
category="category"
|
category="category"
|
||||||
valueType="boolean"
|
id="boolean.false.option"
|
||||||
id="boolean.false.option">
|
valueType="boolean">
|
||||||
</option>
|
</option>
|
||||||
</tool>
|
</tool>
|
||||||
<configuration
|
<configuration
|
||||||
|
@ -210,8 +210,9 @@
|
||||||
defaultExtension="bus"
|
defaultExtension="bus"
|
||||||
isAbstract="false"
|
isAbstract="false"
|
||||||
binaryParser="org.eclipse.cdt.core.PE"
|
binaryParser="org.eclipse.cdt.core.PE"
|
||||||
makeArguments="-d"
|
archList="x86,ppc"
|
||||||
parent="test.root"
|
parent="test.root"
|
||||||
|
makeArguments="-d"
|
||||||
osList="win32,linux,solaris">
|
osList="win32,linux,solaris">
|
||||||
<configuration
|
<configuration
|
||||||
name="Sub Config"
|
name="Sub Config"
|
||||||
|
@ -219,18 +220,18 @@
|
||||||
</configuration>
|
</configuration>
|
||||||
<tool
|
<tool
|
||||||
natureFilter="both"
|
natureFilter="both"
|
||||||
name="Sub Tool"
|
|
||||||
sources="yarf"
|
sources="yarf"
|
||||||
|
name="Sub Tool"
|
||||||
headerExtensions="arf,barf"
|
headerExtensions="arf,barf"
|
||||||
outputPrefix="lib"
|
|
||||||
outputs="bus"
|
outputs="bus"
|
||||||
|
outputPrefix="lib"
|
||||||
id="tool.sub">
|
id="tool.sub">
|
||||||
<option
|
<option
|
||||||
name="Include Paths"
|
name="Include Paths"
|
||||||
command="-I"
|
command="-I"
|
||||||
id="sub.tool.opt.inc.paths"
|
browseType="directory"
|
||||||
valueType="includePath"
|
valueType="includePath"
|
||||||
browseType="directory">
|
id="sub.tool.opt.inc.paths">
|
||||||
<listOptionValue
|
<listOptionValue
|
||||||
value="/usr/include">
|
value="/usr/include">
|
||||||
</listOptionValue>
|
</listOptionValue>
|
||||||
|
@ -238,47 +239,47 @@
|
||||||
value="/opt/gnome/include">
|
value="/opt/gnome/include">
|
||||||
</listOptionValue>
|
</listOptionValue>
|
||||||
<listOptionValue
|
<listOptionValue
|
||||||
builtIn="true"
|
value="/usr/gnu/include"
|
||||||
value="/usr/gnu/include">
|
builtIn="true">
|
||||||
</listOptionValue>
|
</listOptionValue>
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
name="Defined Symbols"
|
name="Defined Symbols"
|
||||||
command="-D"
|
command="-D"
|
||||||
id="sub.tool.opt.def.symbols"
|
valueType="definedSymbols"
|
||||||
valueType="definedSymbols">
|
id="sub.tool.opt.def.symbols">
|
||||||
<listOptionValue
|
<listOptionValue
|
||||||
builtIn="true"
|
value="BUILTIN"
|
||||||
value="BUILTIN">
|
builtIn="true">
|
||||||
</listOptionValue>
|
</listOptionValue>
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
name="More Includes"
|
name="More Includes"
|
||||||
command="-I"
|
command="-I"
|
||||||
id="sub.tool.opts.inc.paths.more"
|
browseType="directory"
|
||||||
valueType="includePath"
|
valueType="includePath"
|
||||||
browseType="directory">
|
id="sub.tool.opts.inc.paths.more">
|
||||||
<listOptionValue
|
<listOptionValue
|
||||||
builtIn="false"
|
value="C:\home\tester/include"
|
||||||
value="C:\home\tester/include">
|
builtIn="false">
|
||||||
</listOptionValue>
|
</listOptionValue>
|
||||||
<listOptionValue
|
<listOptionValue
|
||||||
builtIn="false"
|
value=""../includes""
|
||||||
value=""../includes"">
|
builtIn="false">
|
||||||
</listOptionValue>
|
</listOptionValue>
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
name="User Objects"
|
name="User Objects"
|
||||||
id="sub.tool.opt.objs"
|
browseType="file"
|
||||||
valueType="userObjs"
|
valueType="userObjs"
|
||||||
browseType="file">
|
id="sub.tool.opt.objs">
|
||||||
<listOptionValue
|
<listOptionValue
|
||||||
builtIn="false"
|
value="obj1.o"
|
||||||
value="obj1.o">
|
builtIn="false">
|
||||||
</listOptionValue>
|
</listOptionValue>
|
||||||
<listOptionValue
|
<listOptionValue
|
||||||
builtIn="false"
|
value="obj2.o"
|
||||||
value="obj2.o">
|
builtIn="false">
|
||||||
</listOptionValue>
|
</listOptionValue>
|
||||||
</option>
|
</option>
|
||||||
</tool>
|
</tool>
|
||||||
|
@ -286,8 +287,8 @@
|
||||||
<target
|
<target
|
||||||
isTest="true"
|
isTest="true"
|
||||||
name="Test Sub Sub"
|
name="Test Sub Sub"
|
||||||
binaryParser="org.eclipse.cdt.core.ELF"
|
|
||||||
parent="test.sub"
|
parent="test.sub"
|
||||||
|
binaryParser="org.eclipse.cdt.core.ELF"
|
||||||
defaultExtension="tss"
|
defaultExtension="tss"
|
||||||
makeCommand="nmake"
|
makeCommand="nmake"
|
||||||
id="test.sub.sub">
|
id="test.sub.sub">
|
||||||
|
@ -302,8 +303,8 @@
|
||||||
<target
|
<target
|
||||||
isTest="true"
|
isTest="true"
|
||||||
name="Forward Grandchild"
|
name="Forward Grandchild"
|
||||||
binaryParser="org.eclipse.cdt.core.tests.target1"
|
|
||||||
parent="test.forward.child.target"
|
parent="test.forward.child.target"
|
||||||
|
binaryParser="org.eclipse.cdt.core.tests.target1"
|
||||||
id="test.forward.grandchild.target">
|
id="test.forward.grandchild.target">
|
||||||
<toolReference
|
<toolReference
|
||||||
command="newcommand"
|
command="newcommand"
|
||||||
|
@ -314,8 +315,8 @@
|
||||||
isTest="true"
|
isTest="true"
|
||||||
osList="win32,solaris,linux"
|
osList="win32,solaris,linux"
|
||||||
name="Forward Child"
|
name="Forward Child"
|
||||||
parent="test.forward.parent.target"
|
|
||||||
binaryParser="org.eclipse.cdt.core.tests.target2"
|
binaryParser="org.eclipse.cdt.core.tests.target2"
|
||||||
|
parent="test.forward.parent.target"
|
||||||
id="test.forward.child.target">
|
id="test.forward.child.target">
|
||||||
<toolReference
|
<toolReference
|
||||||
id="test.forward.tool">
|
id="test.forward.tool">
|
||||||
|
@ -359,16 +360,14 @@
|
||||||
id="test.error.parsers">
|
id="test.error.parsers">
|
||||||
<tool
|
<tool
|
||||||
natureFilter="cnature"
|
natureFilter="cnature"
|
||||||
name="EP Tool"
|
|
||||||
sources="x,y"
|
sources="x,y"
|
||||||
|
name="EP Tool"
|
||||||
outputFlag="-o"
|
outputFlag="-o"
|
||||||
command="EP"
|
|
||||||
outputs="xy"
|
outputs="xy"
|
||||||
|
command="EP"
|
||||||
id="error.parsers.tool">
|
id="error.parsers.tool">
|
||||||
</tool>
|
</tool>
|
||||||
</target>
|
</target>
|
||||||
<!-- The old tool definitions exercised the model differently, so keep an example around for testing -->
|
|
||||||
|
|
||||||
</extension>
|
</extension>
|
||||||
|
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
|
@ -486,6 +486,13 @@ Additional special types exist to flag options of special relevance to the build
|
||||||
</documentation>
|
</documentation>
|
||||||
</annotation>
|
</annotation>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
<attribute name="archList" type="string">
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
This field is used by the managed build system to decide when to show the user the target. The value should be a comma-separated list. Current values include "x86", "sparc", "ppc"; or "all".
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
</attribute>
|
||||||
<attribute name="errorParsers" type="string">
|
<attribute name="errorParsers" type="string">
|
||||||
<annotation>
|
<annotation>
|
||||||
<documentation>
|
<documentation>
|
||||||
|
|
|
@ -29,6 +29,7 @@ public interface ITarget extends IBuildObject {
|
||||||
public static final String MAKE_COMMAND = "makeCommand"; //$NON-NLS-1$
|
public static final String MAKE_COMMAND = "makeCommand"; //$NON-NLS-1$
|
||||||
public static final String MAKE_ARGS = "makeArguments"; //$NON-NLS-1$
|
public static final String MAKE_ARGS = "makeArguments"; //$NON-NLS-1$
|
||||||
public static final String OS_LIST = "osList"; //$NON-NLS-1$
|
public static final String OS_LIST = "osList"; //$NON-NLS-1$
|
||||||
|
public static final String ARCH_LIST = "archList"; //$NON-NLS-1$
|
||||||
public static final String PARENT = "parent"; //$NON-NLS-1$
|
public static final String PARENT = "parent"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -161,6 +162,13 @@ public interface ITarget extends IBuildObject {
|
||||||
*/
|
*/
|
||||||
public String[] getTargetOSList();
|
public String[] getTargetOSList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Answers an array of architectures the target can be created on.
|
||||||
|
*
|
||||||
|
* @return String[]
|
||||||
|
*/
|
||||||
|
public String[] getTargetArchList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the list of platform specific tools associated with this
|
* Returns the list of platform specific tools associated with this
|
||||||
* platform.
|
* platform.
|
||||||
|
|
|
@ -51,6 +51,7 @@ public class Target extends BuildObject implements ITarget {
|
||||||
private IResource owner;
|
private IResource owner;
|
||||||
private ITarget parent;
|
private ITarget parent;
|
||||||
private List targetOSList;
|
private List targetOSList;
|
||||||
|
private List targetArchList;
|
||||||
private Map toolMap;
|
private Map toolMap;
|
||||||
private List toolList;
|
private List toolList;
|
||||||
private List toolReferences;
|
private List toolReferences;
|
||||||
|
@ -466,6 +467,22 @@ public class Target extends BuildObject implements ITarget {
|
||||||
return (String[]) targetOSList.toArray(new String[targetOSList.size()]);
|
return (String[]) targetOSList.toArray(new String[targetOSList.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.managedbuilder.core.ITarget#getTargetArchList()
|
||||||
|
*/
|
||||||
|
public String[] getTargetArchList() {
|
||||||
|
if (targetArchList == null) {
|
||||||
|
// Ask parent for its list
|
||||||
|
if (parent != null) {
|
||||||
|
return parent.getTargetArchList();
|
||||||
|
} else {
|
||||||
|
// I have no parent and no defined list
|
||||||
|
return new String[] {"all"}; //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (String[]) targetArchList.toArray(new String[targetArchList.size()]);
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.ITarget#getOwner()
|
* @see org.eclipse.cdt.managedbuilder.core.ITarget#getOwner()
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -291,6 +291,7 @@ public class CProjectPlatformPage extends WizardPage {
|
||||||
ITarget[] allTargets = ManagedBuildManager.getDefinedTargets(null);
|
ITarget[] allTargets = ManagedBuildManager.getDefinedTargets(null);
|
||||||
targets = new ArrayList();
|
targets = new ArrayList();
|
||||||
String os = BootLoader.getOS();
|
String os = BootLoader.getOS();
|
||||||
|
String arch = BootLoader.getOSArch();
|
||||||
// Add all of the concrete targets to the target list
|
// Add all of the concrete targets to the target list
|
||||||
for (int index = 0; index < allTargets.length; ++index) {
|
for (int index = 0; index < allTargets.length; ++index) {
|
||||||
ITarget target = allTargets[index];
|
ITarget target = allTargets[index];
|
||||||
|
@ -299,9 +300,13 @@ public class CProjectPlatformPage extends WizardPage {
|
||||||
if (showAll != null && showAll.getSelection() == true) {
|
if (showAll != null && showAll.getSelection() == true) {
|
||||||
targets.add(target);
|
targets.add(target);
|
||||||
} else {
|
} else {
|
||||||
|
// Apply the OS and ARCH filters to determine if the target should be shown
|
||||||
List targetOSList = Arrays.asList(target.getTargetOSList());
|
List targetOSList = Arrays.asList(target.getTargetOSList());
|
||||||
if (targetOSList.contains("all") || targetOSList.contains(os)) { //$NON-NLS-1$
|
if (targetOSList.contains("all") || targetOSList.contains(os)) { //$NON-NLS-1$
|
||||||
targets.add(target);
|
List targetArchList = Arrays.asList(target.getTargetArchList());
|
||||||
|
if (targetArchList.contains("all") || targetArchList.contains(arch)) { //$NON-NLS-1$
|
||||||
|
targets.add(target);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue