From 93fa6ebc6d838ad74239b5e16c9f1edc2d9c2507 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 7 Oct 2016 16:35:17 +0200 Subject: [PATCH] QbsProjectManager: Allow to switch on qbs profiling via env variable We don't want to expose an option for this in the GUI, as the output is not easily discoverable and the information is mostly interesting for qbs developers. Change-Id: I79a11e3ad12880b9862690cf18bdd3188aa9c03c Reviewed-by: Jake Petroules --- src/plugins/qbsprojectmanager/qbsbuildstep.cpp | 1 + src/plugins/qbsprojectmanager/qbsprojectmanagerconstants.h | 2 ++ src/plugins/qbsprojectmanager/qbsprojectparser.cpp | 1 + 3 files changed, 4 insertions(+) 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);