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:
parent
9c8adc16a3
commit
d4db2c45de
1 changed files with 29 additions and 31 deletions
|
@ -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
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,6 +7,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* IBM - Initial API and implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.make.internal.core.scannerconfig.util;
|
||||
|
||||
|
@ -78,7 +79,7 @@ public class CCommandDSC {
|
|||
if (project != null &&
|
||||
(option.getKey().equals(SCDOptionsEnum.INCLUDE_FILE.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())))
|
||||
{
|
||||
String value = option.getValue();
|
||||
|
@ -141,23 +142,18 @@ public class CCommandDSC {
|
|||
continue;
|
||||
String value = optionPair.getValue();
|
||||
if (optionPair.getKey().equals(SCDOptionsEnum.INCLUDE.toString()) ||
|
||||
optionPair.getKey().equals(SCDOptionsEnum.IDASH.toString())) {
|
||||
optionPair.getKey().equals(SCDOptionsEnum.ISYSTEM.toString())) {
|
||||
value = makeAbsolute(project, value);
|
||||
}
|
||||
if (quoteIncludePaths) {
|
||||
if (optionPair.getKey().equals(SCDOptionsEnum.INCLUDE.toString()) ||
|
||||
optionPair.getKey().equals(SCDOptionsEnum.IDASH.toString())) {
|
||||
optionPair.getKey().equals(SCDOptionsEnum.ISYSTEM.toString())) {
|
||||
commandAsString += optionPair.getKey() + SINGLE_SPACE +
|
||||
"\"" + 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 {
|
||||
commandAsString += optionPair.getKey() + SINGLE_SPACE +
|
||||
value + SINGLE_SPACE;
|
||||
commandAsString += optionPair.getKey() + SINGLE_SPACE + value + SINGLE_SPACE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -362,6 +358,8 @@ public class CCommandDSC {
|
|||
}
|
||||
|
||||
public void resolveOptions(IProject project) {
|
||||
if (!isDiscovered()) {
|
||||
// that's wrong for sure, options cannot be resolved fron the optionPairs??
|
||||
ArrayList symbols = new ArrayList();
|
||||
ArrayList includes = new ArrayList();
|
||||
ArrayList quoteincludes = new ArrayList();
|
||||
|
@ -370,11 +368,11 @@ public class CCommandDSC {
|
|||
String key = optionPair.getKey();
|
||||
String value = optionPair.getValue();
|
||||
if (key.equals(SCDOptionsEnum.INCLUDE.toString())) {
|
||||
includes.add(value);
|
||||
}
|
||||
else if (key.equals(SCDOptionsEnum.IDASH.toString())) {
|
||||
quoteincludes.add(value);
|
||||
}
|
||||
else if (key.equals(SCDOptionsEnum.ISYSTEM.toString())) {
|
||||
includes.add(value);
|
||||
}
|
||||
else if (key.equals(SCDOptionsEnum.DEFINE.toString())) {
|
||||
symbols.add(value);
|
||||
}
|
||||
|
@ -382,7 +380,7 @@ public class CCommandDSC {
|
|||
setIncludes(includes);
|
||||
setQuoteIncludes(quoteincludes);
|
||||
setSymbols(symbols);
|
||||
|
||||
}
|
||||
setDiscovered(true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue