CMakePM: Add CMake Profiler action

Change-Id: I17f258834724c37f0933d18b6214851be1965913
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Cristian Adam
2023-09-21 19:11:01 +02:00
parent 1d5ecdb5c7
commit ed1568309b
9 changed files with 88 additions and 12 deletions

View File

@@ -84,7 +84,8 @@ void FileApiReader::resetData()
void FileApiReader::parse(bool forceCMakeRun,
bool forceInitialConfiguration,
bool forceExtraConfiguration,
bool debugging)
bool debugging,
bool profiling)
{
qCDebug(cmakeFileApiMode) << "Parse called with arguments: ForceCMakeRun:" << forceCMakeRun
<< " - forceConfiguration:" << forceInitialConfiguration
@@ -109,6 +110,12 @@ void FileApiReader::parse(bool forceCMakeRun,
}
}
if (profiling) {
const FilePath file = TemporaryDirectory::masterDirectoryFilePath() / "cmake-profile.json";
args << "--profiling-format=google-trace"
<< "--profiling-output=" + file.path();
}
qCDebug(cmakeFileApiMode) << "Parameters request these CMake arguments:" << args;
const FilePath replyFile = FileApiParser::scanForCMakeReplyFile(m_parameters.buildDirectory);