Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tools/projmgr/include/ProjMgrWorker.h
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,7 @@ class ProjMgrWorker {
m_missingFiles.clear();
m_types = {};
m_activeTargetType.clear();
m_missingToolchains.clear();
m_undefCompiler = false;
m_isSetupCommand = false;
};
Expand Down Expand Up @@ -1303,6 +1304,7 @@ class ProjMgrWorker {
template<class T> bool CheckFilter(const std::string& filter, const T& item);
void ResolvePackRequirement(ContextItem& context, const PackItem& packEntry, bool ignoreCBuildPack);
void FormatResolvedPackIds();
void RetrieveToolchainConfigFiles();
};

#endif // PROJMGRWORKER_H
16 changes: 10 additions & 6 deletions tools/projmgr/src/ProjMgrWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1835,6 +1835,7 @@ void ProjMgrWorker::ResolvePackRequirement(ContextItem& context, const PackItem&
}

bool ProjMgrWorker::ProcessToolchain(ContextItem& context) {
RetrieveToolchainConfigFiles();
if (context.compiler.empty()) {
// Use the default compiler if available
if (context.cdefault && !context.cdefault->compiler.empty()) {
Expand Down Expand Up @@ -3939,7 +3940,7 @@ void ProjMgrWorker::PrintMissingFilters(void) {
(misspelled ? ", did you mean '." + type + "'?" : ""));
}
for (const auto& toolchain : m_missingToolchains) {
ProjMgrLogger::Get().Warn("compiler '" + toolchain + "' is not supported");
ProjMgrLogger::Get().Warn("'for-compiler: " + toolchain + "' is not supported");
}
}

Expand Down Expand Up @@ -5152,17 +5153,20 @@ bool ProjMgrWorker::GetLatestToolchain(ToolchainItem& toolchain) {
return found;
}

bool ProjMgrWorker::GetToolchainConfig(const string& toolchainName, const string& toolchainVersion, string& configPath, string& selectedConfigVersion) {
const string& compilerRoot = GetCompilerRoot();
void ProjMgrWorker::RetrieveToolchainConfigFiles(void) {
// get toolchain configuration files
if (m_toolchainConfigFiles.empty()) {
// get *.cmake files from compiler root (not recursively)
auto cmakeFiles = RteFsUtils::GrepFiles(compilerRoot, "*.cmake");
auto cmakeFiles = RteFsUtils::GrepFiles(GetCompilerRoot(), "*.cmake");
std::transform(cmakeFiles.begin(), cmakeFiles.end(), std::back_inserter(m_toolchainConfigFiles),
[](const std::filesystem::path& item) {
return item.generic_string();
});
});
}
}

bool ProjMgrWorker::GetToolchainConfig(const string& toolchainName, const string& toolchainVersion, string& configPath, string& selectedConfigVersion) {
RetrieveToolchainConfigFiles();
// find greatest compatible file
bool found = false;
static const regex regEx = regex("(\\w+)\\.(\\d+\\.\\d+\\.\\d+)");
Expand All @@ -5189,7 +5193,7 @@ bool ProjMgrWorker::GetToolchainConfig(const string& toolchainName, const string
}
}
if (!found) {
m_toolchainErrors[MessageType::Error].insert("no toolchain cmake files found for '" + toolchainName + "' in '" + compilerRoot + "' directory");
m_toolchainErrors[MessageType::Error].insert("no toolchain cmake files found for '" + toolchainName + "' in '" + GetCompilerRoot() + "' directory");
}
return found;
}
Expand Down
2 changes: 1 addition & 1 deletion tools/projmgr/test/src/ProjMgrUnitTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5221,7 +5221,7 @@ warning csolution: build-type '.UnknownBuild' does not exist in solution\n\
warning csolution: target-type '+Debug' does not exist in solution, did you mean '.Debug'?\n\
warning csolution: target-type '+MappedDebug' does not exist in solution, did you mean '.MappedDebug'?\n\
warning csolution: target-type '+UnknownTarget' does not exist in solution\n\
warning csolution: compiler 'Ac6' is not supported\n\
warning csolution: 'for-compiler: Ac6' is not supported\n\
";
auto errStr = streamRedirect.GetErrorString();
EXPECT_TRUE(errStr.find(expected) != string::npos);
Expand Down
Loading