QbsProjectManager: Add run config checkbox for using debug frameworks

As it already exists in the qmake project manager.

Task-number: QTCREATORBUG-20411
Change-Id: I8673e091b3f5772fdc1ddcac0e567f690960f1dd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Christian Kandeler
2018-07-27 14:05:23 +02:00
parent ec02dac36f
commit 11ffd3d702

View File

@@ -69,6 +69,12 @@ QbsRunConfiguration::QbsRunConfiguration(Target *target, Core::Id id)
addExtraAspect(libAspect);
connect(libAspect, &UseLibraryPathsAspect::changed,
envAspect, &EnvironmentAspect::environmentChanged);
if (HostOsInfo::isMacHost()) {
auto dyldAspect = new UseDyldSuffixAspect(this, "Qbs.RunConfiguration.UseDyldImageSuffix");
addExtraAspect(dyldAspect);
connect(dyldAspect, &UseDyldSuffixAspect::changed,
envAspect, &EnvironmentAspect::environmentChanged);
}
connect(project(), &Project::parsingFinished, this,
[envAspect]() { envAspect->buildEnvironmentHasChanged(); });
@@ -109,6 +115,10 @@ void QbsRunConfiguration::doAdditionalSetup(const RunConfigurationCreationInfo &
void QbsRunConfiguration::addToBaseEnvironment(Utils::Environment &env) const
{
if (auto dyldAspect = extraAspect<UseDyldSuffixAspect>()) {
if (dyldAspect->value())
env.set("DYLD_IMAGE_SUFFIX", "_debug");
}
bool usingLibraryPaths = extraAspect<UseLibraryPathsAspect>()->value();
const auto key = qMakePair(env.toStringList(), usingLibraryPaths);