I have added the -I command to the indexing command and that
works fine.
Op 27/03/2017 om 20:25 schreef Doug
Schaefer:
I think the main issue is that there are a few places where
these settings are set. And I’m not sure which one gets used
where. Not only is there the Paths and Symbols as you are
using, there’s also the Preprocessor Include Paths, … entry. I’m
not sure how they’re related if at all. You might need to debug
down all the way to the scanner info provider. Yuck.
Doug.
Hi Doug,
The answer to both appears to be "no".
I probably should mention, that after running the code
mentioned in my original email on this thread, despite
it appearing to be successful, I don't see the added
paths in the UI.
With that said, if i manually add them to the UI (which
prompts me for a reindex), the "Unresolved inclusion"
marker still shows up in the source file.
I should also note that I am adding the paths as
absolute paths, even though in this case they point to
directories that are in the workspace (to other
projects). Possibly an interesting observation is when I
add one of the paths, I am seeing a "warning" icon next
to it. I don't see the same icon on the other path. I
haven't yet determined what the warning is trying to
tell me. Both paths exist.
Thanks,
Richard
Hey Richard, does it work if you add the paths in
the UI? Does a project Reindex help?
Doug.
Hi All,
I am attempting to programmatically add
additional header files paths to a project.
Ideally I'd like the added paths to appear
in the UI (i.e. properties->C/C++
General->Paths and Symbols->Includes),
but even if not, at least I'd like to make
the indexer happy. Without the additional
paths, it currently shows the "Unresolved
inclusion" marker.
Here is the code I am using at the moment,
which I found from a post a few years ago
which seems to be happy, but so far the
indexer is still showing the same marker.
IPath someHeaderFilePath = new
Path("/some/absolute/path");
IPath someOtherHeaderFilePath = new
Path("/some/other/workspaceRelative/path");
ICProjectDescription projectDescription =
CoreModel.getDefault().getProjectDescription(getProject(),
true);
ICConfigurationDescription
configDecriptions[] =
projectDescription.getConfigurations();
for (ICConfigurationDescription
configDescription : configDecriptions) {
ICFolderDescription projectRoot =
configDescription.getRootFolderDescription();
ICLanguageSetting[] settings =
projectRoot.getLanguageSettings();
for (ICLanguageSetting setting :
settings) {
List<ICLanguageSettingEntry>
includes = new
ArrayList<ICLanguageSettingEntry>();
includes.addAll(setting.getSettingEntriesList(ICSettingEntry.INCLUDE_PATH));
includes.add(new
CIncludePathEntry(someHeaderFilePath,
ICSettingEntry.LOCAL));
includes.add(new
CIncludePathEntry(someOtherHeaderFilePath,
ICSettingEntry.LOCAL));
setting.setSettingEntries(ICSettingEntry.INCLUDE_PATH,
includes);
// Set information to project
description
ManagedBuildManager.saveBuildInfo(getProject(),
true);
}
}
Thanks,
Richard
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/cdt-dev
|