mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 06:02:11 +02:00
Bug 550308 - Allow toolchain to specify part of the build config name.
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
This commit is contained in:
parent
9d97a36419
commit
b1f14709b8
3 changed files with 28 additions and 8 deletions
|
@ -116,13 +116,10 @@ public class CMakeBuildConfigurationProvider implements ICBuildConfigurationProv
|
||||||
configName.append('.');
|
configName.append('.');
|
||||||
configName.append(osConfigName);
|
configName.append(osConfigName);
|
||||||
} else {
|
} else {
|
||||||
if (os != null) {
|
String fragment = toolChain.getBuildConfigNameFragment();
|
||||||
|
if (fragment != null && !fragment.isEmpty()) {
|
||||||
configName.append('.');
|
configName.append('.');
|
||||||
configName.append(os);
|
configName.append(fragment);
|
||||||
}
|
|
||||||
if (arch != null && !arch.isEmpty()) {
|
|
||||||
configName.append('.');
|
|
||||||
configName.append(arch);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String name = configName.toString();
|
String name = configName.toString();
|
||||||
|
|
|
@ -41,10 +41,10 @@
|
||||||
</filter>
|
</filter>
|
||||||
</resource>
|
</resource>
|
||||||
<resource path="src/org/eclipse/cdt/core/build/IToolChain.java" type="org.eclipse.cdt.core.build.IToolChain">
|
<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_arguments>
|
||||||
<message_argument value="org.eclipse.cdt.core.build.IToolChain"/>
|
<message_argument value="org.eclipse.cdt.core.build.IToolChain"/>
|
||||||
<message_argument value="getTypeId()"/>
|
<message_argument value="getBuildConfigNameFragment()"/>
|
||||||
</message_arguments>
|
</message_arguments>
|
||||||
</filter>
|
</filter>
|
||||||
</resource>
|
</resource>
|
||||||
|
|
|
@ -78,6 +78,29 @@ public interface IToolChain extends IAdaptable {
|
||||||
*/
|
*/
|
||||||
String getName();
|
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
|
* The type id for the toolchain. The combination of type id and toolchain id
|
||||||
* uniquely identify the toolchain in the system.
|
* uniquely identify the toolchain in the system.
|
||||||
|
|
Loading…
Add table
Reference in a new issue