diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index 54339d3697b..9c20578393e 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -412,6 +412,7 @@ void QbsBuildStep::build() options.setChangedFiles(m_changedFiles); options.setFilesToConsider(m_changedFiles); options.setActiveFileTags(m_activeFileTags); + options.setLogElapsedTime(!qgetenv(Constants::QBS_PROFILING_ENV).isEmpty()); QString error; m_job = qbsProject()->build(options, m_products, error); diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanagerconstants.h b/src/plugins/qbsprojectmanager/qbsprojectmanagerconstants.h index a446ef62ca7..05667062f53 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanagerconstants.h +++ b/src/plugins/qbsprojectmanager/qbsprojectmanagerconstants.h @@ -65,5 +65,7 @@ const char QBS_FORCE_PROBES_KEY[] = "qbspm.forceProbes"; static const char QBS_GROUP_ICON[] = ":/qbsprojectmanager/images/groups.png"; static const char QBS_PRODUCT_OVERLAY_ICON[] = ":/qbsprojectmanager/images/productgear.png"; +const char QBS_PROFILING_ENV[] = "QTC_QBS_PROFILING"; + } // namespace Constants } // namespace QbsProjectManager diff --git a/src/plugins/qbsprojectmanager/qbsprojectparser.cpp b/src/plugins/qbsprojectmanager/qbsprojectparser.cpp index 10953f64c6c..eeb24d56375 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectparser.cpp +++ b/src/plugins/qbsprojectmanager/qbsprojectparser.cpp @@ -109,6 +109,7 @@ void QbsProjectParser::parse(const QVariantMap &config, const Environment &env, params.setLibexecPath(libExecDirectory()); params.setProductErrorMode(qbs::ErrorHandlingMode::Relaxed); params.setPropertyCheckingMode(qbs::ErrorHandlingMode::Relaxed); + params.setLogElapsedTime(!qgetenv(Constants::QBS_PROFILING_ENV).isEmpty()); m_qbsSetupProjectJob = m_project.setupProject(params, QbsManager::logSink(), 0);