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:
@@ -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());
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user