forked from qt-creator/qt-creator
Meson: List files from extra_files target field in project tree
Fixes: QTCREATORBUG-24824 Change-Id: Id37bdaea08fb527398195ac16f99fe3c00d36566 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -66,6 +66,7 @@ class TargetParser
|
||||
targetObj["id"].toString(),
|
||||
targetObj["defined_in"].toString(),
|
||||
targetObj["filename"].toVariant().toStringList(),
|
||||
targetObj["extra_files"].toVariant().toStringList(),
|
||||
targetObj["subproject"].toString(),
|
||||
extract_sources(targetObj["target_sources"].toArray())};
|
||||
return t;
|
||||
|
@@ -75,6 +75,7 @@ struct Target
|
||||
const QString id;
|
||||
const QString definedIn;
|
||||
const QStringList fileName;
|
||||
const QStringList extraFiles;
|
||||
const Utils::optional<QString> subproject;
|
||||
const SourceGroupList sources;
|
||||
|
||||
@@ -114,6 +115,7 @@ struct Target
|
||||
QString &&id,
|
||||
QString &&definedIn,
|
||||
QStringList &&fileName,
|
||||
QStringList &&extraFiles,
|
||||
QString &&subproject,
|
||||
SourceGroupList &&sources)
|
||||
: type{toType(type)}
|
||||
@@ -121,6 +123,7 @@ struct Target
|
||||
, id{std::move(id)}
|
||||
, definedIn{QDir::cleanPath(definedIn)}
|
||||
, fileName{cleanPath(std::move(fileName))}
|
||||
, extraFiles{cleanPath(std::move(extraFiles))}
|
||||
, subproject{subproject.isNull() ? Utils::nullopt
|
||||
: Utils::optional<QString>{std::move(subproject)}}
|
||||
, sources{std::move(sources)}
|
||||
|
@@ -38,6 +38,11 @@ void buildTargetTree(std::unique_ptr<MesonProjectNode> &root, const Target &targ
|
||||
ProjectExplorer::FileType::Source));
|
||||
}
|
||||
}
|
||||
for (const auto &extraFile : target.extraFiles) {
|
||||
root->addNestedNode(
|
||||
std::make_unique<ProjectExplorer::FileNode>(Utils::FilePath::fromString(extraFile),
|
||||
ProjectExplorer::FileType::Unknown));
|
||||
}
|
||||
}
|
||||
|
||||
void addTargetNode(std::unique_ptr<MesonProjectNode> &root, const Target &target)
|
||||
|
Reference in New Issue
Block a user