diff options
author | Raoul Hecky <raoul.hecky@gmail.com> | 2018-11-30 11:43:27 +0100 |
---|---|---|
committer | Raoul Hecky <raoul.hecky@gmail.com> | 2019-02-07 09:16:27 +0000 |
commit | 06ff4c6c05ebaf8adb275292f6f0b8a639e74df3 (patch) | |
tree | 1b299621eb76e31c3755c673b1d50c48e73be095 | |
parent | 14f66e0eb52da61cca253adb8168e012944f1c92 (diff) | |
download | qt-creator-06ff4c6c05ebaf8adb275292f6f0b8a639e74df3.tar.gz |
Fix include paths with subfolder
When an autotools project is using SUBDIRS it starts a new parser. The
new parser object was not propagating includes/defines/flags to the main
parser object, and thus the code model did miss those.
This commit fixes that.
Task-number: QTCREATORBUG-21618
Change-Id: I19ed4dd3820257378e888f3c4935ebd30e958828
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
-rw-r--r-- | src/plugins/autotoolsprojectmanager/makefileparser.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/plugins/autotoolsprojectmanager/makefileparser.cpp b/src/plugins/autotoolsprojectmanager/makefileparser.cpp index 9c3e32216b..f56d58422a 100644 --- a/src/plugins/autotoolsprojectmanager/makefileparser.cpp +++ b/src/plugins/autotoolsprojectmanager/makefileparser.cpp @@ -291,12 +291,27 @@ void MakefileParser::parseSubDirs() foreach (const QString& source, parser.sources()) m_sources.append(subDir + slash + source); - // Duplicates might be possible in combination with several - // "..._SUBDIRS" targets - m_makefiles.removeDuplicates(); - m_sources.removeDuplicates(); + // Append the include paths of the sub directory + m_includePaths.append(parser.includePaths()); + + // Append the flags of the sub directory + m_cflags.append(parser.cflags()); + m_cxxflags.append(parser.cxxflags()); + + // Append the macros of the sub directory + foreach (const auto& m, parser.macros()) + { + if (!m_macros.contains(m)) + m_macros.append(m); + } + } + // Duplicates might be possible in combination with several + // "..._SUBDIRS" targets + m_makefiles.removeDuplicates(); + m_sources.removeDuplicates(); + if (subDirs.isEmpty()) m_success = false; } |