diff --git a/src/libs/utils/environment.cpp b/src/libs/utils/environment.cpp index e1a7ee63e31..7dbde6f3c8f 100644 --- a/src/libs/utils/environment.cpp +++ b/src/libs/utils/environment.cpp @@ -200,6 +200,8 @@ void Environment::prependOrSetLibrarySearchPaths(const FilePaths &values) This can be different from the system environment that \QC started in if the user changed it in \uicontrol Preferences > \uicontrol Environment > \uicontrol System > \uicontrol Environment. + + \sa originalSystemEnvironment() */ Environment Environment::systemEnvironment() @@ -208,6 +210,17 @@ Environment Environment::systemEnvironment() return *staticSystemEnvironment(); } +/*! + Returns \QC's original system environment. + + This is the full, unmodified environment that \QC was started with. + Use this environment to start processes that are built alongside \QC + and thus have the same library dependencies. This is particularly + relevant if \QC was started via Squish or another instance of \QC, + i.e. in testing or development contexts. + For all other processes, use \l systemEnvironment() or more specialized + variants such as the build environment, if applicable. +*/ const Environment &Environment::originalSystemEnvironment() { static const Environment env(QProcessEnvironment::systemEnvironment().toStringList());