Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Hirsl2005-07-06 16:47:40 -0400
committerVladimir Hirsl2005-07-06 16:47:40 -0400
commit7436519c8043f61bb949858aec30ca4485283b64 (patch)
treea6c1e4f3bc69a86d2226527bf46929bf18cb565a
parent85294104b3e304bc6ed6f6d5ba2fa3fa946c3379 (diff)
downloadorg.eclipse.cdt-7436519c8043f61bb949858aec30ca4485283b64.tar.gz
org.eclipse.cdt-7436519c8043f61bb949858aec30ca4485283b64.tar.xz
org.eclipse.cdt-7436519c8043f61bb949858aec30ca4485283b64.zip
Fix for 102701: [Scanner Discovery] Per-file options also given to header files incorrectly.
Added check to remove include and macros files from returned scanner info that match the parsed resource.
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/PerFileDiscoveredPathContainer.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/PerFileDiscoveredPathContainer.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/PerFileDiscoveredPathContainer.java
index ffe8a833e7..0248fd7ec7 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/PerFileDiscoveredPathContainer.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/PerFileDiscoveredPathContainer.java
@@ -62,16 +62,25 @@ public class PerFileDiscoveredPathContainer extends DiscoveredPathContainer
entries.add(CoreModel.newMacroEntry(path, (String)entry.getKey(), (String)entry.getValue())); //$NON-NLS-1$
}
}
- if ((mask & IPathEntry.CDT_INCLUDE_FILE) != 0) {
+ // compare the resource with include and macros files
+ IPath fullResPath = fProject.getWorkspace().getRoot().getFile(path).getLocation();
+ if (fullResPath == null) {
+ fullResPath = path;
+ }
+ if ((mask & IPathEntry.CDT_INCLUDE_FILE) != 0) {
IPath[] includeFiles = filePathInfo.getIncludeFiles(path);
for (int i = 0; i < includeFiles.length; i++) {
- entries.add(CoreModel.newIncludeFileEntry(path, includeFiles[i]));
+ if (!includeFiles[i].equals(fullResPath)) {
+ entries.add(CoreModel.newIncludeFileEntry(path, includeFiles[i]));
+ }
}
}
if ((mask & IPathEntry.CDT_MACRO_FILE) != 0) {
IPath[] imacrosFiles = filePathInfo.getMacroFiles(path);
for (int i = 0; i < imacrosFiles.length; i++) {
- entries.add(CoreModel.newMacroFileEntry(path, imacrosFiles[i]));
+ if (!imacrosFiles[i].equals(fullResPath)) {
+ entries.add(CoreModel.newMacroFileEntry(path, imacrosFiles[i]));
+ }
}
}
}

Back to the top