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

Fix for 188997, double includes, missing includes, wrong interpretation of IDASH.

This commit is contained in:
Markus Schorn 2007-05-29 13:17:50 +00:00
parent 9c8adc16a3
commit d4db2c45de

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2005 IBM Corporation and others. * Copyright (c) 2004, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -7,6 +7,7 @@
* *
* Contributors: * Contributors:
* IBM - Initial API and implementation * IBM - Initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.make.internal.core.scannerconfig.util; package org.eclipse.cdt.make.internal.core.scannerconfig.util;
@ -78,7 +79,7 @@ public class CCommandDSC {
if (project != null && if (project != null &&
(option.getKey().equals(SCDOptionsEnum.INCLUDE_FILE.toString()) || (option.getKey().equals(SCDOptionsEnum.INCLUDE_FILE.toString()) ||
option.getKey().equals(SCDOptionsEnum.INCLUDE.toString()) || option.getKey().equals(SCDOptionsEnum.INCLUDE.toString()) ||
option.getKey().equals(SCDOptionsEnum.IDASH.toString()) || option.getKey().equals(SCDOptionsEnum.ISYSTEM.toString()) ||
option.getKey().equals(SCDOptionsEnum.IMACROS_FILE.toString()))) option.getKey().equals(SCDOptionsEnum.IMACROS_FILE.toString())))
{ {
String value = option.getValue(); String value = option.getValue();
@ -141,23 +142,18 @@ public class CCommandDSC {
continue; continue;
String value = optionPair.getValue(); String value = optionPair.getValue();
if (optionPair.getKey().equals(SCDOptionsEnum.INCLUDE.toString()) || if (optionPair.getKey().equals(SCDOptionsEnum.INCLUDE.toString()) ||
optionPair.getKey().equals(SCDOptionsEnum.IDASH.toString())) { optionPair.getKey().equals(SCDOptionsEnum.ISYSTEM.toString())) {
value = makeAbsolute(project, value); value = makeAbsolute(project, value);
} }
if (quoteIncludePaths) { if (quoteIncludePaths) {
if (optionPair.getKey().equals(SCDOptionsEnum.INCLUDE.toString()) || if (optionPair.getKey().equals(SCDOptionsEnum.INCLUDE.toString()) ||
optionPair.getKey().equals(SCDOptionsEnum.IDASH.toString())) { optionPair.getKey().equals(SCDOptionsEnum.ISYSTEM.toString())) {
commandAsString += optionPair.getKey() + SINGLE_SPACE + commandAsString += optionPair.getKey() + SINGLE_SPACE +
"\"" + value + "\"" + SINGLE_SPACE; //$NON-NLS-1$//$NON-NLS-2$ "\"" + value + "\"" + SINGLE_SPACE; //$NON-NLS-1$//$NON-NLS-2$
} }
} }
else if (optionPair.getKey().equals(SCDOptionsEnum.INCLUDE.toString())) {
commandAsString += optionPair.getKey() + SINGLE_SPACE +
value + SINGLE_SPACE;
}
else { else {
commandAsString += optionPair.getKey() + SINGLE_SPACE + commandAsString += optionPair.getKey() + SINGLE_SPACE + value + SINGLE_SPACE;
value + SINGLE_SPACE;
} }
} }
} }
@ -362,6 +358,8 @@ public class CCommandDSC {
} }
public void resolveOptions(IProject project) { public void resolveOptions(IProject project) {
if (!isDiscovered()) {
// that's wrong for sure, options cannot be resolved fron the optionPairs??
ArrayList symbols = new ArrayList(); ArrayList symbols = new ArrayList();
ArrayList includes = new ArrayList(); ArrayList includes = new ArrayList();
ArrayList quoteincludes = new ArrayList(); ArrayList quoteincludes = new ArrayList();
@ -370,11 +368,11 @@ public class CCommandDSC {
String key = optionPair.getKey(); String key = optionPair.getKey();
String value = optionPair.getValue(); String value = optionPair.getValue();
if (key.equals(SCDOptionsEnum.INCLUDE.toString())) { if (key.equals(SCDOptionsEnum.INCLUDE.toString())) {
includes.add(value);
}
else if (key.equals(SCDOptionsEnum.IDASH.toString())) {
quoteincludes.add(value); quoteincludes.add(value);
} }
else if (key.equals(SCDOptionsEnum.ISYSTEM.toString())) {
includes.add(value);
}
else if (key.equals(SCDOptionsEnum.DEFINE.toString())) { else if (key.equals(SCDOptionsEnum.DEFINE.toString())) {
symbols.add(value); symbols.add(value);
} }
@ -382,7 +380,7 @@ public class CCommandDSC {
setIncludes(includes); setIncludes(includes);
setQuoteIncludes(quoteincludes); setQuoteIncludes(quoteincludes);
setSymbols(symbols); setSymbols(symbols);
}
setDiscovered(true); setDiscovered(true);
} }