MCPcopy Create free account
hub / github.com/KDE/kdevelop / compiler

Method compiler

plugins/cmake/cmakemanager.cpp:805–823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

803}
804
805KDevelop::Path CMakeManager::compiler(KDevelop::ProjectTargetItem* item) const
806{
807 const auto targetInfo = targetInformation(item);
808 if (targetInfo.sources.isEmpty()) {
809 qCDebug(CMAKE) << "could not find target" << item->text();
810 return {};
811 }
812
813 const auto info = m_projects[item->project()].data.compilationData.files[targetInfo.sources.constFirst()];
814 const auto lang = info.language;
815 if (lang.isEmpty()) {
816 qCDebug(CMAKE) << "no language for" << item << item->text() << info.defines << targetInfo.sources.constFirst();
817 return {};
818 }
819 const QString var = QLatin1String("CMAKE_") + lang + QLatin1String("_COMPILER");
820 const auto ret = CMake::readCacheValues(KDevelop::Path(buildDirectory(item), QStringLiteral("CMakeCache.txt")), {var});
821 qCDebug(CMAKE) << "compiler for" << lang << var << ret;
822 return KDevelop::Path(ret.value(var));
823}
824
825#include "cmakemanager.moc"
826#include "moc_cmakemanager.cpp"

Callers

nothing calls this directly

Calls 6

readCacheValuesFunction · 0.85
PathClass · 0.70
isEmptyMethod · 0.45
textMethod · 0.45
projectMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected