forked from qt-creator/qt-creator
Let users set a global default for whether to amend the run environment
... with the paths of libraries used at link time. The value can still be set per run config. Task-number: QTCREATORBUG-20240 Change-Id: Ibe2425e95d791f93af2fba85a64be8bde6b31f5a Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
@@ -1220,6 +1220,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
|||||||
s->value(QLatin1String("ProjectExplorer/Settings/UseJom"), true).toBool();
|
s->value(QLatin1String("ProjectExplorer/Settings/UseJom"), true).toBool();
|
||||||
dd->m_projectExplorerSettings.autorestoreLastSession =
|
dd->m_projectExplorerSettings.autorestoreLastSession =
|
||||||
s->value(QLatin1String("ProjectExplorer/Settings/AutoRestoreLastSession"), false).toBool();
|
s->value(QLatin1String("ProjectExplorer/Settings/AutoRestoreLastSession"), false).toBool();
|
||||||
|
dd->m_projectExplorerSettings.addLibraryPathsToRunEnv =
|
||||||
|
s->value(QLatin1String("ProjectExplorer/Settings/AddLibraryPathsToRunEnv"), true).toBool();
|
||||||
dd->m_projectExplorerSettings.prompToStopRunControl =
|
dd->m_projectExplorerSettings.prompToStopRunControl =
|
||||||
s->value(QLatin1String("ProjectExplorer/Settings/PromptToStopRunControl"), false).toBool();
|
s->value(QLatin1String("ProjectExplorer/Settings/PromptToStopRunControl"), false).toBool();
|
||||||
dd->m_projectExplorerSettings.maxAppOutputLines =
|
dd->m_projectExplorerSettings.maxAppOutputLines =
|
||||||
@@ -1735,6 +1737,7 @@ void ProjectExplorerPluginPrivate::savePersistentSettings()
|
|||||||
s->setValue(QLatin1String("ProjectExplorer/Settings/WrapAppOutput"), dd->m_projectExplorerSettings.wrapAppOutput);
|
s->setValue(QLatin1String("ProjectExplorer/Settings/WrapAppOutput"), dd->m_projectExplorerSettings.wrapAppOutput);
|
||||||
s->setValue(QLatin1String("ProjectExplorer/Settings/UseJom"), dd->m_projectExplorerSettings.useJom);
|
s->setValue(QLatin1String("ProjectExplorer/Settings/UseJom"), dd->m_projectExplorerSettings.useJom);
|
||||||
s->setValue(QLatin1String("ProjectExplorer/Settings/AutoRestoreLastSession"), dd->m_projectExplorerSettings.autorestoreLastSession);
|
s->setValue(QLatin1String("ProjectExplorer/Settings/AutoRestoreLastSession"), dd->m_projectExplorerSettings.autorestoreLastSession);
|
||||||
|
s->setValue(QLatin1String("ProjectExplorer/Settings/AddLibraryPathsToRunEnv"), dd->m_projectExplorerSettings.addLibraryPathsToRunEnv);
|
||||||
s->setValue(QLatin1String("ProjectExplorer/Settings/PromptToStopRunControl"), dd->m_projectExplorerSettings.prompToStopRunControl);
|
s->setValue(QLatin1String("ProjectExplorer/Settings/PromptToStopRunControl"), dd->m_projectExplorerSettings.prompToStopRunControl);
|
||||||
s->setValue(QLatin1String("ProjectExplorer/Settings/MaxAppOutputLines"), dd->m_projectExplorerSettings.maxAppOutputLines);
|
s->setValue(QLatin1String("ProjectExplorer/Settings/MaxAppOutputLines"), dd->m_projectExplorerSettings.maxAppOutputLines);
|
||||||
s->setValue(QLatin1String("ProjectExplorer/Settings/MaxBuildOutputLines"), dd->m_projectExplorerSettings.maxBuildOutputLines);
|
s->setValue(QLatin1String("ProjectExplorer/Settings/MaxBuildOutputLines"), dd->m_projectExplorerSettings.maxBuildOutputLines);
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ public:
|
|||||||
bool useJom = true;
|
bool useJom = true;
|
||||||
bool autorestoreLastSession = false; // This option is set in the Session Manager!
|
bool autorestoreLastSession = false; // This option is set in the Session Manager!
|
||||||
bool prompToStopRunControl = false;
|
bool prompToStopRunControl = false;
|
||||||
|
bool addLibraryPathsToRunEnv = true;
|
||||||
int maxAppOutputLines = Core::Constants::DEFAULT_MAX_LINE_COUNT;
|
int maxAppOutputLines = Core::Constants::DEFAULT_MAX_LINE_COUNT;
|
||||||
int maxBuildOutputLines = Core::Constants::DEFAULT_MAX_LINE_COUNT;
|
int maxBuildOutputLines = Core::Constants::DEFAULT_MAX_LINE_COUNT;
|
||||||
StopBeforeBuild stopBeforeBuild = StopBeforeBuild::StopNone;
|
StopBeforeBuild stopBeforeBuild = StopBeforeBuild::StopNone;
|
||||||
@@ -73,6 +74,7 @@ inline bool operator==(const ProjectExplorerSettings &p1, const ProjectExplorerS
|
|||||||
&& p1.useJom == p2.useJom
|
&& p1.useJom == p2.useJom
|
||||||
&& p1.autorestoreLastSession == p2.autorestoreLastSession
|
&& p1.autorestoreLastSession == p2.autorestoreLastSession
|
||||||
&& p1.prompToStopRunControl == p2.prompToStopRunControl
|
&& p1.prompToStopRunControl == p2.prompToStopRunControl
|
||||||
|
&& p1.addLibraryPathsToRunEnv == p2.addLibraryPathsToRunEnv
|
||||||
&& p1.maxAppOutputLines == p2.maxAppOutputLines
|
&& p1.maxAppOutputLines == p2.maxAppOutputLines
|
||||||
&& p1.maxBuildOutputLines == p2.maxBuildOutputLines
|
&& p1.maxBuildOutputLines == p2.maxBuildOutputLines
|
||||||
&& p1.environmentId == p2.environmentId
|
&& p1.environmentId == p2.environmentId
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ ProjectExplorerSettings ProjectExplorerSettingsWidget::settings() const
|
|||||||
m_settings.mergeStdErrAndStdOut = m_ui.mergeStdErrAndStdOutCheckBox->isChecked();
|
m_settings.mergeStdErrAndStdOut = m_ui.mergeStdErrAndStdOutCheckBox->isChecked();
|
||||||
m_settings.wrapAppOutput = m_ui.wrapAppOutputCheckBox->isChecked();
|
m_settings.wrapAppOutput = m_ui.wrapAppOutputCheckBox->isChecked();
|
||||||
m_settings.useJom = m_ui.jomCheckbox->isChecked();
|
m_settings.useJom = m_ui.jomCheckbox->isChecked();
|
||||||
|
m_settings.addLibraryPathsToRunEnv = m_ui.addLibraryPathsToRunEnvCheckBox->isChecked();
|
||||||
m_settings.prompToStopRunControl = m_ui.promptToStopRunControlCheckBox->isChecked();
|
m_settings.prompToStopRunControl = m_ui.promptToStopRunControlCheckBox->isChecked();
|
||||||
m_settings.maxAppOutputLines = m_ui.maxAppOutputBox->value();
|
m_settings.maxAppOutputLines = m_ui.maxAppOutputBox->value();
|
||||||
m_settings.maxBuildOutputLines = m_ui.maxBuildOutputBox->value();
|
m_settings.maxBuildOutputLines = m_ui.maxBuildOutputBox->value();
|
||||||
@@ -127,6 +128,7 @@ void ProjectExplorerSettingsWidget::setSettings(const ProjectExplorerSettings &
|
|||||||
m_ui.mergeStdErrAndStdOutCheckBox->setChecked(m_settings.mergeStdErrAndStdOut);
|
m_ui.mergeStdErrAndStdOutCheckBox->setChecked(m_settings.mergeStdErrAndStdOut);
|
||||||
m_ui.wrapAppOutputCheckBox->setChecked(m_settings.wrapAppOutput);
|
m_ui.wrapAppOutputCheckBox->setChecked(m_settings.wrapAppOutput);
|
||||||
m_ui.jomCheckbox->setChecked(m_settings.useJom);
|
m_ui.jomCheckbox->setChecked(m_settings.useJom);
|
||||||
|
m_ui.addLibraryPathsToRunEnvCheckBox->setChecked(m_settings.addLibraryPathsToRunEnv);
|
||||||
m_ui.promptToStopRunControlCheckBox->setChecked(m_settings.prompToStopRunControl);
|
m_ui.promptToStopRunControlCheckBox->setChecked(m_settings.prompToStopRunControl);
|
||||||
m_ui.maxAppOutputBox->setValue(m_settings.maxAppOutputLines);
|
m_ui.maxAppOutputBox->setValue(m_settings.maxAppOutputLines);
|
||||||
m_ui.maxBuildOutputBox->setValue(m_settings.maxBuildOutputLines);
|
m_ui.maxBuildOutputBox->setValue(m_settings.maxBuildOutputLines);
|
||||||
|
|||||||
@@ -97,6 +97,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QCheckBox" name="addLibraryPathsToRunEnvCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Add linker library search paths to run environment</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QCheckBox" name="showCompileOutputCheckBox">
|
<widget class="QCheckBox" name="showCompileOutputCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -104,7 +111,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="4" column="1">
|
||||||
<widget class="QWidget" name="widget" native="true">
|
<widget class="QWidget" name="widget" native="true">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
@@ -159,7 +166,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="5" column="1">
|
||||||
<widget class="QWidget" name="widget_1" native="true">
|
<widget class="QWidget" name="widget_1" native="true">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
|
|||||||
@@ -33,6 +33,8 @@
|
|||||||
|
|
||||||
#include <projectexplorer/localenvironmentaspect.h>
|
#include <projectexplorer/localenvironmentaspect.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
|
#include <projectexplorer/projectexplorer.h>
|
||||||
|
#include <projectexplorer/projectexplorersettings.h>
|
||||||
#include <projectexplorer/runconfigurationaspects.h>
|
#include <projectexplorer/runconfigurationaspects.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
|
||||||
@@ -88,6 +90,8 @@ public:
|
|||||||
QbsRunConfiguration::QbsRunConfiguration(Target *target)
|
QbsRunConfiguration::QbsRunConfiguration(Target *target)
|
||||||
: RunConfiguration(target, QBS_RC_PREFIX)
|
: RunConfiguration(target, QBS_RC_PREFIX)
|
||||||
{
|
{
|
||||||
|
m_usingLibraryPaths = ProjectExplorerPlugin::projectExplorerSettings().addLibraryPathsToRunEnv;
|
||||||
|
|
||||||
auto envAspect = new LocalEnvironmentAspect(this,
|
auto envAspect = new LocalEnvironmentAspect(this,
|
||||||
[](RunConfiguration *rc, Environment &env) {
|
[](RunConfiguration *rc, Environment &env) {
|
||||||
static_cast<QbsRunConfiguration *>(rc)->addToBaseEnvironment(env);
|
static_cast<QbsRunConfiguration *>(rc)->addToBaseEnvironment(env);
|
||||||
|
|||||||
@@ -30,6 +30,8 @@
|
|||||||
#include <coreplugin/variablechooser.h>
|
#include <coreplugin/variablechooser.h>
|
||||||
#include <projectexplorer/localenvironmentaspect.h>
|
#include <projectexplorer/localenvironmentaspect.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
|
#include <projectexplorer/projectexplorer.h>
|
||||||
|
#include <projectexplorer/projectexplorersettings.h>
|
||||||
#include <projectexplorer/projectnodes.h>
|
#include <projectexplorer/projectnodes.h>
|
||||||
#include <projectexplorer/runnables.h>
|
#include <projectexplorer/runnables.h>
|
||||||
#include <projectexplorer/runconfigurationaspects.h>
|
#include <projectexplorer/runconfigurationaspects.h>
|
||||||
@@ -69,6 +71,9 @@ const char USE_LIBRARY_SEARCH_PATH[] = "QmakeProjectManager.QmakeRunConfiguratio
|
|||||||
DesktopQmakeRunConfiguration::DesktopQmakeRunConfiguration(Target *target)
|
DesktopQmakeRunConfiguration::DesktopQmakeRunConfiguration(Target *target)
|
||||||
: RunConfiguration(target, QMAKE_RC_PREFIX)
|
: RunConfiguration(target, QMAKE_RC_PREFIX)
|
||||||
{
|
{
|
||||||
|
m_isUsingLibrarySearchPath
|
||||||
|
= ProjectExplorerPlugin::projectExplorerSettings().addLibraryPathsToRunEnv;
|
||||||
|
|
||||||
addExtraAspect(new ExecutableAspect(this));
|
addExtraAspect(new ExecutableAspect(this));
|
||||||
addExtraAspect(new LocalEnvironmentAspect(this, [](RunConfiguration *rc, Environment &env) {
|
addExtraAspect(new LocalEnvironmentAspect(this, [](RunConfiguration *rc, Environment &env) {
|
||||||
static_cast<DesktopQmakeRunConfiguration *>(rc)->addToBaseEnvironment(env);
|
static_cast<DesktopQmakeRunConfiguration *>(rc)->addToBaseEnvironment(env);
|
||||||
|
|||||||
Reference in New Issue
Block a user