1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 469066 - NPE in CrossGCCBuiltinSpecsDetector.getCompilerCommand

Change-Id: Ie79a6043c742d9cd42bb846e5736676d9d0cbd6c
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
This commit is contained in:
Marc-Andre Laperle 2015-06-02 01:22:24 -04:00
parent a7d3f1d3b5
commit 30447e7806

View file

@ -23,14 +23,16 @@ public class CrossGCCBuiltinSpecsDetector extends GCCBuiltinSpecsDetector {
protected String getCompilerCommand(String languageId) {
// Include the cross command prefix (tool option) in the ${COMMAND} macro
// For example: "arch-os-" + "gcc"
String prefix = "";
String prefix = ""; //$NON-NLS-1$
IToolChain toolchain = null;
if (currentCfgDescription != null) {
IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(currentCfgDescription);
toolchain = cfg != null ? cfg.getToolChain() : null;
if (toolchain != null) {
IOption option = toolchain.getOptionBySuperClassId("cdt.managedbuild.option.gnu.cross.prefix"); //$NON-NLS-1$
prefix = (String)option.getValue();
if (option != null) {
prefix = (String) option.getValue();
}
}
}
return prefix + super.getCompilerCommand(languageId);