diff options
author | Thomas Epting <thomas.epting@stryker.com> | 2014-06-04 18:30:46 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@digia.com> | 2014-06-05 10:05:22 +0200 |
commit | 85519b333254ea544db25c3015772b5f2b248021 (patch) | |
tree | 669922175f54c6bb8d441c9687e4391bf373622a /src/lib/corelib/api | |
parent | 75c08d1f83a08424343eecbfc3d4e66a9e044186 (diff) |
Added an API to retrieve the current run/build environment
Needed in order to provide the correct run environment when starting a
product from within Qt Creator.
Change-Id: Iaa1356845daf485d7f4b361a76b559b0b7339ee7
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/lib/corelib/api')
-rw-r--r-- | src/lib/corelib/api/runenvironment.cpp | 12 | ||||
-rw-r--r-- | src/lib/corelib/api/runenvironment.h | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/corelib/api/runenvironment.cpp b/src/lib/corelib/api/runenvironment.cpp index 386a1769d..e8face23f 100644 --- a/src/lib/corelib/api/runenvironment.cpp +++ b/src/lib/corelib/api/runenvironment.cpp @@ -198,4 +198,16 @@ int RunEnvironment::runTarget(const QString &targetBin, const QStringList &argum return process.exitCode(); } +const QProcessEnvironment RunEnvironment::runEnvironment() const +{ + d->resolvedProduct->setupRunEnvironment(&d->engine, d->environment); + return d->resolvedProduct->runEnvironment; +} + +const QProcessEnvironment RunEnvironment::buildEnvironment() const +{ + d->resolvedProduct->setupBuildEnvironment(&d->engine, d->environment); + return d->resolvedProduct->buildEnvironment; +} + } // namespace qbs diff --git a/src/lib/corelib/api/runenvironment.h b/src/lib/corelib/api/runenvironment.h index 18ca65aae..f20fedbfc 100644 --- a/src/lib/corelib/api/runenvironment.h +++ b/src/lib/corelib/api/runenvironment.h @@ -57,6 +57,9 @@ public: int runShell(); int runTarget(const QString &targetBin, const QStringList &arguments); + const QProcessEnvironment runEnvironment() const; + const QProcessEnvironment buildEnvironment() const; + private: RunEnvironment(const Internal::ResolvedProductPtr &product, const QProcessEnvironment &environment, Settings *settings, |