Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Schaefer2019-08-21 16:19:06 -0400
committerDoug Schaefer2019-08-22 16:44:13 -0400
commitb1f14709b82e5b044e745cfed9d3659285d4a92d (patch)
tree176c1cd0aad49254522a93f7432830dc922c87ba /core/org.eclipse.cdt.core
parent9d97a364190efb6bf73df45a78772289917cbe54 (diff)
downloadorg.eclipse.cdt-master.tar.gz
org.eclipse.cdt-master.tar.xz
org.eclipse.cdt-master.zip
Bug 550308 - Allow toolchain to specify part of the build config name.HEADmaster
This allows us to consider more than just the os and arch in the build config names as required by the selected toolchain. Change-Id: I3e1a52c756aca13fbe6c83a95f9a86bb2f286f1d
Diffstat (limited to 'core/org.eclipse.cdt.core')
-rw-r--r--core/org.eclipse.cdt.core/.settings/.api_filters4
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/IToolChain.java23
2 files changed, 25 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.core/.settings/.api_filters b/core/org.eclipse.cdt.core/.settings/.api_filters
index e054e9ba12..0f40ba973e 100644
--- a/core/org.eclipse.cdt.core/.settings/.api_filters
+++ b/core/org.eclipse.cdt.core/.settings/.api_filters
@@ -41,10 +41,10 @@
</filter>
</resource>
<resource path="src/org/eclipse/cdt/core/build/IToolChain.java" type="org.eclipse.cdt.core.build.IToolChain">
- <filter id="404000815">
+ <filter comment="It is unlikely toolchains would have added a method with this name." id="404000815">
<message_arguments>
<message_argument value="org.eclipse.cdt.core.build.IToolChain"/>
- <message_argument value="getTypeId()"/>
+ <message_argument value="getBuildConfigNameFragment()"/>
</message_arguments>
</filter>
</resource>
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/IToolChain.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/IToolChain.java
index 163fd89d0a..f2264e1875 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/IToolChain.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/IToolChain.java
@@ -79,6 +79,29 @@ public interface IToolChain extends IAdaptable {
String getName();
/**
+ * Return a toolchain specific part of the build configuration name. This should be enough
+ * to ensure the build config generated proper code for the selected target.
+ *
+ * As a default implementation, we do what the CMakeBuildConfigationProvider did which has
+ * been copied to a number of other providers, i.e. use the os and arch.
+ *
+ * @return fragment to be used in the build config name
+ * @since 6.9
+ */
+ default String getBuildConfigNameFragment() {
+ String os = getProperty(ATTR_OS);
+ String arch = getProperty(ATTR_ARCH);
+
+ if (os != null) {
+ return os + '.' + arch;
+ } else if (arch != null) {
+ return arch;
+ } else {
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
* The type id for the toolchain. The combination of type id and toolchain id
* uniquely identify the toolchain in the system.
*

Back to the top