logic: using source folders for header search

* adding folders form source paths to header search paths for convenience. We are using system header search paths here so that users can also use "<..>" in their includes.
This commit is contained in:
malte_langkabel
2016-08-29 11:29:03 +02:00
parent 4bac37096a
commit 9701332fd0
3 changed files with 13 additions and 2 deletions
+7 -2
View File
@@ -96,9 +96,14 @@ Parser::Arguments CxxProject::getParserArguments() const
utility::append(args.compilerFlags, m_projectSettings->getCompilerFlags());
// MAYBE DO THIS IN PARSER! AND ONLY ADD THE PATH OF THE CURRENT FILE!!
// Add the source paths as HeaderSearchPaths as well, so clang will also look here when searching include files.
//utility::append(args.systemHeaderSearchPaths, m_fileManager.getSourcePaths());
for (const FilePath& sourcePath: getSourcePaths())
{
if (sourcePath.isDirectory())
{
args.systemHeaderSearchPaths.push_back(sourcePath);
}
}
utility::append(args.systemHeaderSearchPaths, m_projectSettings->getAbsoluteHeaderSearchPaths());
+5
View File
@@ -187,6 +187,11 @@ DialogView* Project::getDialogView() const
return m_dialogView;
}
const std::vector<FilePath>& Project::getSourcePaths() const
{
return m_fileManager.getSourcePaths();
}
void Project::load()
{
m_storageAccessProxy->setSubject(nullptr);
+1
View File
@@ -38,6 +38,7 @@ public:
protected:
Project(StorageAccessProxy* storageAccessProxy, DialogView* dialogView);
DialogView* getDialogView() const;
const std::vector<FilePath>& getSourcePaths() const;
virtual std::shared_ptr<ProjectSettings> getProjectSettings() = 0;
virtual const std::shared_ptr<ProjectSettings> getProjectSettings() const = 0;