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 <jake.petroules@qt.io>
This commit is contained in:
Christian Kandeler
2016-10-07 16:35:17 +02:00
parent 21258bac46
commit 93fa6ebc6d
3 changed files with 4 additions and 0 deletions

View File

@@ -412,6 +412,7 @@ void QbsBuildStep::build()
options.setChangedFiles(m_changedFiles); options.setChangedFiles(m_changedFiles);
options.setFilesToConsider(m_changedFiles); options.setFilesToConsider(m_changedFiles);
options.setActiveFileTags(m_activeFileTags); options.setActiveFileTags(m_activeFileTags);
options.setLogElapsedTime(!qgetenv(Constants::QBS_PROFILING_ENV).isEmpty());
QString error; QString error;
m_job = qbsProject()->build(options, m_products, error); m_job = qbsProject()->build(options, m_products, error);

View File

@@ -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_GROUP_ICON[] = ":/qbsprojectmanager/images/groups.png";
static const char QBS_PRODUCT_OVERLAY_ICON[] = ":/qbsprojectmanager/images/productgear.png"; static const char QBS_PRODUCT_OVERLAY_ICON[] = ":/qbsprojectmanager/images/productgear.png";
const char QBS_PROFILING_ENV[] = "QTC_QBS_PROFILING";
} // namespace Constants } // namespace Constants
} // namespace QbsProjectManager } // namespace QbsProjectManager

View File

@@ -109,6 +109,7 @@ void QbsProjectParser::parse(const QVariantMap &config, const Environment &env,
params.setLibexecPath(libExecDirectory()); params.setLibexecPath(libExecDirectory());
params.setProductErrorMode(qbs::ErrorHandlingMode::Relaxed); params.setProductErrorMode(qbs::ErrorHandlingMode::Relaxed);
params.setPropertyCheckingMode(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); m_qbsSetupProjectJob = m_project.setupProject(params, QbsManager::logSink(), 0);