mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 10:16:03 +02:00
Adding the capability of dynamically discovering the built-in compiler paths and symbols and storing them in a PathContainer. The UI has been modified to allw users to turn off indexing for a managed project
This commit is contained in:
parent
003e8f5546
commit
a7ad0b285d
18 changed files with 938 additions and 374 deletions
|
@ -1,10 +1,12 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<?eclipse version="3.0"?>
|
||||||
<plugin
|
<plugin
|
||||||
id="org.eclipse.cdt.managedbuilder.core.tests"
|
id="org.eclipse.cdt.managedbuilder.core.tests"
|
||||||
name="Tests"
|
name="Tests"
|
||||||
version="1.0.0">
|
version="1.0.0">
|
||||||
|
|
||||||
<requires>
|
<requires>
|
||||||
|
<import plugin="org.eclipse.core.runtime.compatibility"/>
|
||||||
<import plugin="org.junit"/>
|
<import plugin="org.junit"/>
|
||||||
<import plugin="org.eclipse.cdt.managedbuilder.core"/>
|
<import plugin="org.eclipse.cdt.managedbuilder.core"/>
|
||||||
<import plugin="org.eclipse.cdt.core"/>
|
<import plugin="org.eclipse.cdt.core"/>
|
||||||
|
|
|
@ -239,8 +239,8 @@ public class ManagedBuildCoreTests extends TestCase {
|
||||||
buildInfo.setDefaultConfiguration(newTarget.getConfiguration(configs[0].getId()));
|
buildInfo.setDefaultConfiguration(newTarget.getConfiguration(configs[0].getId()));
|
||||||
|
|
||||||
// Save the build info
|
// Save the build info
|
||||||
ManagedBuildManager.saveBuildInfo(project, false);
|
ManagedBuildManager.saveBuildInfo(project, false);
|
||||||
|
|
||||||
// Use the plugin mechanism to discover the supplier of the path information
|
// Use the plugin mechanism to discover the supplier of the path information
|
||||||
IExtensionPoint extensionPoint = CCorePlugin.getDefault().getDescriptor().getExtensionPoint("ScannerInfoProvider");
|
IExtensionPoint extensionPoint = CCorePlugin.getDefault().getDescriptor().getExtensionPoint("ScannerInfoProvider");
|
||||||
if (extensionPoint == null) {
|
if (extensionPoint == null) {
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
<import plugin="org.eclipse.cdt.core"/>
|
<import plugin="org.eclipse.cdt.core"/>
|
||||||
<import plugin="org.eclipse.core.resources"/>
|
<import plugin="org.eclipse.core.resources"/>
|
||||||
<import plugin="org.eclipse.core.runtime.compatibility"/>
|
<import plugin="org.eclipse.core.runtime.compatibility"/>
|
||||||
|
<import plugin="org.eclipse.cdt.make.core"/>
|
||||||
</requires>
|
</requires>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -493,6 +493,16 @@ Additional special types exist to flag options of special relevance to the build
|
||||||
</documentation>
|
</documentation>
|
||||||
</annotation>
|
</annotation>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
<attribute name="scannerInfoCollector" type="string">
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
|
||||||
|
</documentation>
|
||||||
|
<appInfo>
|
||||||
|
<meta.attribute kind="java" basedOn="org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector"/>
|
||||||
|
</appInfo>
|
||||||
|
</annotation>
|
||||||
|
</attribute>
|
||||||
</complexType>
|
</complexType>
|
||||||
</element>
|
</element>
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.managedbuilder.core;
|
package org.eclipse.cdt.managedbuilder.core;
|
||||||
|
|
||||||
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
|
|
||||||
public interface IConfiguration extends IBuildObject {
|
public interface IConfiguration extends IBuildObject {
|
||||||
|
@ -19,11 +20,15 @@ public interface IConfiguration extends IBuildObject {
|
||||||
public static final String PARENT = "parent"; //$NON-NLS-1$
|
public static final String PARENT = "parent"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the target for this configuration.
|
* Projects have C or CC natures. Tools can specify a filter so they are not
|
||||||
|
* misapplied to a project. This method allows the caller to retrieve a list
|
||||||
|
* of tools from a project that are correct for a project's nature.
|
||||||
*
|
*
|
||||||
* @return
|
* @param project the project to filter for
|
||||||
|
* @return an array of <code>ITools</code> that have compatible filters
|
||||||
|
* for the specified project
|
||||||
*/
|
*/
|
||||||
public ITarget getTarget();
|
ITool[] getFilteredTools(IProject project);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the resource that owns the target that owns the configuration.
|
* Returns the resource that owns the target that owns the configuration.
|
||||||
|
@ -38,6 +43,20 @@ public interface IConfiguration extends IBuildObject {
|
||||||
*/
|
*/
|
||||||
public IConfiguration getParent();
|
public IConfiguration getParent();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the target for this configuration.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public ITarget getTarget();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Answers the <code>ITool</code> in the receiver with the same
|
||||||
|
* id as the argument, or <code>null</code>.
|
||||||
|
*
|
||||||
|
* @param id unique identifier to search for
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public ITool getToolById(String id);
|
public ITool getToolById(String id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -35,12 +35,6 @@ import javax.xml.transform.dom.DOMSource;
|
||||||
import javax.xml.transform.stream.StreamResult;
|
import javax.xml.transform.stream.StreamResult;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.AbstractCExtension;
|
import org.eclipse.cdt.core.AbstractCExtension;
|
||||||
import org.eclipse.cdt.core.model.CModelException;
|
|
||||||
import org.eclipse.cdt.core.model.CoreModel;
|
|
||||||
import org.eclipse.cdt.core.model.ICProject;
|
|
||||||
import org.eclipse.cdt.core.model.IContainerEntry;
|
|
||||||
import org.eclipse.cdt.core.model.IPathEntry;
|
|
||||||
import org.eclipse.cdt.core.model.IPathEntryContainer;
|
|
||||||
import org.eclipse.cdt.core.parser.IScannerInfo;
|
import org.eclipse.cdt.core.parser.IScannerInfo;
|
||||||
import org.eclipse.cdt.core.parser.IScannerInfoChangeListener;
|
import org.eclipse.cdt.core.parser.IScannerInfoChangeListener;
|
||||||
import org.eclipse.cdt.core.parser.IScannerInfoProvider;
|
import org.eclipse.cdt.core.parser.IScannerInfoProvider;
|
||||||
|
@ -49,7 +43,6 @@ import org.eclipse.cdt.managedbuilder.internal.core.DefaultManagedConfigElement;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
|
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.core.Target;
|
import org.eclipse.cdt.managedbuilder.internal.core.Target;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.core.Tool;
|
import org.eclipse.cdt.managedbuilder.internal.core.Tool;
|
||||||
import org.eclipse.cdt.managedbuilder.scannerconfig.ManagedBuildCPathEntryContainer;
|
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
|
@ -58,8 +51,6 @@ import org.eclipse.core.runtime.IConfigurationElement;
|
||||||
import org.eclipse.core.runtime.IExtension;
|
import org.eclipse.core.runtime.IExtension;
|
||||||
import org.eclipse.core.runtime.IExtensionPoint;
|
import org.eclipse.core.runtime.IExtensionPoint;
|
||||||
import org.eclipse.core.runtime.IPluginDescriptor;
|
import org.eclipse.core.runtime.IPluginDescriptor;
|
||||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
|
||||||
import org.eclipse.core.runtime.Path;
|
|
||||||
import org.eclipse.core.runtime.PluginVersionIdentifier;
|
import org.eclipse.core.runtime.PluginVersionIdentifier;
|
||||||
import org.eclipse.core.runtime.QualifiedName;
|
import org.eclipse.core.runtime.QualifiedName;
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
|
@ -79,7 +70,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
public static final String SETTINGS_FILE_NAME = ".cdtbuild"; //$NON-NLS-1$
|
public static final String SETTINGS_FILE_NAME = ".cdtbuild"; //$NON-NLS-1$
|
||||||
private static final ITarget[] emptyTargets = new ITarget[0];
|
private static final ITarget[] emptyTargets = new ITarget[0];
|
||||||
public static final String INTERFACE_IDENTITY = ManagedBuilderCorePlugin.getUniqueIdentifier() + "." + "ManagedBuildManager"; //$NON-NLS-1$ //$NON-NLS-2$
|
public static final String INTERFACE_IDENTITY = ManagedBuilderCorePlugin.getUniqueIdentifier() + "." + "ManagedBuildManager"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
private static final String EXTENSION_POINT_ID = "ManagedBuildInfo"; //$NON-NLS-1$
|
public static final String EXTENSION_POINT_ID = "ManagedBuildInfo"; //$NON-NLS-1$
|
||||||
private static final String REVISION_ELEMENT_NAME = "managedBuildRevision"; //$NON-NLS-1$
|
private static final String REVISION_ELEMENT_NAME = "managedBuildRevision"; //$NON-NLS-1$
|
||||||
private static final String VERSION_ELEMENT_NAME = "fileVersion"; //$NON-NLS-1$
|
private static final String VERSION_ELEMENT_NAME = "fileVersion"; //$NON-NLS-1$
|
||||||
private static final String MANIFEST_VERSION_ERROR ="ManagedBuildManager.error.manifest.version.error"; //$NON-NLS-1$
|
private static final String MANIFEST_VERSION_ERROR ="ManagedBuildManager.error.manifest.version.error"; //$NON-NLS-1$
|
||||||
|
@ -93,6 +84,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
private static Map extensionToolMap;
|
private static Map extensionToolMap;
|
||||||
private static Map configElementMap;
|
private static Map configElementMap;
|
||||||
|
|
||||||
|
|
||||||
// Listeners interested in build model changes
|
// Listeners interested in build model changes
|
||||||
private static Map buildModelListeners;
|
private static Map buildModelListeners;
|
||||||
|
|
||||||
|
@ -714,7 +706,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ManagedBuildInfo findBuildInfo(IResource resource, boolean create) {
|
private static synchronized ManagedBuildInfo findBuildInfo(IResource resource, boolean create) {
|
||||||
// Make sure the extension information is loaded first
|
// Make sure the extension information is loaded first
|
||||||
try {
|
try {
|
||||||
loadExtensions();
|
loadExtensions();
|
||||||
|
@ -723,8 +715,6 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flag to deteremine if a PathEntryContainer is needed for project
|
|
||||||
boolean needsContainer = false;
|
|
||||||
ManagedBuildInfo buildInfo = null;
|
ManagedBuildInfo buildInfo = null;
|
||||||
|
|
||||||
// Check if there is any build info associated with this project for this session
|
// Check if there is any build info associated with this project for this session
|
||||||
|
@ -741,36 +731,19 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
if (buildInfo == null && resource instanceof IProject) {
|
if (buildInfo == null && resource instanceof IProject) {
|
||||||
// Nothing in session store, so see if we can load it from cdtbuild
|
// Nothing in session store, so see if we can load it from cdtbuild
|
||||||
buildInfo = loadBuildInfo((IProject)resource);
|
buildInfo = loadBuildInfo((IProject)resource);
|
||||||
needsContainer = (buildInfo != null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buildInfo == null && create) {
|
if (buildInfo == null && create) {
|
||||||
try {
|
try {
|
||||||
// Create a new build info object for the project
|
// Create a new build info object for the project
|
||||||
buildInfo = new ManagedBuildInfo(resource);
|
buildInfo = new ManagedBuildInfo(resource, true);
|
||||||
// Associate the build info with the project for the duration of the session
|
// Associate the build info with the project for the duration of the session
|
||||||
resource.setSessionProperty(buildInfoProperty, buildInfo);
|
resource.setSessionProperty(buildInfoProperty, buildInfo);
|
||||||
needsContainer = true;
|
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assocaite a container with the project
|
|
||||||
if (buildInfo != null && needsContainer) {
|
|
||||||
IPathEntryContainer container = new ManagedBuildCPathEntryContainer(buildInfo);
|
|
||||||
try {
|
|
||||||
ICProject project = CoreModel.getDefault().create((IProject)resource);
|
|
||||||
IContainerEntry containerEntry = CoreModel.newContainerEntry(new Path("org.eclipse.cdt.managedbuilder.MANAGED_CONTAINER")); //$NON-NLS-1$
|
|
||||||
CoreModel.getDefault().setRawPathEntries(project, new IPathEntry[]{containerEntry}, new NullProgressMonitor());
|
|
||||||
CoreModel.getDefault().setPathEntryContainer(new ICProject[]{project}, container, new NullProgressMonitor());
|
|
||||||
} catch (CModelException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
// The build info is valid even if there's no container
|
|
||||||
return buildInfo;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return buildInfo;
|
return buildInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,11 @@ import java.text.MessageFormat;
|
||||||
import java.util.MissingResourceException;
|
import java.util.MissingResourceException;
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector;
|
||||||
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
import org.eclipse.core.runtime.IConfigurationElement;
|
||||||
|
import org.eclipse.core.runtime.IExtension;
|
||||||
|
import org.eclipse.core.runtime.IExtensionPoint;
|
||||||
import org.eclipse.core.runtime.IPluginDescriptor;
|
import org.eclipse.core.runtime.IPluginDescriptor;
|
||||||
import org.eclipse.core.runtime.Plugin;
|
import org.eclipse.core.runtime.Plugin;
|
||||||
|
|
||||||
|
@ -77,4 +82,37 @@ public class ManagedBuilderCorePlugin extends Plugin {
|
||||||
return getDefault().getDescriptor().getUniqueIdentifier();
|
return getDefault().getDescriptor().getUniqueIdentifier();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Targets may have a scanner collector defined that knows how to discover
|
||||||
|
* built-in compiler defines and includes search paths. Find the scanner
|
||||||
|
* collector implentation for the target specified.
|
||||||
|
*
|
||||||
|
* @param string the unique id of the target to search for
|
||||||
|
* @return an implementation of <code>IManagedScannerInfoCollector</code>
|
||||||
|
*/
|
||||||
|
public IManagedScannerInfoCollector getScannerInfoCollector(String targetId) {
|
||||||
|
try {
|
||||||
|
IExtensionPoint extension = getDescriptor().getExtensionPoint(ManagedBuildManager.EXTENSION_POINT_ID);
|
||||||
|
if (extension != null) {
|
||||||
|
// There could be many of these
|
||||||
|
IExtension[] extensions = extension.getExtensions();
|
||||||
|
for (int i = 0; i < extensions.length; i++) {
|
||||||
|
IConfigurationElement[] configElements = extensions[i].getConfigurationElements();
|
||||||
|
for (int j = 0; j < configElements.length; j++) {
|
||||||
|
IConfigurationElement element = configElements[j];
|
||||||
|
if (element.getName().equals("target")) { //$NON-NLS-1$
|
||||||
|
if (element.getAttribute(ITarget.ID).equals(targetId)) {
|
||||||
|
return (IManagedScannerInfoCollector) element.createExecutableExtension("scannerInfoCollector"); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (CoreException e) {
|
||||||
|
// Probably not defined
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Vector;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.CCProjectNature;
|
import org.eclipse.cdt.core.CCProjectNature;
|
||||||
import org.eclipse.cdt.core.CProjectNature;
|
import org.eclipse.cdt.core.CProjectNature;
|
||||||
|
@ -245,6 +246,42 @@ public class Configuration extends BuildObject implements IConfiguration {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getFilteredTools(org.eclipse.core.resources.IProject)
|
||||||
|
*/
|
||||||
|
public ITool[] getFilteredTools(IProject project) {
|
||||||
|
ITool[] localTools = getTools();
|
||||||
|
Vector tools = new Vector(localTools.length);
|
||||||
|
for (int i = 0; i < localTools.length; i++) {
|
||||||
|
ITool tool = localTools[i];
|
||||||
|
try {
|
||||||
|
// Make sure the tool is right for the project
|
||||||
|
switch (tool.getNatureFilter()) {
|
||||||
|
case ITool.FILTER_C:
|
||||||
|
if (project.hasNature(CProjectNature.C_NATURE_ID) && !project.hasNature(CCProjectNature.CC_NATURE_ID)) {
|
||||||
|
tools.add(tool);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ITool.FILTER_CC:
|
||||||
|
if (project.hasNature(CCProjectNature.CC_NATURE_ID)) {
|
||||||
|
tools.add(tool);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ITool.FILTER_BOTH:
|
||||||
|
tools.add(tool);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (CoreException e) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Answer the filtered tools as an array
|
||||||
|
return (ITool[])tools.toArray(new ITool[tools.size()]);
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-javadoc)
|
/* (non-javadoc)
|
||||||
* A safety method to avoid NPEs. It answers the tool reference list in the
|
* A safety method to avoid NPEs. It answers the tool reference list in the
|
||||||
* receiver. It does not look at the tool references defined in the parent.
|
* receiver. It does not look at the tool references defined in the parent.
|
||||||
|
|
|
@ -23,8 +23,11 @@ import org.eclipse.cdt.core.CProjectNature;
|
||||||
import org.eclipse.cdt.core.model.CModelException;
|
import org.eclipse.cdt.core.model.CModelException;
|
||||||
import org.eclipse.cdt.core.model.CoreModel;
|
import org.eclipse.cdt.core.model.CoreModel;
|
||||||
import org.eclipse.cdt.core.model.ICProject;
|
import org.eclipse.cdt.core.model.ICProject;
|
||||||
|
import org.eclipse.cdt.core.model.IContainerEntry;
|
||||||
import org.eclipse.cdt.core.model.IIncludeEntry;
|
import org.eclipse.cdt.core.model.IIncludeEntry;
|
||||||
|
import org.eclipse.cdt.core.model.IMacroEntry;
|
||||||
import org.eclipse.cdt.core.model.IPathEntry;
|
import org.eclipse.cdt.core.model.IPathEntry;
|
||||||
|
import org.eclipse.cdt.core.model.IPathEntryContainer;
|
||||||
import org.eclipse.cdt.core.parser.IScannerInfo;
|
import org.eclipse.cdt.core.parser.IScannerInfo;
|
||||||
import org.eclipse.cdt.managedbuilder.core.BuildException;
|
import org.eclipse.cdt.managedbuilder.core.BuildException;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||||
|
@ -33,10 +36,12 @@ import org.eclipse.cdt.managedbuilder.core.IOption;
|
||||||
import org.eclipse.cdt.managedbuilder.core.ITarget;
|
import org.eclipse.cdt.managedbuilder.core.ITarget;
|
||||||
import org.eclipse.cdt.managedbuilder.core.ITool;
|
import org.eclipse.cdt.managedbuilder.core.ITool;
|
||||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
|
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
|
||||||
|
import org.eclipse.cdt.managedbuilder.internal.scannerconfig.ManagedBuildCPathEntryContainer;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
|
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
import org.eclipse.core.runtime.QualifiedName;
|
import org.eclipse.core.runtime.QualifiedName;
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
|
@ -50,6 +55,10 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
public static final String MINOR_SEPERATOR = "::"; //$NON-NLS-1$
|
public static final String MINOR_SEPERATOR = "::"; //$NON-NLS-1$
|
||||||
private static final QualifiedName defaultConfigProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), "defaultConfig"); //$NON-NLS-1$
|
private static final QualifiedName defaultConfigProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), "defaultConfig"); //$NON-NLS-1$
|
||||||
private static final QualifiedName defaultTargetProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), "defaultTarget"); //$NON-NLS-1$
|
private static final QualifiedName defaultTargetProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), "defaultTarget"); //$NON-NLS-1$
|
||||||
|
// The path container used for all managed projects
|
||||||
|
private static final IContainerEntry containerEntry = CoreModel.newContainerEntry(new Path("org.eclipse.cdt.managedbuilder.MANAGED_CONTAINER")); //$NON-NLS-1$
|
||||||
|
|
||||||
|
private ICProject cModelElement;
|
||||||
private String defaultConfigIds;
|
private String defaultConfigIds;
|
||||||
private Map defaultConfigMap;
|
private Map defaultConfigMap;
|
||||||
private ITarget defaultTarget;
|
private ITarget defaultTarget;
|
||||||
|
@ -61,13 +70,34 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
private List targetList;
|
private List targetList;
|
||||||
private String version;
|
private String version;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new managed build information for the IResource specified in the argument
|
* For compatability.
|
||||||
*
|
*
|
||||||
* @param owner
|
* @param owner
|
||||||
*/
|
*/
|
||||||
public ManagedBuildInfo(IResource owner) {
|
public ManagedBuildInfo(IResource owner) {
|
||||||
|
this(owner, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new managed build information for the IResource specified in the argument
|
||||||
|
*
|
||||||
|
* @param owner
|
||||||
|
* @param intializeEntries
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
|
public ManagedBuildInfo(IResource owner, boolean intializeEntries) {
|
||||||
this.owner = owner;
|
this.owner = owner;
|
||||||
|
cModelElement = CoreModel.getDefault().create(owner.getProject());
|
||||||
|
|
||||||
|
try {
|
||||||
|
CoreModel.getDefault().setRawPathEntries(cModelElement, new IPathEntry[]{containerEntry}, new NullProgressMonitor());
|
||||||
|
} catch (CModelException e1) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
isDirty = false;
|
isDirty = false;
|
||||||
|
|
||||||
// The id of the default target from the project persistent settings store
|
// The id of the default target from the project persistent settings store
|
||||||
|
@ -89,6 +119,9 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(intializeEntries) {
|
||||||
|
initializePathEntries();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -99,13 +132,15 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
* @param element
|
* @param element
|
||||||
*/
|
*/
|
||||||
public ManagedBuildInfo(IResource owner, Element element) {
|
public ManagedBuildInfo(IResource owner, Element element) {
|
||||||
this(owner);
|
this(owner, false);
|
||||||
|
|
||||||
// Inflate the targets
|
// Inflate the targets
|
||||||
NodeList targetNodes = element.getElementsByTagName(ITarget.TARGET_ELEMENT_NAME);
|
NodeList targetNodes = element.getElementsByTagName(ITarget.TARGET_ELEMENT_NAME);
|
||||||
for (int targIndex = targetNodes.getLength() - 1; targIndex >= 0; --targIndex) {
|
for (int targIndex = targetNodes.getLength() - 1; targIndex >= 0; --targIndex) {
|
||||||
new Target(this, (Element)targetNodes.item(targIndex));
|
new Target(this, (Element)targetNodes.item(targIndex));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
initializePathEntries();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -273,7 +308,10 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
}
|
}
|
||||||
// If that failed, look for anything
|
// If that failed, look for anything
|
||||||
if (defaultTarget == null) {
|
if (defaultTarget == null) {
|
||||||
defaultTarget = (ITarget) getTargets().get(0);
|
// Are there any defined targets
|
||||||
|
if (getTargets().size() > 0) {
|
||||||
|
return (ITarget) getTargets().get(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return defaultTarget;
|
return defaultTarget;
|
||||||
|
@ -283,32 +321,12 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
* @see org.eclipse.cdt.core.build.managed.IScannerInfo#getDefinedSymbols()
|
* @see org.eclipse.cdt.core.build.managed.IScannerInfo#getDefinedSymbols()
|
||||||
*/
|
*/
|
||||||
public Map getDefinedSymbols() {
|
public Map getDefinedSymbols() {
|
||||||
IProject project = (IProject)owner;
|
|
||||||
// Return the defined symbols for the default configuration
|
// Return the defined symbols for the default configuration
|
||||||
HashMap symbols = new HashMap();
|
HashMap symbols = getMacroPathEntries();
|
||||||
IConfiguration config = getDefaultConfiguration(getDefaultTarget());
|
IConfiguration config = getDefaultConfiguration(getDefaultTarget());
|
||||||
ITool[] tools = config.getTools();
|
ITool[] tools = config.getFilteredTools(owner.getProject());
|
||||||
for (int i = 0; i < tools.length; i++) {
|
for (int i = 0; i < tools.length; i++) {
|
||||||
ITool tool = tools[i];
|
ITool tool = tools[i];
|
||||||
try {
|
|
||||||
// Make sure the tool is right for the project
|
|
||||||
switch (tool.getNatureFilter()) {
|
|
||||||
case ITool.FILTER_C:
|
|
||||||
if (!project.hasNature(CProjectNature.C_NATURE_ID) || project.hasNature(CCProjectNature.CC_NATURE_ID)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case ITool.FILTER_CC:
|
|
||||||
if (!project.hasNature(CCProjectNature.CC_NATURE_ID)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case ITool.FILTER_BOTH:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} catch (CoreException e) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// Now extract the valid tool's options
|
// Now extract the valid tool's options
|
||||||
IOption[] opts = tool.getOptions();
|
IOption[] opts = tool.getOptions();
|
||||||
for (int j = 0; j < opts.length; j++) {
|
for (int j = 0; j < opts.length; j++) {
|
||||||
|
@ -316,7 +334,6 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
if (option.getValueType() == IOption.PREPROCESSOR_SYMBOLS) {
|
if (option.getValueType() == IOption.PREPROCESSOR_SYMBOLS) {
|
||||||
try {
|
try {
|
||||||
ArrayList symbolList = new ArrayList();
|
ArrayList symbolList = new ArrayList();
|
||||||
symbolList.addAll(Arrays.asList(option.getBuiltIns()));
|
|
||||||
symbolList.addAll(Arrays.asList(option.getDefinedSymbols()));
|
symbolList.addAll(Arrays.asList(option.getDefinedSymbols()));
|
||||||
Iterator iter = symbolList.listIterator();
|
Iterator iter = symbolList.listIterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
|
@ -324,15 +341,9 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
if (symbol.length() == 0){
|
if (symbol.length() == 0){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
String key = new String();
|
String[] tokens = symbol.split("="); //$NON-NLS-1$
|
||||||
String value = new String();
|
String key = tokens[0].trim();
|
||||||
int index = symbol.indexOf("="); //$NON-NLS-1$
|
String value = (tokens.length > 1) ? tokens[1].trim() : new String();
|
||||||
if (index != -1) {
|
|
||||||
key = symbol.substring(0, index).trim();
|
|
||||||
value = symbol.substring(index + 1).trim();
|
|
||||||
} else {
|
|
||||||
key = symbol.trim();
|
|
||||||
}
|
|
||||||
symbols.put(key, value);
|
symbols.put(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -426,14 +437,37 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private ArrayList getIncludePathEntries() {
|
||||||
|
// Extract the resolved paths from the project (if any)
|
||||||
|
ArrayList paths = new ArrayList();
|
||||||
|
if (cModelElement != null) {
|
||||||
|
try {
|
||||||
|
IPathEntry[] entries = cModelElement.getResolvedPathEntries();
|
||||||
|
for (int index = 0; index < entries.length; ++index) {
|
||||||
|
int kind = entries[index].getEntryKind();
|
||||||
|
if (kind == IPathEntry.CDT_INCLUDE) {
|
||||||
|
IIncludeEntry include = (IIncludeEntry) entries[index];
|
||||||
|
if (include.isSystemInclude()) {
|
||||||
|
IPath entryPath = include.getFullIncludePath();
|
||||||
|
paths.add(entryPath.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (CModelException e) {
|
||||||
|
// Just return an empty array
|
||||||
|
paths.clear();
|
||||||
|
return paths;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return paths;
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IScannerInfo#getIncludePaths()
|
* @see org.eclipse.cdt.core.build.managed.IScannerInfo#getIncludePaths()
|
||||||
*/
|
*/
|
||||||
public String[] getIncludePaths() {
|
public String[] getIncludePaths() {
|
||||||
IProject project = (IProject)owner;
|
|
||||||
|
|
||||||
// Return the include paths for the default configuration
|
// Return the include paths for the default configuration
|
||||||
ArrayList paths = new ArrayList();
|
ArrayList paths = getIncludePathEntries();
|
||||||
IConfiguration config = getDefaultConfiguration(getDefaultTarget());
|
IConfiguration config = getDefaultConfiguration(getDefaultTarget());
|
||||||
IPath location = owner.getLocation();
|
IPath location = owner.getLocation();
|
||||||
// If the build info is out of date this might be null
|
// If the build info is out of date this might be null
|
||||||
|
@ -441,36 +475,15 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
location = new Path("."); //$NON-NLS-1$
|
location = new Path("."); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
IPath root = location.addTrailingSeparator().append(config.getName());
|
IPath root = location.addTrailingSeparator().append(config.getName());
|
||||||
ITool[] tools = config.getTools();
|
ITool[] tools = config.getFilteredTools(owner.getProject());
|
||||||
for (int i = 0; i < tools.length; i++) {
|
for (int i = 0; i < tools.length; i++) {
|
||||||
ITool tool = tools[i];
|
ITool tool = tools[i];
|
||||||
try {
|
|
||||||
// Make sure the tool is right for the project
|
|
||||||
switch (tool.getNatureFilter()) {
|
|
||||||
case ITool.FILTER_C:
|
|
||||||
if (!project.hasNature(CProjectNature.C_NATURE_ID) || project.hasNature(CCProjectNature.CC_NATURE_ID)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case ITool.FILTER_CC:
|
|
||||||
if (!project.hasNature(CCProjectNature.CC_NATURE_ID)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case ITool.FILTER_BOTH:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} catch (CoreException e) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// The tool checks out for this project, get its options
|
// The tool checks out for this project, get its options
|
||||||
IOption[] opts = tool.getOptions();
|
IOption[] opts = tool.getOptions();
|
||||||
for (int j = 0; j < opts.length; j++) {
|
for (int j = 0; j < opts.length; j++) {
|
||||||
IOption option = opts[j];
|
IOption option = opts[j];
|
||||||
if (option.getValueType() == IOption.INCLUDE_PATH) {
|
if (option.getValueType() == IOption.INCLUDE_PATH) {
|
||||||
try {
|
try {
|
||||||
// Get all the built-in paths from the option
|
|
||||||
paths.addAll(getCompilerPaths(option));
|
|
||||||
// Get all the user-defined paths from the option as absolute paths
|
// Get all the user-defined paths from the option as absolute paths
|
||||||
String[] userPaths = option.getIncludePaths();
|
String[] userPaths = option.getIncludePaths();
|
||||||
for (int index = 0; index < userPaths.length; ++index) {
|
for (int index = 0; index < userPaths.length; ++index) {
|
||||||
|
@ -489,41 +502,30 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
paths.trimToSize();
|
|
||||||
|
// Answer the results as an array
|
||||||
return (String[])paths.toArray(new String[paths.size()]);
|
return (String[])paths.toArray(new String[paths.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private HashMap getMacroPathEntries() {
|
||||||
* @param owner2
|
HashMap macros = new HashMap();
|
||||||
* @return
|
if (cModelElement != null) {
|
||||||
*/
|
|
||||||
private List getCompilerPaths(IOption option) {
|
|
||||||
// Extract the resolved paths from the project (if any)
|
|
||||||
ArrayList paths = new ArrayList();
|
|
||||||
ICProject project = CoreModel.getDefault().create(owner.getProject());
|
|
||||||
if (project != null) {
|
|
||||||
try {
|
try {
|
||||||
IPathEntry[] entries = project.getResolvedPathEntries();
|
IPathEntry[] entries = cModelElement.getResolvedPathEntries();
|
||||||
for (int index = entries.length - 1; index >=0; --index) {
|
for (int index = 0; index < entries.length; ++index) {
|
||||||
int kind = entries[index].getEntryKind();
|
if (entries[index].getEntryKind() == IPathEntry.CDT_MACRO) {
|
||||||
if (kind == IPathEntry.CDT_INCLUDE) {
|
IMacroEntry macro = (IMacroEntry) entries[index];
|
||||||
IIncludeEntry include = (IIncludeEntry) entries[index];
|
macros.put(macro.getMacroName(), macro.getMacroValue());
|
||||||
if (include.isSystemInclude()) {
|
|
||||||
IPath entryPath = include.getPath();
|
|
||||||
paths.add(entryPath.toString());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (CModelException e) {
|
} catch (CModelException e) {
|
||||||
// See if there are any built-ins from the tool definition
|
// return an empty map
|
||||||
return Arrays.asList(option.getBuiltIns());
|
macros.clear();
|
||||||
|
return macros;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// if (paths.size() == 0) {
|
return macros;
|
||||||
return Arrays.asList(option.getBuiltIns());
|
|
||||||
// } else {
|
|
||||||
// return paths;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -975,6 +977,19 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private void initializePathEntries() {
|
||||||
|
try {
|
||||||
|
IPathEntryContainer container = new ManagedBuildCPathEntryContainer(this);
|
||||||
|
CoreModel.getDefault().setPathEntryContainer(new ICProject[]{cModelElement}, container, new NullProgressMonitor());
|
||||||
|
} catch (CModelException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#removeTarget(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#removeTarget(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@ -1045,6 +1060,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
defaultTarget = target;
|
defaultTarget = target;
|
||||||
defaultTargetId = target.getId();
|
defaultTargetId = target.getId();
|
||||||
persistDefaultTarget();
|
persistDefaultTarget();
|
||||||
|
initializePathEntries();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1103,6 +1119,18 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
ITarget target = (ITarget) iter.next();
|
ITarget target = (ITarget) iter.next();
|
||||||
target.updateOwner(resource);
|
target.updateOwner(resource);
|
||||||
}
|
}
|
||||||
|
// And finally update the cModelElement
|
||||||
|
cModelElement = CoreModel.getDefault().create(owner.getProject());
|
||||||
|
try {
|
||||||
|
CoreModel.getDefault().setRawPathEntries(cModelElement, new IPathEntry[]{containerEntry}, new NullProgressMonitor());
|
||||||
|
} catch (CModelException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
initializePathEntries();
|
||||||
|
|
||||||
|
// Save everything
|
||||||
|
setDirty(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,64 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2004 IBM Corporation and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* IBM - Initial API and implementation
|
||||||
|
**********************************************************************/
|
||||||
|
package org.eclipse.cdt.managedbuilder.internal.scannerconfig;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.make.internal.core.scannerconfig.util.CygpathTranslator;
|
||||||
|
import org.eclipse.core.resources.IResource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implementation class for gathering the built-in compiler settings for
|
||||||
|
* Cygwin-based targets.
|
||||||
|
*
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
|
public class DefaultCygwinScannerInfoCollector extends DefaultGCCScannerInfoCollector {
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector#contributeToScannerConfig(org.eclipse.core.resources.IResource, java.util.List, java.util.List, java.util.List)
|
||||||
|
*/
|
||||||
|
public void contributeToScannerConfig(IResource resource, List includes,
|
||||||
|
List symbols, List targetSpecificOptions) {
|
||||||
|
// This method will be called by the parser each time there is a new value
|
||||||
|
Iterator pathIter = includes.listIterator();
|
||||||
|
while (pathIter.hasNext()) {
|
||||||
|
String path = (String) pathIter.next();
|
||||||
|
String convertedPath = convertPath(path);
|
||||||
|
getIncludePaths().add(convertedPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now add the macros
|
||||||
|
Iterator symbolIter = symbols.listIterator();
|
||||||
|
while (symbolIter.hasNext()) {
|
||||||
|
// See if it has an equals
|
||||||
|
String[] macroTokens = ((String)symbolIter.next()).split(EQUALS);
|
||||||
|
String macro = macroTokens[0].trim();
|
||||||
|
String value = (macroTokens.length > 1) ? macroTokens[1].trim() : new String();
|
||||||
|
getDefinedSymbols().put(macro, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* Converts the argument from a POSIX-style path to a valid Win32 path.
|
||||||
|
* If the string is already in the proper format it will not be changed.
|
||||||
|
*
|
||||||
|
* @param path <code>String</code> containing path to convert
|
||||||
|
* @return <code>String</code> containing the converted path
|
||||||
|
*/
|
||||||
|
private String convertPath(String includePath) {
|
||||||
|
// Convert a POSIX-style path to Win32
|
||||||
|
String translatedPath = new CygpathTranslator(project, includePath).run();
|
||||||
|
return translatedPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,95 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2004 IBM Corporation and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* IBM - Initial API and implementation
|
||||||
|
**********************************************************************/
|
||||||
|
package org.eclipse.cdt.managedbuilder.internal.scannerconfig;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector;
|
||||||
|
import org.eclipse.core.resources.IProject;
|
||||||
|
import org.eclipse.core.resources.IResource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implementation class for gathering the built-in compiler settings for
|
||||||
|
* GCC-based targets. The assumption is that the tools will answer path
|
||||||
|
* information in POSIX format and that the Scanner will be able to search for
|
||||||
|
* files using this format.
|
||||||
|
*
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
|
public class DefaultGCCScannerInfoCollector implements IManagedScannerInfoCollector {
|
||||||
|
protected Map definedSymbols;
|
||||||
|
protected static final String EQUALS = "="; //$NON-NLS-1$
|
||||||
|
protected List includePaths;
|
||||||
|
protected IProject project;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public DefaultGCCScannerInfoCollector() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector#contributeToScannerConfig(org.eclipse.core.resources.IResource, java.util.List, java.util.List, java.util.List)
|
||||||
|
*/
|
||||||
|
public void contributeToScannerConfig(IResource resource, List includes,
|
||||||
|
List symbols, List targetSpecificOptions) {
|
||||||
|
|
||||||
|
// This method will be called by the parser each time there is a new value
|
||||||
|
Iterator pathIter = includes.listIterator();
|
||||||
|
while (pathIter.hasNext()) {
|
||||||
|
String path = (String) pathIter.next();
|
||||||
|
getIncludePaths().add(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now add the macros
|
||||||
|
Iterator symbolIter = symbols.listIterator();
|
||||||
|
while (symbolIter.hasNext()) {
|
||||||
|
// See if it has an equals
|
||||||
|
String[] macroTokens = ((String)symbolIter.next()).split(EQUALS);
|
||||||
|
String macro = macroTokens[0].trim();
|
||||||
|
String value = (macroTokens.length > 1) ? macroTokens[1].trim() : new String();
|
||||||
|
getDefinedSymbols().put(macro, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.core.parser.IScannerInfo#getDefinedSymbols()
|
||||||
|
*/
|
||||||
|
public Map getDefinedSymbols() {
|
||||||
|
if (definedSymbols == null) {
|
||||||
|
definedSymbols = new HashMap();
|
||||||
|
}
|
||||||
|
return definedSymbols;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector#getIncludePaths()
|
||||||
|
*/
|
||||||
|
public List getIncludePaths() {
|
||||||
|
if (includePaths == null) {
|
||||||
|
includePaths = new ArrayList();
|
||||||
|
}
|
||||||
|
return includePaths;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector#setProject(org.eclipse.core.resources.IProject)
|
||||||
|
*/
|
||||||
|
public void setProject(IProject project) {
|
||||||
|
this.project = project;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,70 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2004 IBM Corporation and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* IBM - Initial API and implementation
|
||||||
|
**********************************************************************/
|
||||||
|
package org.eclipse.cdt.managedbuilder.internal.scannerconfig;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.eclipse.core.resources.IResource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implementation class for gathering the built-in compiler settings for
|
||||||
|
* MinGw-based targets. The paths are collected only in Win32 format.
|
||||||
|
*
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
|
public class DefaultMinGWScannerInfoCollector extends DefaultGCCScannerInfoCollector {
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector#contributeToScannerConfig(org.eclipse.core.resources.IResource, java.util.List, java.util.List, java.util.List)
|
||||||
|
*/
|
||||||
|
public void contributeToScannerConfig(IResource resource, List includes,
|
||||||
|
List symbols, List targetSpecificOptions) {
|
||||||
|
// This method will be called by the parser each time there is a new value
|
||||||
|
Iterator pathIter = includes.listIterator();
|
||||||
|
while (pathIter.hasNext()) {
|
||||||
|
String path = (String) pathIter.next();
|
||||||
|
if (!filterPath(path)) {
|
||||||
|
getIncludePaths().add(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now add the macros
|
||||||
|
Iterator symbolIter = symbols.listIterator();
|
||||||
|
while (symbolIter.hasNext()) {
|
||||||
|
// See if it has an equals
|
||||||
|
String[] macroTokens = ((String)symbolIter.next()).split(EQUALS);
|
||||||
|
String macro = macroTokens[0].trim();
|
||||||
|
String value = (macroTokens.length > 1) ? macroTokens[1].trim() : new String();
|
||||||
|
getDefinedSymbols().put(macro, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @param path
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private boolean filterPath(String includePath) {
|
||||||
|
// MinGW's compiler will return paths in both POSIX and Win32 format
|
||||||
|
// We only want to store the Win32 variant like:
|
||||||
|
// <drive_letter>:<path>
|
||||||
|
// \\<unc_path>
|
||||||
|
int firstColon = includePath.indexOf(':'); //$NON-NLS-1$
|
||||||
|
if (firstColon == 1 && Character.isLetter(includePath.charAt(0))) {
|
||||||
|
// <drive>:<path> is OK
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,242 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) Apr 21, 2004 IBM Corporation and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* IBM - Initial API and implementation
|
||||||
|
**********************************************************************/
|
||||||
|
|
||||||
|
package org.eclipse.cdt.managedbuilder.internal.scannerconfig;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.Vector;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.model.CoreModel;
|
||||||
|
import org.eclipse.cdt.core.model.IIncludeEntry;
|
||||||
|
import org.eclipse.cdt.core.model.IMacroEntry;
|
||||||
|
import org.eclipse.cdt.core.model.IPathEntry;
|
||||||
|
import org.eclipse.cdt.core.model.IPathEntryContainer;
|
||||||
|
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
||||||
|
import org.eclipse.cdt.make.core.scannerconfig.IExternalScannerInfoProvider;
|
||||||
|
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo;
|
||||||
|
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.IOption;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.ITarget;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.ITool;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
|
||||||
|
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
|
||||||
|
import org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector;
|
||||||
|
import org.eclipse.core.resources.IProject;
|
||||||
|
import org.eclipse.core.runtime.IPath;
|
||||||
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
|
import org.eclipse.core.runtime.ISafeRunnable;
|
||||||
|
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
|
import org.eclipse.core.runtime.OperationCanceledException;
|
||||||
|
import org.eclipse.core.runtime.Path;
|
||||||
|
import org.eclipse.core.runtime.Platform;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implements a specialized path container for managed build projects. It will
|
||||||
|
* either start the dynamic path collector specified for a target in the tool
|
||||||
|
* manifest, or it will attempt to discover the built-in values specified in
|
||||||
|
* the manifest.
|
||||||
|
*
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
|
public class ManagedBuildCPathEntryContainer implements IPathEntryContainer {
|
||||||
|
|
||||||
|
private static final String BUILDER_ID = MakeCorePlugin.getUniqueIdentifier() + ".ScannerConfigBuilder"; //$NON-NLS-1$
|
||||||
|
private ITarget defaultTarget;
|
||||||
|
private Vector entries;
|
||||||
|
private ManagedBuildInfo info;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new path container for the managed buildd project.
|
||||||
|
*
|
||||||
|
* @param info the build information associated with the project
|
||||||
|
*/
|
||||||
|
public ManagedBuildCPathEntryContainer(ManagedBuildInfo info) {
|
||||||
|
super();
|
||||||
|
this.info = info;
|
||||||
|
defaultTarget = info.getDefaultTarget();
|
||||||
|
entries = new Vector();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addDefinedSymbols(Map definedSymbols) {
|
||||||
|
// Add a new macro entry for each defined symbol
|
||||||
|
Set macros = definedSymbols.keySet();
|
||||||
|
Iterator keyIter = macros.iterator();
|
||||||
|
while (keyIter.hasNext()) {
|
||||||
|
boolean add = true;
|
||||||
|
String macro = (String) keyIter.next();
|
||||||
|
String value = (String) definedSymbols.get(macro);
|
||||||
|
// Make sure the current entries do not contain a duplicate
|
||||||
|
Iterator entryIter = entries.listIterator();
|
||||||
|
while (entryIter.hasNext()) {
|
||||||
|
IPathEntry entry = (IPathEntry) entryIter.next();
|
||||||
|
if (entry.getEntryKind() == IPathEntry.CDT_MACRO) {
|
||||||
|
if (((IMacroEntry)entry).getMacroName().equals(macro) &&
|
||||||
|
((IMacroEntry)entry).getMacroValue().equals(value)) {
|
||||||
|
add = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (add) {
|
||||||
|
entries.add(CoreModel.newMacroEntry(new Path(""), macro, value)); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addIncludePaths(List paths) {
|
||||||
|
// A little checking is needed to avoid adding duplicates
|
||||||
|
Iterator pathIter = paths.listIterator();
|
||||||
|
while (pathIter.hasNext()) {
|
||||||
|
boolean add = true;
|
||||||
|
String path = (String) pathIter.next();
|
||||||
|
// Make sure there is no other path with the same value
|
||||||
|
Iterator entryIter = entries.listIterator();
|
||||||
|
while (entryIter.hasNext()) {
|
||||||
|
IPathEntry entry = (IPathEntry) entryIter.next();
|
||||||
|
if (entry.getEntryKind() == IPathEntry.CDT_INCLUDE) {
|
||||||
|
if (((IIncludeEntry)entry).getFullIncludePath().equals(path)) {
|
||||||
|
add = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (add) {
|
||||||
|
entries.add(CoreModel.newIncludeEntry(new Path(""), null, new Path(path), true)); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void calculateBuiltIns(ITarget defaultTarget, IConfiguration config) {
|
||||||
|
ITool[] tools = config.getFilteredTools(info.getOwner().getProject());
|
||||||
|
|
||||||
|
// Iterate over the list
|
||||||
|
for (int toolIndex = 0; toolIndex < tools.length; ++toolIndex) {
|
||||||
|
ITool tool = tools[toolIndex];
|
||||||
|
// Check its options
|
||||||
|
IOption[] options = tool.getOptions();
|
||||||
|
for (int optIndex = 0; optIndex < options.length; ++optIndex) {
|
||||||
|
IOption option = options[optIndex];
|
||||||
|
if (option.getValueType() == IOption.PREPROCESSOR_SYMBOLS) {
|
||||||
|
String[] builtIns = option.getBuiltIns();
|
||||||
|
Map macroMap = new HashMap();
|
||||||
|
for (int biIndex = 0; biIndex < builtIns.length; ++biIndex) {
|
||||||
|
String symbol = builtIns[biIndex];
|
||||||
|
String[] tokens = symbol.split("="); //$NON-NLS-1$
|
||||||
|
String macro = tokens[0].trim();
|
||||||
|
String value = (tokens.length > 1) ? tokens[1] : new String();
|
||||||
|
macroMap.put(macro, value);
|
||||||
|
}
|
||||||
|
addDefinedSymbols(macroMap);
|
||||||
|
} else if (option.getValueType() == IOption.INCLUDE_PATH) {
|
||||||
|
// Make sure it is a built-in, not a user-defined path
|
||||||
|
String[] values = option.getBuiltIns();
|
||||||
|
if (values.length > 0) {
|
||||||
|
addIncludePaths(Arrays.asList(values));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void calculateEntriesDynamically(final IProject project, final IScannerInfoCollector collector) {
|
||||||
|
final IScannerConfigBuilderInfo buildInfo;
|
||||||
|
buildInfo = MakeCorePlugin.createScannerConfigBuildInfo(
|
||||||
|
MakeCorePlugin.getDefault().getPluginPreferences(),
|
||||||
|
BUILDER_ID,
|
||||||
|
false);
|
||||||
|
|
||||||
|
// TODO Get the provider from the toolchain specification
|
||||||
|
final IExternalScannerInfoProvider esiProvider;
|
||||||
|
esiProvider = MakeCorePlugin.getDefault().getExternalScannerInfoProvider(MakeCorePlugin.DEFAULT_EXTERNAL_SI_PROVIDER_ID);
|
||||||
|
|
||||||
|
// Set the arguments for the provider
|
||||||
|
Vector compilerArgs = new Vector();
|
||||||
|
String args = buildInfo.getESIProviderArguments();
|
||||||
|
IPath command = buildInfo.getESIProviderCommand();
|
||||||
|
final Vector buildArgs = compilerArgs;
|
||||||
|
|
||||||
|
ISafeRunnable runnable = new ISafeRunnable() {
|
||||||
|
public void run() {
|
||||||
|
IProgressMonitor monitor = new NullProgressMonitor();
|
||||||
|
esiProvider.invokeProvider(monitor, project, buildInfo, buildArgs, collector);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void handleException(Throwable exception) {
|
||||||
|
if (exception instanceof OperationCanceledException) {
|
||||||
|
throw (OperationCanceledException) exception;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Platform.run(runnable);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.core.model.IPathEntryContainer#getPathEntries()
|
||||||
|
*/
|
||||||
|
public synchronized IPathEntry[] getPathEntries() {
|
||||||
|
// TODO figure out when I can skip this step
|
||||||
|
if (entries.isEmpty()) {
|
||||||
|
// Load the toolchain-spec'd collector
|
||||||
|
defaultTarget = info.getDefaultTarget();
|
||||||
|
if (defaultTarget == null) {
|
||||||
|
// The build information has not been loaded yet
|
||||||
|
return (IPathEntry[])entries.toArray(new IPathEntry[entries.size()]);
|
||||||
|
}
|
||||||
|
ITarget parent = defaultTarget.getParent();
|
||||||
|
if (parent == null) {
|
||||||
|
// The build information has not been loaded yet
|
||||||
|
return (IPathEntry[])entries.toArray(new IPathEntry[entries.size()]);
|
||||||
|
}
|
||||||
|
// See if we can load a dynamic resolver
|
||||||
|
String baseTargetId = parent.getId();
|
||||||
|
IManagedScannerInfoCollector collector = ManagedBuilderCorePlugin.getDefault().getScannerInfoCollector(baseTargetId);
|
||||||
|
if (collector != null) {
|
||||||
|
collector.setProject(info.getOwner().getProject());
|
||||||
|
calculateEntriesDynamically((IProject)info.getOwner(), collector);
|
||||||
|
addIncludePaths(collector.getIncludePaths());
|
||||||
|
addDefinedSymbols(collector.getDefinedSymbols());
|
||||||
|
} else {
|
||||||
|
// If none supplied, use the built-ins
|
||||||
|
IConfiguration config = info.getDefaultConfiguration(defaultTarget);
|
||||||
|
if (config != null) {
|
||||||
|
calculateBuiltIns(defaultTarget, config);
|
||||||
|
} else {
|
||||||
|
return (IPathEntry[])entries.toArray(new IPathEntry[entries.size()]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (IPathEntry[])entries.toArray(new IPathEntry[entries.size()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.core.model.IPathEntryContainer#getDescription()
|
||||||
|
*/
|
||||||
|
public String getDescription() {
|
||||||
|
return "CDT Managed Build Project"; //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.core.model.IPathEntryContainer#getPath()
|
||||||
|
*/
|
||||||
|
public IPath getPath() {
|
||||||
|
return new Path("org.eclipse.cdt.managedbuilder.MANAGED_CONTAINER"); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,52 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2004 IBM Corporation and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* IBM - Initial API and implementation
|
||||||
|
**********************************************************************/
|
||||||
|
package org.eclipse.cdt.managedbuilder.scannerconfig;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
|
||||||
|
import org.eclipse.core.resources.IProject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface that a colelctor of compiler information must implement.
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
|
public interface IManagedScannerInfoCollector extends IScannerInfoCollector {
|
||||||
|
/**
|
||||||
|
* Answers a map of collected defines that the the compiler uses by default.
|
||||||
|
* The symbols are defined in the map as a (macro, value) pair as follows
|
||||||
|
* <p><p><code>-DFOO</code> will be stored as ("FOO","")
|
||||||
|
* <p><code>-DFOO=BAR</code> will be stored as ("FOO","BAR")
|
||||||
|
* <p><p>Duplicates will not be stored in the map and any whitespaces in
|
||||||
|
* the macro or value will be trimmed out.
|
||||||
|
*
|
||||||
|
* @return a <code>Map</code> of defined symbols and values
|
||||||
|
*/
|
||||||
|
public Map getDefinedSymbols();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Answers a <code>List</code> of unique built-in includes paths that have been
|
||||||
|
* collected for the receiver. The paths are stored as <code>String</code> in the proper
|
||||||
|
* format for the host tools.
|
||||||
|
*
|
||||||
|
* @return a <code>List</code> of built-in compiler include search paths.
|
||||||
|
*/
|
||||||
|
public List getIncludePaths();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the <code>IProject</code> for the receiver.
|
||||||
|
*
|
||||||
|
* @param project
|
||||||
|
*/
|
||||||
|
public void setProject(IProject project);
|
||||||
|
}
|
|
@ -1,78 +0,0 @@
|
||||||
/**********************************************************************
|
|
||||||
* Copyright (c) Apr 21, 2004 IBM Corporation and others.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Common Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/cpl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* IBM - Initial API and implementation
|
|
||||||
**********************************************************************/
|
|
||||||
|
|
||||||
package org.eclipse.cdt.managedbuilder.scannerconfig;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.core.model.CoreModel;
|
|
||||||
import org.eclipse.cdt.core.model.IPathEntry;
|
|
||||||
import org.eclipse.cdt.core.model.IPathEntryContainer;
|
|
||||||
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
|
|
||||||
import org.eclipse.core.runtime.IPath;
|
|
||||||
import org.eclipse.core.runtime.Path;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class ManagedBuildCPathEntryContainer implements IPathEntryContainer {
|
|
||||||
|
|
||||||
private ManagedBuildInfo info;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public ManagedBuildCPathEntryContainer(ManagedBuildInfo info) {
|
|
||||||
super();
|
|
||||||
this.info = info;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.model.IPathEntryContainer#getPathEntries()
|
|
||||||
*/
|
|
||||||
public IPathEntry[] getPathEntries() {
|
|
||||||
// Resolve the symbols and paths for the project
|
|
||||||
IPath resourcePath = info.getOwner().getProjectRelativePath();
|
|
||||||
|
|
||||||
ArrayList entries = new ArrayList();
|
|
||||||
entries.add(CoreModel.newIncludeEntry(resourcePath, null, new Path("/usr/include/c++"), true));
|
|
||||||
entries.add(CoreModel.newIncludeEntry(resourcePath, null, new Path("/usr/include/c++/i686-pc-cygwin"), true));
|
|
||||||
entries.add(CoreModel.newIncludeEntry(resourcePath, null, new Path("/usr/include/c++/backward"), true));
|
|
||||||
entries.add(CoreModel.newIncludeEntry(resourcePath, null, new Path("/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/include"), true));
|
|
||||||
entries.add(CoreModel.newIncludeEntry(resourcePath, null, new Path("/usr/include"), true));
|
|
||||||
entries.add(CoreModel.newIncludeEntry(resourcePath, null, new Path("/usr/include/api"), true));
|
|
||||||
|
|
||||||
entries.add(CoreModel.newMacroEntry(resourcePath, "__GNUC__", "3"));
|
|
||||||
entries.add(CoreModel.newMacroEntry(resourcePath, "__GNUC_MINOR__", "3"));
|
|
||||||
entries.add(CoreModel.newMacroEntry(resourcePath, "__GNUC_PATCHLEVEL__", "1"));
|
|
||||||
entries.add(CoreModel.newMacroEntry(resourcePath, "__CYGWIN32__", ""));
|
|
||||||
entries.add(CoreModel.newMacroEntry(resourcePath, "__CYGWIN__", ""));
|
|
||||||
entries.add(CoreModel.newMacroEntry(resourcePath, "unix", ""));
|
|
||||||
entries.add(CoreModel.newMacroEntry(resourcePath, "__unix__", ""));
|
|
||||||
entries.add(CoreModel.newMacroEntry(resourcePath, "unix__", ""));
|
|
||||||
return (IPathEntry[])entries.toArray(new IPathEntry[entries.size()]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.model.IPathEntryContainer#getDescription()
|
|
||||||
*/
|
|
||||||
public String getDescription() {
|
|
||||||
return "CDT Managed Build Project"; //$NON-NLS-1$
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.model.IPathEntryContainer#getPath()
|
|
||||||
*/
|
|
||||||
public IPath getPath() {
|
|
||||||
return new Path("org.eclipse.cdt.managedbuilder.MANAGED_CONTAINER"); //$NON-NLS-1$
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -31,8 +31,8 @@
|
||||||
icon="icons/full/wizban/newmngcc_app.gif"
|
icon="icons/full/wizban/newmngcc_app.gif"
|
||||||
category="org.eclipse.cdt.ui.newCCWizards"
|
category="org.eclipse.cdt.ui.newCCWizards"
|
||||||
class="org.eclipse.cdt.managedbuilder.ui.wizards.NewManagedCCProjectWizard"
|
class="org.eclipse.cdt.managedbuilder.ui.wizards.NewManagedCCProjectWizard"
|
||||||
project="true"
|
|
||||||
finalPerspective="org.eclipse.cdt.ui.CPerspective"
|
finalPerspective="org.eclipse.cdt.ui.CPerspective"
|
||||||
|
project="true"
|
||||||
id="org.eclipse.cdt.managedbuilder.ui.wizards.StdCCWizard">
|
id="org.eclipse.cdt.managedbuilder.ui.wizards.StdCCWizard">
|
||||||
<description>
|
<description>
|
||||||
%MngCCWizard.description
|
%MngCCWizard.description
|
||||||
|
@ -43,8 +43,8 @@
|
||||||
icon="icons/full/wizban/newmngc_app.gif"
|
icon="icons/full/wizban/newmngc_app.gif"
|
||||||
category="org.eclipse.cdt.ui.newCWizards"
|
category="org.eclipse.cdt.ui.newCWizards"
|
||||||
class="org.eclipse.cdt.managedbuilder.ui.wizards.NewManagedCProjectWizard"
|
class="org.eclipse.cdt.managedbuilder.ui.wizards.NewManagedCProjectWizard"
|
||||||
project="true"
|
|
||||||
finalPerspective="org.eclipse.cdt.ui.CPerspective"
|
finalPerspective="org.eclipse.cdt.ui.CPerspective"
|
||||||
|
project="true"
|
||||||
id="org.eclipse.cdt.managedbuilder.ui.wizards.StdCWizard">
|
id="org.eclipse.cdt.managedbuilder.ui.wizards.StdCWizard">
|
||||||
<description>
|
<description>
|
||||||
%MngCWizard.description
|
%MngCWizard.description
|
||||||
|
@ -54,8 +54,8 @@
|
||||||
<extension
|
<extension
|
||||||
point="org.eclipse.ui.propertyPages">
|
point="org.eclipse.ui.propertyPages">
|
||||||
<page
|
<page
|
||||||
objectClass="org.eclipse.core.resources.IProject"
|
|
||||||
adaptable="true"
|
adaptable="true"
|
||||||
|
objectClass="org.eclipse.core.resources.IProject"
|
||||||
name="%MngBuildProp.name"
|
name="%MngBuildProp.name"
|
||||||
class="org.eclipse.cdt.managedbuilder.ui.properties.BuildPropertyPage"
|
class="org.eclipse.cdt.managedbuilder.ui.properties.BuildPropertyPage"
|
||||||
id="org.eclipse.cdt.managedbuilder.ui.properties.BuildProperties">
|
id="org.eclipse.cdt.managedbuilder.ui.properties.BuildProperties">
|
||||||
|
@ -68,8 +68,8 @@
|
||||||
<extension
|
<extension
|
||||||
point="org.eclipse.ui.propertyPages">
|
point="org.eclipse.ui.propertyPages">
|
||||||
<page
|
<page
|
||||||
objectClass="org.eclipse.core.resources.IProject"
|
|
||||||
adaptable="true"
|
adaptable="true"
|
||||||
|
objectClass="org.eclipse.core.resources.IProject"
|
||||||
name="%MngOtherProp.name"
|
name="%MngOtherProp.name"
|
||||||
class="org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderPropertyPage"
|
class="org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderPropertyPage"
|
||||||
id="org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderProperties">
|
id="org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderProperties">
|
||||||
|
@ -95,8 +95,8 @@
|
||||||
</managedBuildRevision>
|
</managedBuildRevision>
|
||||||
<tool
|
<tool
|
||||||
natureFilter="cnature"
|
natureFilter="cnature"
|
||||||
sources="o"
|
|
||||||
name="%ToolName.linker.gnu.c"
|
name="%ToolName.linker.gnu.c"
|
||||||
|
sources="o"
|
||||||
outputFlag="-o"
|
outputFlag="-o"
|
||||||
command="gcc"
|
command="gcc"
|
||||||
id="cdt.managedbuild.tool.gnu.c.linker">
|
id="cdt.managedbuild.tool.gnu.c.linker">
|
||||||
|
@ -110,40 +110,40 @@
|
||||||
name="%Option.Posix.Linker.NoStartFiles"
|
name="%Option.Posix.Linker.NoStartFiles"
|
||||||
category="gnu.c.link.category.general"
|
category="gnu.c.link.category.general"
|
||||||
command="-nostartfiles"
|
command="-nostartfiles"
|
||||||
id="gnu.c.link.option.nostart"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.c.link.option.nostart">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.Linker.NoDefLibs"
|
name="%Option.Posix.Linker.NoDefLibs"
|
||||||
category="gnu.c.link.category.general"
|
category="gnu.c.link.category.general"
|
||||||
command="-nodefaultlibs"
|
command="-nodefaultlibs"
|
||||||
id="gnu.c.link.option.nodeflibs"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.c.link.option.nodeflibs">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.Linker.NoStdLibs"
|
name="%Option.Posix.Linker.NoStdLibs"
|
||||||
category="gnu.c.link.category.general"
|
category="gnu.c.link.category.general"
|
||||||
command="-nostdlib"
|
command="-nostdlib"
|
||||||
id="gnu.c.link.option.nostdlibs"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.c.link.option.nostdlibs">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.Linker.Strip"
|
name="%Option.Posix.Linker.Strip"
|
||||||
category="gnu.c.link.category.general"
|
category="gnu.c.link.category.general"
|
||||||
command="-s"
|
command="-s"
|
||||||
id="gnu.c.link.option.strip"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.c.link.option.strip">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.Linker.Static"
|
name="%Option.Posix.Linker.Static"
|
||||||
category="gnu.c.link.category.general"
|
category="gnu.c.link.category.general"
|
||||||
command="-static"
|
command="-static"
|
||||||
id="gnu.c.link.option.noshared"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.c.link.option.noshared">
|
||||||
</option>
|
</option>
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="cdt.managedbuild.tool.gnu.c.linker"
|
owner="cdt.managedbuild.tool.gnu.c.linker"
|
||||||
|
@ -154,17 +154,17 @@
|
||||||
name="%Option.Posix.Libs"
|
name="%Option.Posix.Libs"
|
||||||
category="gnu.c.link.category.libs"
|
category="gnu.c.link.category.libs"
|
||||||
command="-l"
|
command="-l"
|
||||||
id="gnu.c.link.option.libs"
|
valueType="libs"
|
||||||
browseType="file"
|
browseType="file"
|
||||||
valueType="libs">
|
id="gnu.c.link.option.libs">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.Libsearch"
|
name="%Option.Posix.Libsearch"
|
||||||
category="gnu.c.link.category.libs"
|
category="gnu.c.link.category.libs"
|
||||||
command="-L"
|
command="-L"
|
||||||
id="gnu.c.link.option.paths"
|
valueType="stringList"
|
||||||
browseType="directory"
|
browseType="directory"
|
||||||
valueType="stringList">
|
id="gnu.c.link.option.paths">
|
||||||
</option>
|
</option>
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="cdt.managedbuild.tool.gnu.c.linker"
|
owner="cdt.managedbuild.tool.gnu.c.linker"
|
||||||
|
@ -174,22 +174,22 @@
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.Linker.Flags"
|
name="%Option.Posix.Linker.Flags"
|
||||||
category="gnu.c.link.category.other"
|
category="gnu.c.link.category.other"
|
||||||
valueType="string"
|
id="gnu.c.link.option.ldflags"
|
||||||
id="gnu.c.link.option.ldflags">
|
valueType="string">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.Linker.XLinker"
|
name="%Option.Posix.Linker.XLinker"
|
||||||
category="gnu.c.link.category.other"
|
category="gnu.c.link.category.other"
|
||||||
command="-Xlinker"
|
command="-Xlinker"
|
||||||
valueType="stringList"
|
id="gnu.c.link.option.other"
|
||||||
id="gnu.c.link.option.other">
|
valueType="stringList">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.UserObjs"
|
name="%Option.Posix.UserObjs"
|
||||||
category="gnu.c.link.category.other"
|
category="gnu.c.link.category.other"
|
||||||
browseType="file"
|
id="gnu.c.link.option.userobjs"
|
||||||
valueType="userObjs"
|
valueType="userObjs"
|
||||||
id="gnu.c.link.option.userobjs">
|
browseType="file">
|
||||||
</option>
|
</option>
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="cdt.managedbuild.tool.gnu.c.linker"
|
owner="cdt.managedbuild.tool.gnu.c.linker"
|
||||||
|
@ -201,35 +201,35 @@
|
||||||
name="%Option.Posix.Linker.Shared"
|
name="%Option.Posix.Linker.Shared"
|
||||||
category="gnu.c.link.category.shared"
|
category="gnu.c.link.category.shared"
|
||||||
command="-shared"
|
command="-shared"
|
||||||
id="gnu.c.link.option.shared"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.c.link.option.shared">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.Linker.SOName"
|
name="%Option.Posix.Linker.SOName"
|
||||||
category="gnu.c.link.category.shared"
|
category="gnu.c.link.category.shared"
|
||||||
command="-Wl,-soname,"
|
command="-Wl,-soname,"
|
||||||
id="gnu.c.link.option.soname"
|
valueType="string"
|
||||||
valueType="string">
|
id="gnu.c.link.option.soname">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.Linker.Implib"
|
name="%Option.Posix.Linker.Implib"
|
||||||
category="gnu.c.link.category.shared"
|
category="gnu.c.link.category.shared"
|
||||||
command="-Wl,--out-implib,"
|
command="-Wl,--out-implib,"
|
||||||
id="gnu.c.link.option.implname"
|
valueType="string"
|
||||||
valueType="string">
|
id="gnu.c.link.option.implname">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.Linker.Defname"
|
name="%Option.Posix.Linker.Defname"
|
||||||
category="gnu.c.link.category.shared"
|
category="gnu.c.link.category.shared"
|
||||||
command="-Wl,--output-def,"
|
command="-Wl,--output-def,"
|
||||||
id="gnu.c.link.option.defname"
|
valueType="string"
|
||||||
valueType="string">
|
id="gnu.c.link.option.defname">
|
||||||
</option>
|
</option>
|
||||||
</tool>
|
</tool>
|
||||||
<tool
|
<tool
|
||||||
natureFilter="ccnature"
|
natureFilter="ccnature"
|
||||||
sources="o"
|
|
||||||
name="%ToolName.linker.gnu.cpp"
|
name="%ToolName.linker.gnu.cpp"
|
||||||
|
sources="o"
|
||||||
outputFlag="-o"
|
outputFlag="-o"
|
||||||
command="g++"
|
command="g++"
|
||||||
id="cdt.managedbuild.tool.gnu.cpp.linker">
|
id="cdt.managedbuild.tool.gnu.cpp.linker">
|
||||||
|
@ -243,32 +243,32 @@
|
||||||
name="%Option.Posix.Linker.NoStartFiles"
|
name="%Option.Posix.Linker.NoStartFiles"
|
||||||
category="gnu.cpp.link.category.options"
|
category="gnu.cpp.link.category.options"
|
||||||
command="-nostartfiles"
|
command="-nostartfiles"
|
||||||
id="gnu.cpp.link.option.nostart"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.cpp.link.option.nostart">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.Linker.NoDefLibs"
|
name="%Option.Posix.Linker.NoDefLibs"
|
||||||
category="gnu.cpp.link.category.options"
|
category="gnu.cpp.link.category.options"
|
||||||
command="-nodefaultlibs"
|
command="-nodefaultlibs"
|
||||||
id="gnu.cpp.link.option.nodeflibs"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.cpp.link.option.nodeflibs">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.Linker.NoStdLibs"
|
name="%Option.Posix.Linker.NoStdLibs"
|
||||||
category="gnu.cpp.link.category.options"
|
category="gnu.cpp.link.category.options"
|
||||||
command="-nostdlib"
|
command="-nostdlib"
|
||||||
id="gnu.cpp.link.option.nostdlibs"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.cpp.link.option.nostdlibs">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.Linker.Strip"
|
name="%Option.Posix.Linker.Strip"
|
||||||
category="gnu.cpp.link.category.options"
|
category="gnu.cpp.link.category.options"
|
||||||
command="-s"
|
command="-s"
|
||||||
id="gnu.cpp.link.option.strip"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.cpp.link.option.strip">
|
||||||
</option>
|
</option>
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="cdt.managedbuild.tool.gnu.cpp.linker"
|
owner="cdt.managedbuild.tool.gnu.cpp.linker"
|
||||||
|
@ -279,17 +279,17 @@
|
||||||
name="%Option.Posix.Libs"
|
name="%Option.Posix.Libs"
|
||||||
category="gnu.cpp.link.category.libs"
|
category="gnu.cpp.link.category.libs"
|
||||||
command="-l"
|
command="-l"
|
||||||
id="gnu.cpp.link.option.libs"
|
valueType="libs"
|
||||||
browseType="file"
|
browseType="file"
|
||||||
valueType="libs">
|
id="gnu.cpp.link.option.libs">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.Libsearch"
|
name="%Option.Posix.Libsearch"
|
||||||
category="gnu.cpp.link.category.libs"
|
category="gnu.cpp.link.category.libs"
|
||||||
command="-L"
|
command="-L"
|
||||||
id="gnu.cpp.link.option.paths"
|
valueType="stringList"
|
||||||
browseType="directory"
|
browseType="directory"
|
||||||
valueType="stringList">
|
id="gnu.cpp.link.option.paths">
|
||||||
</option>
|
</option>
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="cdt.managedbuild.tool.gnu.cpp.linker"
|
owner="cdt.managedbuild.tool.gnu.cpp.linker"
|
||||||
|
@ -299,22 +299,22 @@
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.Linker.Flags"
|
name="%Option.Posix.Linker.Flags"
|
||||||
category="gnu.cpp.link.category.other"
|
category="gnu.cpp.link.category.other"
|
||||||
valueType="string"
|
id="gnu.cpp.link.option.flags"
|
||||||
id="gnu.cpp.link.option.flags">
|
valueType="string">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.Linker.XLinker"
|
name="%Option.Posix.Linker.XLinker"
|
||||||
category="gnu.cpp.link.category.other"
|
category="gnu.cpp.link.category.other"
|
||||||
command="-Xlinker"
|
command="-Xlinker"
|
||||||
valueType="stringList"
|
id="gnu.cpp.link.option.other"
|
||||||
id="gnu.cpp.link.option.other">
|
valueType="stringList">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.UserObjs"
|
name="%Option.Posix.UserObjs"
|
||||||
category="gnu.cpp.link.category.other"
|
category="gnu.cpp.link.category.other"
|
||||||
browseType="file"
|
id="gnu.cpp.link.option.userobjs"
|
||||||
valueType="userObjs"
|
valueType="userObjs"
|
||||||
id="gnu.cpp.link.option.userobjs">
|
browseType="file">
|
||||||
</option>
|
</option>
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="cdt.managedbuild.tool.gnu.cpp.linker"
|
owner="cdt.managedbuild.tool.gnu.cpp.linker"
|
||||||
|
@ -326,38 +326,38 @@
|
||||||
name="%Option.Posix.Linker.Shared"
|
name="%Option.Posix.Linker.Shared"
|
||||||
category="gnu.cpp.link.category.shared"
|
category="gnu.cpp.link.category.shared"
|
||||||
command="-shared"
|
command="-shared"
|
||||||
valueType="boolean"
|
id="gnu.cpp.link.option.shared"
|
||||||
id="gnu.cpp.link.option.shared">
|
valueType="boolean">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.Linker.SOName"
|
name="%Option.Posix.Linker.SOName"
|
||||||
category="gnu.cpp.link.category.shared"
|
category="gnu.cpp.link.category.shared"
|
||||||
command="-Wl,-soname,"
|
command="-Wl,-soname,"
|
||||||
valueType="string"
|
id="gnu.cpp.link.option.soname"
|
||||||
id="gnu.cpp.link.option.soname">
|
valueType="string">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.Linker.Implib"
|
name="%Option.Posix.Linker.Implib"
|
||||||
category="gnu.cpp.link.category.shared"
|
category="gnu.cpp.link.category.shared"
|
||||||
command="-Wl,--out-implib,"
|
command="-Wl,--out-implib,"
|
||||||
valueType="string"
|
id="gnu.cpp.link.option.implname"
|
||||||
id="gnu.cpp.link.option.implname">
|
valueType="string">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.Linker.Defname"
|
name="%Option.Posix.Linker.Defname"
|
||||||
category="gnu.cpp.link.category.shared"
|
category="gnu.cpp.link.category.shared"
|
||||||
command="-Wl,--output-def,"
|
command="-Wl,--output-def,"
|
||||||
valueType="string"
|
id="gnu.cpp.link.option.defname"
|
||||||
id="gnu.cpp.link.option.defname">
|
valueType="string">
|
||||||
</option>
|
</option>
|
||||||
</tool>
|
</tool>
|
||||||
<tool
|
<tool
|
||||||
natureFilter="both"
|
natureFilter="both"
|
||||||
sources="o"
|
|
||||||
name="%ToolName.archiver.gnu"
|
name="%ToolName.archiver.gnu"
|
||||||
outputs="a"
|
sources="o"
|
||||||
command="ar"
|
|
||||||
outputPrefix="lib"
|
outputPrefix="lib"
|
||||||
|
command="ar"
|
||||||
|
outputs="a"
|
||||||
id="cdt.managedbuild.tool.gnu.archiver">
|
id="cdt.managedbuild.tool.gnu.archiver">
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="cdt.managedbuild.tool.gnu.archiver"
|
owner="cdt.managedbuild.tool.gnu.archiver"
|
||||||
|
@ -368,8 +368,8 @@
|
||||||
defaultValue="-r"
|
defaultValue="-r"
|
||||||
name="%Option.Posix.Archiver.Flags"
|
name="%Option.Posix.Archiver.Flags"
|
||||||
category="gnu.lib.category.general"
|
category="gnu.lib.category.general"
|
||||||
valueType="string"
|
id="gnu.both.lib.option.flags"
|
||||||
id="gnu.both.lib.option.flags">
|
valueType="string">
|
||||||
</option>
|
</option>
|
||||||
</tool>
|
</tool>
|
||||||
<target
|
<target
|
||||||
|
@ -384,12 +384,12 @@
|
||||||
makeArguments="-k">
|
makeArguments="-k">
|
||||||
<tool
|
<tool
|
||||||
natureFilter="cnature"
|
natureFilter="cnature"
|
||||||
sources="c"
|
|
||||||
name="%ToolName.compiler.gnu.c"
|
name="%ToolName.compiler.gnu.c"
|
||||||
|
sources="c"
|
||||||
headerExtensions="h"
|
headerExtensions="h"
|
||||||
outputFlag="-o"
|
outputFlag="-o"
|
||||||
outputs="o"
|
|
||||||
command="gcc"
|
command="gcc"
|
||||||
|
outputs="o"
|
||||||
id="cdt.managedbuild.tool.gnu.c.compiler">
|
id="cdt.managedbuild.tool.gnu.c.compiler">
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="cdt.managedbuild.tool.gnu.c.compiler"
|
owner="cdt.managedbuild.tool.gnu.c.compiler"
|
||||||
|
@ -401,16 +401,16 @@
|
||||||
name="%Option.Posix.Nostdinc"
|
name="%Option.Posix.Nostdinc"
|
||||||
category="gnu.c.compiler.category.preprocessor"
|
category="gnu.c.compiler.category.preprocessor"
|
||||||
command="-nostdinc"
|
command="-nostdinc"
|
||||||
id="gnu.c.compiler.option.preprocessor.nostdinc"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.c.compiler.option.preprocessor.nostdinc">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.PreprocOnly"
|
name="%Option.Posix.PreprocOnly"
|
||||||
category="gnu.c.compiler.category.preprocessor"
|
category="gnu.c.compiler.category.preprocessor"
|
||||||
command="-E"
|
command="-E"
|
||||||
id="gnu.c.compiler.option.preprocessor.preprocess"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.c.compiler.option.preprocessor.preprocess">
|
||||||
</option>
|
</option>
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="cdt.managedbuild.tool.gnu.c.compiler"
|
owner="cdt.managedbuild.tool.gnu.c.compiler"
|
||||||
|
@ -421,15 +421,15 @@
|
||||||
name="%Option.Posix.DefSym"
|
name="%Option.Posix.DefSym"
|
||||||
category="gnu.c.compiler.category.symbols"
|
category="gnu.c.compiler.category.symbols"
|
||||||
command="-D"
|
command="-D"
|
||||||
id="gnu.c.compiler.option.preprocessor.def.symbols"
|
valueType="definedSymbols"
|
||||||
valueType="definedSymbols">
|
id="gnu.c.compiler.option.preprocessor.def.symbols">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.UndefSym"
|
name="%Option.Posix.UndefSym"
|
||||||
category="gnu.c.compiler.category.symbols"
|
category="gnu.c.compiler.category.symbols"
|
||||||
command="-U"
|
command="-U"
|
||||||
id="gnu.c.compiler.option.preprocessor.undef.symbol"
|
valueType="stringList"
|
||||||
valueType="stringList">
|
id="gnu.c.compiler.option.preprocessor.undef.symbol">
|
||||||
</option>
|
</option>
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="cdt.managedbuild.tool.gnu.c.compiler"
|
owner="cdt.managedbuild.tool.gnu.c.compiler"
|
||||||
|
@ -440,9 +440,9 @@
|
||||||
name="%Option.Posix.InclPaths"
|
name="%Option.Posix.InclPaths"
|
||||||
category="gnu.c.compiler.category.dirs"
|
category="gnu.c.compiler.category.dirs"
|
||||||
command="-I"
|
command="-I"
|
||||||
id="gnu.c.compiler.option.include.paths"
|
browseType="directory"
|
||||||
valueType="includePath"
|
valueType="includePath"
|
||||||
browseType="directory">
|
id="gnu.c.compiler.option.include.paths">
|
||||||
</option>
|
</option>
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="cdt.managedbuild.tool.gnu.c.compiler"
|
owner="cdt.managedbuild.tool.gnu.c.compiler"
|
||||||
|
@ -452,8 +452,8 @@
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.OptLevel"
|
name="%Option.Posix.OptLevel"
|
||||||
category="gnu.c.compiler.category.optimization"
|
category="gnu.c.compiler.category.optimization"
|
||||||
id="gnu.c.compiler.option.optimization.level"
|
valueType="enumerated"
|
||||||
valueType="enumerated">
|
id="gnu.c.compiler.option.optimization.level">
|
||||||
<enumeratedOptionValue
|
<enumeratedOptionValue
|
||||||
name="%Option.Posix.Optimize.None"
|
name="%Option.Posix.Optimize.None"
|
||||||
isDefault="false"
|
isDefault="false"
|
||||||
|
@ -480,8 +480,8 @@
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.Optimize.Flags"
|
name="%Option.Posix.Optimize.Flags"
|
||||||
category="gnu.c.compiler.category.optimization"
|
category="gnu.c.compiler.category.optimization"
|
||||||
id="gnu.c.compiler.option.optimization.flags"
|
valueType="string"
|
||||||
valueType="string">
|
id="gnu.c.compiler.option.optimization.flags">
|
||||||
</option>
|
</option>
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="cdt.managedbuild.tool.gnu.c.compiler"
|
owner="cdt.managedbuild.tool.gnu.c.compiler"
|
||||||
|
@ -491,8 +491,8 @@
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.DebugLevel"
|
name="%Option.Posix.DebugLevel"
|
||||||
category="gnu.c.compiler.category.debug"
|
category="gnu.c.compiler.category.debug"
|
||||||
id="gnu.c.compiler.option.debugging.level"
|
valueType="enumerated"
|
||||||
valueType="enumerated">
|
id="gnu.c.compiler.option.debugging.level">
|
||||||
<enumeratedOptionValue
|
<enumeratedOptionValue
|
||||||
name="%Option.Posix.Debug.None"
|
name="%Option.Posix.Debug.None"
|
||||||
isDefault="false"
|
isDefault="false"
|
||||||
|
@ -519,24 +519,24 @@
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.Debug.Other"
|
name="%Option.Posix.Debug.Other"
|
||||||
category="gnu.c.compiler.category.debug"
|
category="gnu.c.compiler.category.debug"
|
||||||
id="gnu.c.compiler.option.debugging.other"
|
valueType="string"
|
||||||
valueType="string">
|
id="gnu.c.compiler.option.debugging.other">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.Debug.gprof"
|
name="%Option.Posix.Debug.gprof"
|
||||||
category="gnu.c.compiler.category.debug"
|
category="gnu.c.compiler.category.debug"
|
||||||
command="-pg"
|
command="-pg"
|
||||||
id="gnu.c.compiler.option.debugging.gprof"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.c.compiler.option.debugging.gprof">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.Debug.prof"
|
name="%Option.Posix.Debug.prof"
|
||||||
category="gnu.c.compiler.category.debug"
|
category="gnu.c.compiler.category.debug"
|
||||||
command="-p"
|
command="-p"
|
||||||
id="gnu.c.compiler.option.debugging.prof"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.c.compiler.option.debugging.prof">
|
||||||
</option>
|
</option>
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="cdt.managedbuild.tool.gnu.c.compiler"
|
owner="cdt.managedbuild.tool.gnu.c.compiler"
|
||||||
|
@ -548,48 +548,48 @@
|
||||||
name="%Option.Posix.Warn.Syntax"
|
name="%Option.Posix.Warn.Syntax"
|
||||||
category="gnu.c.compiler.category.warnings"
|
category="gnu.c.compiler.category.warnings"
|
||||||
command="-fsyntax-only"
|
command="-fsyntax-only"
|
||||||
id="gnu.c.compiler.option.warnings.syntax"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.c.compiler.option.warnings.syntax">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.Warn.Pedandic"
|
name="%Option.Posix.Warn.Pedandic"
|
||||||
category="gnu.c.compiler.category.warnings"
|
category="gnu.c.compiler.category.warnings"
|
||||||
command="-pedantic"
|
command="-pedantic"
|
||||||
id="gnu.c.compiler.option.warnings.pedantic"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.c.compiler.option.warnings.pedantic">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.Warn.PedErrors"
|
name="%Option.Posix.Warn.PedErrors"
|
||||||
category="gnu.c.compiler.category.warnings"
|
category="gnu.c.compiler.category.warnings"
|
||||||
command="-pedantic-errors"
|
command="-pedantic-errors"
|
||||||
id="gnu.c.compiler.option.warnings.pedantic.error"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.c.compiler.option.warnings.pedantic.error">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.Warn.nowarn"
|
name="%Option.Posix.Warn.nowarn"
|
||||||
category="gnu.c.compiler.category.warnings"
|
category="gnu.c.compiler.category.warnings"
|
||||||
command="-w"
|
command="-w"
|
||||||
id="gnu.c.compiler.option.warnings.nowarn"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.c.compiler.option.warnings.nowarn">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="true"
|
defaultValue="true"
|
||||||
name="%Option.Posix.Warn.allwarn"
|
name="%Option.Posix.Warn.allwarn"
|
||||||
category="gnu.c.compiler.category.warnings"
|
category="gnu.c.compiler.category.warnings"
|
||||||
command="-Wall"
|
command="-Wall"
|
||||||
id="gnu.c.compiler.option.warnings.allwarn"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.c.compiler.option.warnings.allwarn">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.Warn.toerrs"
|
name="%Option.Posix.Warn.toerrs"
|
||||||
category="gnu.c.compiler.category.warnings"
|
category="gnu.c.compiler.category.warnings"
|
||||||
command="-Werror"
|
command="-Werror"
|
||||||
id="gnu.c.compiler.option.warnings.toerrors"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.c.compiler.option.warnings.toerrors">
|
||||||
</option>
|
</option>
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="cdt.managedbuild.tool.gnu.c.compiler"
|
owner="cdt.managedbuild.tool.gnu.c.compiler"
|
||||||
|
@ -600,34 +600,34 @@
|
||||||
defaultValue="-c -fmessage-length=0"
|
defaultValue="-c -fmessage-length=0"
|
||||||
name="%Option.OtherFlags"
|
name="%Option.OtherFlags"
|
||||||
category="gnu.c.compiler.category.other"
|
category="gnu.c.compiler.category.other"
|
||||||
id="gnu.c.compiler.option.misc.other"
|
valueType="string"
|
||||||
valueType="string">
|
id="gnu.c.compiler.option.misc.other">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.Verbose"
|
name="%Option.Posix.Verbose"
|
||||||
category="gnu.c.compiler.category.other"
|
category="gnu.c.compiler.category.other"
|
||||||
command="-v"
|
command="-v"
|
||||||
id="gnu.c.compiler.option.misc.verbose"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.c.compiler.option.misc.verbose">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.Ansi"
|
name="%Option.Posix.Ansi"
|
||||||
category="gnu.c.compiler.category.other"
|
category="gnu.c.compiler.category.other"
|
||||||
command="-ansi"
|
command="-ansi"
|
||||||
id="gnu.c.compiler.option.misc.ansi"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.c.compiler.option.misc.ansi">
|
||||||
</option>
|
</option>
|
||||||
</tool>
|
</tool>
|
||||||
<tool
|
<tool
|
||||||
natureFilter="ccnature"
|
natureFilter="ccnature"
|
||||||
sources="c,C,cc,cxx,cpp"
|
|
||||||
name="%ToolName.compiler.gnu.cpp"
|
name="%ToolName.compiler.gnu.cpp"
|
||||||
|
sources="c,C,cc,cxx,cpp"
|
||||||
headerExtensions="h,H,hpp"
|
headerExtensions="h,H,hpp"
|
||||||
outputFlag="-o"
|
outputFlag="-o"
|
||||||
outputs="o"
|
|
||||||
command="g++"
|
command="g++"
|
||||||
|
outputs="o"
|
||||||
id="cdt.managedbuild.tool.gnu.cpp.compiler">
|
id="cdt.managedbuild.tool.gnu.cpp.compiler">
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="cdt.managedbuild.tool.gnu.cpp.compiler"
|
owner="cdt.managedbuild.tool.gnu.cpp.compiler"
|
||||||
|
@ -639,30 +639,30 @@
|
||||||
name="%Option.Posix.Nostdinc"
|
name="%Option.Posix.Nostdinc"
|
||||||
category="gnu.cpp.compiler.category.preprocessor"
|
category="gnu.cpp.compiler.category.preprocessor"
|
||||||
command="-nostdinc"
|
command="-nostdinc"
|
||||||
id="gnu.cpp.compiler.option.preprocessor.nostdinc"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.cpp.compiler.option.preprocessor.nostdinc">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.PreprocOnly"
|
name="%Option.Posix.PreprocOnly"
|
||||||
category="gnu.cpp.compiler.category.preprocessor"
|
category="gnu.cpp.compiler.category.preprocessor"
|
||||||
command="-E"
|
command="-E"
|
||||||
id="gnu.cpp.compiler.option.preprocessor.preprocess"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.cpp.compiler.option.preprocessor.preprocess">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.DefSym"
|
name="%Option.Posix.DefSym"
|
||||||
category="gnu.cpp.compiler.category.preprocessor"
|
category="gnu.cpp.compiler.category.preprocessor"
|
||||||
command="-D"
|
command="-D"
|
||||||
id="gnu.cpp.compiler.option.preprocessor.def"
|
valueType="definedSymbols"
|
||||||
valueType="definedSymbols">
|
id="gnu.cpp.compiler.option.preprocessor.def">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.UndefSym"
|
name="%Option.Posix.UndefSym"
|
||||||
category="gnu.cpp.compiler.category.preprocessor"
|
category="gnu.cpp.compiler.category.preprocessor"
|
||||||
command="-U"
|
command="-U"
|
||||||
id="gnu.cpp.compiler.option.preprocessor.undef"
|
valueType="stringList"
|
||||||
valueType="stringList">
|
id="gnu.cpp.compiler.option.preprocessor.undef">
|
||||||
</option>
|
</option>
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="cdt.managedbuild.tool.gnu.cpp.compiler"
|
owner="cdt.managedbuild.tool.gnu.cpp.compiler"
|
||||||
|
@ -673,9 +673,9 @@
|
||||||
name="%Option.Posix.InclPaths"
|
name="%Option.Posix.InclPaths"
|
||||||
category="gnu.cpp.compiler.category.dirs"
|
category="gnu.cpp.compiler.category.dirs"
|
||||||
command="-I"
|
command="-I"
|
||||||
id="gnu.cpp.compiler.option.include.paths"
|
browseType="directory"
|
||||||
valueType="includePath"
|
valueType="includePath"
|
||||||
browseType="directory">
|
id="gnu.cpp.compiler.option.include.paths">
|
||||||
</option>
|
</option>
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="cdt.managedbuild.tool.gnu.cpp.compiler"
|
owner="cdt.managedbuild.tool.gnu.cpp.compiler"
|
||||||
|
@ -685,8 +685,8 @@
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.OptLevel"
|
name="%Option.Posix.OptLevel"
|
||||||
category="gnu.cpp.compiler.category.optimization"
|
category="gnu.cpp.compiler.category.optimization"
|
||||||
id="gnu.cpp.compiler.option.optimization.level"
|
valueType="enumerated"
|
||||||
valueType="enumerated">
|
id="gnu.cpp.compiler.option.optimization.level">
|
||||||
<enumeratedOptionValue
|
<enumeratedOptionValue
|
||||||
name="%Option.Posix.Optimize.None"
|
name="%Option.Posix.Optimize.None"
|
||||||
command="-O0"
|
command="-O0"
|
||||||
|
@ -712,8 +712,8 @@
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.Optimize.Flags"
|
name="%Option.Posix.Optimize.Flags"
|
||||||
category="gnu.cpp.compiler.category.optimization"
|
category="gnu.cpp.compiler.category.optimization"
|
||||||
id="gnu.cpp.compiler.option.optimization.flags"
|
valueType="string"
|
||||||
valueType="string">
|
id="gnu.cpp.compiler.option.optimization.flags">
|
||||||
</option>
|
</option>
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="cdt.managedbuild.tool.gnu.cpp.compiler"
|
owner="cdt.managedbuild.tool.gnu.cpp.compiler"
|
||||||
|
@ -723,8 +723,8 @@
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.DebugLevel"
|
name="%Option.Posix.DebugLevel"
|
||||||
category="gnu.cpp.compiler.category.debug"
|
category="gnu.cpp.compiler.category.debug"
|
||||||
id="gnu.cpp.compiler.option.debugging.level"
|
valueType="enumerated"
|
||||||
valueType="enumerated">
|
id="gnu.cpp.compiler.option.debugging.level">
|
||||||
<enumeratedOptionValue
|
<enumeratedOptionValue
|
||||||
name="%Option.Posix.Debug.None"
|
name="%Option.Posix.Debug.None"
|
||||||
isDefault="false"
|
isDefault="false"
|
||||||
|
@ -751,24 +751,24 @@
|
||||||
<option
|
<option
|
||||||
name="%Option.Posix.Debug.Other"
|
name="%Option.Posix.Debug.Other"
|
||||||
category="gnu.cpp.compiler.category.debug"
|
category="gnu.cpp.compiler.category.debug"
|
||||||
id="gnu.cpp.compiler.option.debugging.other"
|
valueType="string"
|
||||||
valueType="string">
|
id="gnu.cpp.compiler.option.debugging.other">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.Debug.prof"
|
name="%Option.Posix.Debug.prof"
|
||||||
category="gnu.cpp.compiler.category.debug"
|
category="gnu.cpp.compiler.category.debug"
|
||||||
command="-p"
|
command="-p"
|
||||||
id="gnu.cpp.compiler.option.debugging.prof"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.cpp.compiler.option.debugging.prof">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.Debug.gprof"
|
name="%Option.Posix.Debug.gprof"
|
||||||
category="gnu.cpp.compiler.category.debug"
|
category="gnu.cpp.compiler.category.debug"
|
||||||
command="-pg"
|
command="-pg"
|
||||||
id="gnu.cpp.compiler.option.debugging.gprof"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.cpp.compiler.option.debugging.gprof">
|
||||||
</option>
|
</option>
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="cdt.managedbuild.tool.gnu.cpp.compiler"
|
owner="cdt.managedbuild.tool.gnu.cpp.compiler"
|
||||||
|
@ -780,48 +780,48 @@
|
||||||
name="%Option.Posix.Warn.Syntax"
|
name="%Option.Posix.Warn.Syntax"
|
||||||
category="gnu.cpp.compiler.category.warnings"
|
category="gnu.cpp.compiler.category.warnings"
|
||||||
command="-fsyntax-only"
|
command="-fsyntax-only"
|
||||||
id="gnu.cpp.compiler.option.warnings.syntax"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.cpp.compiler.option.warnings.syntax">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.Warn.Pedandic"
|
name="%Option.Posix.Warn.Pedandic"
|
||||||
category="gnu.cpp.compiler.category.warnings"
|
category="gnu.cpp.compiler.category.warnings"
|
||||||
command="-pedantic"
|
command="-pedantic"
|
||||||
id="gnu.cpp.compiler.option.warnings.pedantic"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.cpp.compiler.option.warnings.pedantic">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.Warn.PedErrors"
|
name="%Option.Posix.Warn.PedErrors"
|
||||||
category="gnu.cpp.compiler.category.warnings"
|
category="gnu.cpp.compiler.category.warnings"
|
||||||
command="-pedantic-errors"
|
command="-pedantic-errors"
|
||||||
id="gnu.cpp.compiler.option.warnings.pedantic.error"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.cpp.compiler.option.warnings.pedantic.error">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.Warn.nowarn"
|
name="%Option.Posix.Warn.nowarn"
|
||||||
category="gnu.cpp.compiler.category.warnings"
|
category="gnu.cpp.compiler.category.warnings"
|
||||||
command="-w"
|
command="-w"
|
||||||
id="gnu.cpp.compiler.option.warnings.nowarn"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.cpp.compiler.option.warnings.nowarn">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="true"
|
defaultValue="true"
|
||||||
name="%Option.Posix.Warn.allwarn"
|
name="%Option.Posix.Warn.allwarn"
|
||||||
category="gnu.cpp.compiler.category.warnings"
|
category="gnu.cpp.compiler.category.warnings"
|
||||||
command="-Wall"
|
command="-Wall"
|
||||||
id="gnu.cpp.compiler.option.warnings.allwarn"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.cpp.compiler.option.warnings.allwarn">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.Warn.toerrs"
|
name="%Option.Posix.Warn.toerrs"
|
||||||
category="gnu.cpp.compiler.category.warnings"
|
category="gnu.cpp.compiler.category.warnings"
|
||||||
command="-Werror"
|
command="-Werror"
|
||||||
id="gnu.cpp.compiler.option.warnings.toerrors"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.cpp.compiler.option.warnings.toerrors">
|
||||||
</option>
|
</option>
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="cdt.managedbuild.tool.gnu.cpp.compiler"
|
owner="cdt.managedbuild.tool.gnu.cpp.compiler"
|
||||||
|
@ -832,16 +832,16 @@
|
||||||
defaultValue="-c -fmessage-length=0"
|
defaultValue="-c -fmessage-length=0"
|
||||||
name="%Option.OtherFlags"
|
name="%Option.OtherFlags"
|
||||||
category="gnu.cpp.compiler.category.other"
|
category="gnu.cpp.compiler.category.other"
|
||||||
id="gnu.cpp.compiler.option.other.other"
|
valueType="string"
|
||||||
valueType="string">
|
id="gnu.cpp.compiler.option.other.other">
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
name="%Option.Posix.Verbose"
|
name="%Option.Posix.Verbose"
|
||||||
category="gnu.cpp.compiler.category.other"
|
category="gnu.cpp.compiler.category.other"
|
||||||
command="-v"
|
command="-v"
|
||||||
id="gnu.cpp.compiler.option.other.verbose"
|
valueType="boolean"
|
||||||
valueType="boolean">
|
id="gnu.cpp.compiler.option.other.verbose">
|
||||||
</option>
|
</option>
|
||||||
</tool>
|
</tool>
|
||||||
</target>
|
</target>
|
||||||
|
@ -849,6 +849,7 @@
|
||||||
isTest="false"
|
isTest="false"
|
||||||
osList="solaris,linux,hpux,aix,macosx,qnx"
|
osList="solaris,linux,hpux,aix,macosx,qnx"
|
||||||
name="%TargetName.gnu.exe"
|
name="%TargetName.gnu.exe"
|
||||||
|
scannerInfoCollector="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGCCScannerInfoCollector"
|
||||||
parent="cdt.managedbuild.target.gnu"
|
parent="cdt.managedbuild.target.gnu"
|
||||||
isAbstract="false"
|
isAbstract="false"
|
||||||
id="cdt.managedbuild.target.gnu.exe">
|
id="cdt.managedbuild.target.gnu.exe">
|
||||||
|
@ -915,6 +916,7 @@
|
||||||
isTest="false"
|
isTest="false"
|
||||||
osList="solaris,linux,hpux,aix,macosx,qnx"
|
osList="solaris,linux,hpux,aix,macosx,qnx"
|
||||||
name="%TargetName.gnu.so"
|
name="%TargetName.gnu.so"
|
||||||
|
scannerInfoCollector="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGCCScannerInfoCollector"
|
||||||
parent="cdt.managedbuild.target.gnu"
|
parent="cdt.managedbuild.target.gnu"
|
||||||
defaultExtension="so"
|
defaultExtension="so"
|
||||||
isAbstract="false"
|
isAbstract="false"
|
||||||
|
@ -972,13 +974,13 @@
|
||||||
</toolReference>
|
</toolReference>
|
||||||
</configuration>
|
</configuration>
|
||||||
<toolReference
|
<toolReference
|
||||||
outputs="so"
|
|
||||||
outputPrefix="lib"
|
outputPrefix="lib"
|
||||||
|
outputs="so"
|
||||||
id="cdt.managedbuild.tool.gnu.c.linker">
|
id="cdt.managedbuild.tool.gnu.c.linker">
|
||||||
</toolReference>
|
</toolReference>
|
||||||
<toolReference
|
<toolReference
|
||||||
outputs="so"
|
|
||||||
outputPrefix="lib"
|
outputPrefix="lib"
|
||||||
|
outputs="so"
|
||||||
id="cdt.managedbuild.tool.gnu.cpp.linker">
|
id="cdt.managedbuild.tool.gnu.cpp.linker">
|
||||||
</toolReference>
|
</toolReference>
|
||||||
</target>
|
</target>
|
||||||
|
@ -986,6 +988,7 @@
|
||||||
isTest="false"
|
isTest="false"
|
||||||
osList="solaris,linux,hpux,aix,macosx,qnx"
|
osList="solaris,linux,hpux,aix,macosx,qnx"
|
||||||
name="%TargetName.gnu.lib"
|
name="%TargetName.gnu.lib"
|
||||||
|
scannerInfoCollector="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGCCScannerInfoCollector"
|
||||||
parent="cdt.managedbuild.target.gnu"
|
parent="cdt.managedbuild.target.gnu"
|
||||||
defaultExtension="a"
|
defaultExtension="a"
|
||||||
isAbstract="false"
|
isAbstract="false"
|
||||||
|
@ -1043,20 +1046,21 @@
|
||||||
</toolReference>
|
</toolReference>
|
||||||
</configuration>
|
</configuration>
|
||||||
<toolReference
|
<toolReference
|
||||||
outputs="a"
|
|
||||||
outputPrefix="lib"
|
outputPrefix="lib"
|
||||||
|
outputs="a"
|
||||||
id="cdt.managedbuild.tool.gnu.archiver">
|
id="cdt.managedbuild.tool.gnu.archiver">
|
||||||
</toolReference>
|
</toolReference>
|
||||||
</target>
|
</target>
|
||||||
<target
|
<target
|
||||||
isTest="false"
|
|
||||||
osList="win32"
|
|
||||||
name="%TargetName.cygw.exe"
|
name="%TargetName.cygw.exe"
|
||||||
parent="cdt.managedbuild.target.gnu"
|
id="cdt.managedbuild.target.gnu.cygwin.exe"
|
||||||
binaryParser="org.eclipse.cdt.core.PE"
|
isTest="false"
|
||||||
defaultExtension="exe"
|
defaultExtension="exe"
|
||||||
|
scannerInfoCollector="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultCygwinScannerInfoCollector"
|
||||||
isAbstract="false"
|
isAbstract="false"
|
||||||
id="cdt.managedbuild.target.gnu.cygwin.exe">
|
binaryParser="org.eclipse.cdt.core.PE"
|
||||||
|
parent="cdt.managedbuild.target.gnu"
|
||||||
|
osList="win32">
|
||||||
<configuration
|
<configuration
|
||||||
name="%ConfigName.Dbg"
|
name="%ConfigName.Dbg"
|
||||||
id="cdt.managedbuild.config.gnu.cygwin.exe.debug">
|
id="cdt.managedbuild.config.gnu.cygwin.exe.debug">
|
||||||
|
@ -1119,14 +1123,15 @@
|
||||||
</toolReference>
|
</toolReference>
|
||||||
</target>
|
</target>
|
||||||
<target
|
<target
|
||||||
isTest="false"
|
|
||||||
osList="win32"
|
|
||||||
name="%TargetName.cygw.so"
|
name="%TargetName.cygw.so"
|
||||||
|
id="cdt.managedbuild.target.gnu.cygwin.so"
|
||||||
|
isTest="false"
|
||||||
|
defaultExtension="a.dll"
|
||||||
|
scannerInfoCollector="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultCygwinScannerInfoCollector"
|
||||||
|
isAbstract="false"
|
||||||
binaryParser="org.eclipse.cdt.core.PE"
|
binaryParser="org.eclipse.cdt.core.PE"
|
||||||
parent="cdt.managedbuild.target.gnu"
|
parent="cdt.managedbuild.target.gnu"
|
||||||
defaultExtension="a.dll"
|
osList="win32">
|
||||||
isAbstract="false"
|
|
||||||
id="cdt.managedbuild.target.gnu.cygwin.so">
|
|
||||||
<configuration
|
<configuration
|
||||||
name="%ConfigName.Dbg"
|
name="%ConfigName.Dbg"
|
||||||
id="cdt.managedbuild.config.gnu.cygwin.so.debug">
|
id="cdt.managedbuild.config.gnu.cygwin.so.debug">
|
||||||
|
@ -1189,14 +1194,15 @@
|
||||||
</toolReference>
|
</toolReference>
|
||||||
</target>
|
</target>
|
||||||
<target
|
<target
|
||||||
isTest="false"
|
|
||||||
osList="win32"
|
|
||||||
name="%TargetName.cygw.lib"
|
name="%TargetName.cygw.lib"
|
||||||
parent="cdt.managedbuild.target.gnu"
|
id="cdt.managedbuild.target.gnu.cygwin.lib"
|
||||||
binaryParser="org.eclipse.cdt.core.PE"
|
isTest="false"
|
||||||
defaultExtension="a"
|
defaultExtension="a"
|
||||||
|
scannerInfoCollector="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultCygwinScannerInfoCollector"
|
||||||
isAbstract="false"
|
isAbstract="false"
|
||||||
id="cdt.managedbuild.target.gnu.cygwin.lib">
|
binaryParser="org.eclipse.cdt.core.PE"
|
||||||
|
parent="cdt.managedbuild.target.gnu"
|
||||||
|
osList="win32">
|
||||||
<configuration
|
<configuration
|
||||||
name="%ConfigName.Dbg"
|
name="%ConfigName.Dbg"
|
||||||
id="cdt.managedbuild.config.gnu.cygwin.lib.debug">
|
id="cdt.managedbuild.config.gnu.cygwin.lib.debug">
|
||||||
|
@ -1250,8 +1256,8 @@
|
||||||
</toolReference>
|
</toolReference>
|
||||||
</configuration>
|
</configuration>
|
||||||
<toolReference
|
<toolReference
|
||||||
outputPrefix="lib"
|
|
||||||
outputs="a"
|
outputs="a"
|
||||||
|
outputPrefix="lib"
|
||||||
id="cdt.managedbuild.tool.gnu.archiver">
|
id="cdt.managedbuild.tool.gnu.archiver">
|
||||||
</toolReference>
|
</toolReference>
|
||||||
</target>
|
</target>
|
||||||
|
@ -1260,6 +1266,7 @@
|
||||||
id="cdt.managedbuild.target.gnu.mingw.exe"
|
id="cdt.managedbuild.target.gnu.mingw.exe"
|
||||||
isTest="false"
|
isTest="false"
|
||||||
defaultExtension="exe"
|
defaultExtension="exe"
|
||||||
|
scannerInfoCollector="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultMinGWScannerInfoCollector"
|
||||||
isAbstract="false"
|
isAbstract="false"
|
||||||
makeCommand="mingw32-make"
|
makeCommand="mingw32-make"
|
||||||
binaryParser="org.eclipse.cdt.core.PE"
|
binaryParser="org.eclipse.cdt.core.PE"
|
||||||
|
@ -1331,6 +1338,7 @@
|
||||||
id="cdt.managedbuild.target.gnu.mingw.so"
|
id="cdt.managedbuild.target.gnu.mingw.so"
|
||||||
isTest="false"
|
isTest="false"
|
||||||
defaultExtension="dll"
|
defaultExtension="dll"
|
||||||
|
scannerInfoCollector="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultMinGWScannerInfoCollector"
|
||||||
isAbstract="false"
|
isAbstract="false"
|
||||||
makeCommand="mingw32-make"
|
makeCommand="mingw32-make"
|
||||||
binaryParser="org.eclipse.cdt.core.PE"
|
binaryParser="org.eclipse.cdt.core.PE"
|
||||||
|
@ -1402,6 +1410,7 @@
|
||||||
id="cdt.managedbuild.target.gnu.mingw.lib"
|
id="cdt.managedbuild.target.gnu.mingw.lib"
|
||||||
isTest="false"
|
isTest="false"
|
||||||
defaultExtension="lib"
|
defaultExtension="lib"
|
||||||
|
scannerInfoCollector="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultMinGWScannerInfoCollector"
|
||||||
isAbstract="false"
|
isAbstract="false"
|
||||||
makeCommand="mingw32-make"
|
makeCommand="mingw32-make"
|
||||||
binaryParser="org.eclipse.cdt.core.PE"
|
binaryParser="org.eclipse.cdt.core.PE"
|
||||||
|
@ -1460,8 +1469,8 @@
|
||||||
</toolReference>
|
</toolReference>
|
||||||
</configuration>
|
</configuration>
|
||||||
<toolReference
|
<toolReference
|
||||||
outputPrefix="lib"
|
|
||||||
outputs="lib"
|
outputs="lib"
|
||||||
|
outputPrefix="lib"
|
||||||
id="cdt.managedbuild.tool.gnu.archiver">
|
id="cdt.managedbuild.tool.gnu.archiver">
|
||||||
</toolReference>
|
</toolReference>
|
||||||
</target>
|
</target>
|
||||||
|
|
|
@ -74,8 +74,7 @@ public class FileListControl {
|
||||||
protected void createButtonsForButtonBar(Composite parent) {
|
protected void createButtonsForButtonBar(Composite parent) {
|
||||||
super.createButtonsForButtonBar(parent);
|
super.createButtonsForButtonBar(parent);
|
||||||
if (type != IOption.BROWSE_NONE) {
|
if (type != IOption.BROWSE_NONE) {
|
||||||
final Button browse = createButton(parent, 3, ManagedBuilderUIPlugin.getResourceString(BROWSE), true);
|
final Button browse = createButton(parent, 3, ManagedBuilderUIPlugin.getResourceString(BROWSE), false);
|
||||||
getOkButton().setFocus();
|
|
||||||
browse.addSelectionListener(new SelectionAdapter() {
|
browse.addSelectionListener(new SelectionAdapter() {
|
||||||
public void widgetSelected(SelectionEvent ev) {
|
public void widgetSelected(SelectionEvent ev) {
|
||||||
String currentName;
|
String currentName;
|
||||||
|
@ -90,8 +89,6 @@ public class FileListControl {
|
||||||
result = dialog.open();
|
result = dialog.open();
|
||||||
if(result != null) {
|
if(result != null) {
|
||||||
getText().setText(result);
|
getText().setText(result);
|
||||||
// Give the OK button focus
|
|
||||||
getOkButton().setFocus();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IOption.BROWSE_FILE:
|
case IOption.BROWSE_FILE:
|
||||||
|
@ -103,8 +100,6 @@ public class FileListControl {
|
||||||
result = browseDialog.open();
|
result = browseDialog.open();
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
getText().setText(result);
|
getText().setText(result);
|
||||||
// Give the OK button focus
|
|
||||||
getOkButton().setFocus();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,9 +11,10 @@ package org.eclipse.cdt.managedbuilder.ui.wizards;
|
||||||
* IBM Rational Software - Initial API and implementation
|
* IBM Rational Software - Initial API and implementation
|
||||||
* **********************************************************************/
|
* **********************************************************************/
|
||||||
|
|
||||||
|
import org.eclipse.cdt.managedbuilder.internal.ui.ErrorParserBlock;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin;
|
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedProjectOptionBlock;
|
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedProjectOptionBlock;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.ui.ErrorParserBlock;
|
import org.eclipse.cdt.ui.dialogs.IndexerBlock;
|
||||||
import org.eclipse.cdt.ui.dialogs.ReferenceBlock;
|
import org.eclipse.cdt.ui.dialogs.ReferenceBlock;
|
||||||
import org.eclipse.cdt.ui.dialogs.TabFolderOptionBlock;
|
import org.eclipse.cdt.ui.dialogs.TabFolderOptionBlock;
|
||||||
import org.eclipse.cdt.ui.wizards.NewCProjectWizard;
|
import org.eclipse.cdt.ui.wizards.NewCProjectWizard;
|
||||||
|
@ -22,11 +23,14 @@ import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.runtime.Preferences;
|
import org.eclipse.core.runtime.Preferences;
|
||||||
|
|
||||||
public class NewManagedProjectOptionPage extends NewCProjectWizardOptionPage {
|
public class NewManagedProjectOptionPage extends NewCProjectWizardOptionPage {
|
||||||
|
|
||||||
|
|
||||||
public class ManagedWizardOptionBlock extends ManagedProjectOptionBlock {
|
public class ManagedWizardOptionBlock extends ManagedProjectOptionBlock {
|
||||||
|
|
||||||
NewManagedProjectOptionPage parent;
|
NewManagedProjectOptionPage parent;
|
||||||
ErrorParserBlock errorParsers;
|
ErrorParserBlock errorParsers;
|
||||||
|
IndexerBlock indexBlock;
|
||||||
|
|
||||||
|
|
||||||
public ManagedWizardOptionBlock(NewManagedProjectOptionPage parentPage) {
|
public ManagedWizardOptionBlock(NewManagedProjectOptionPage parentPage) {
|
||||||
super(parentPage);
|
super(parentPage);
|
||||||
|
@ -47,6 +51,7 @@ public class NewManagedProjectOptionPage extends NewCProjectWizardOptionPage {
|
||||||
addTab(new ReferenceBlock());
|
addTab(new ReferenceBlock());
|
||||||
errorParsers = new ErrorParserBlock();
|
errorParsers = new ErrorParserBlock();
|
||||||
addTab(errorParsers);
|
addTab(errorParsers);
|
||||||
|
addTab(indexBlock = new IndexerBlock());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,4 +92,6 @@ public class NewManagedProjectOptionPage extends NewCProjectWizardOptionPage {
|
||||||
// Update the error parser list
|
// Update the error parser list
|
||||||
optionBlock.updateTargetProperties();
|
optionBlock.updateTargetProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue