Skip to content

Commit

Permalink
Attempt build fix (1)
Browse files Browse the repository at this point in the history
  • Loading branch information
arBmind committed Jan 4, 2025
1 parent 72cd0ef commit 1036c22
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <projectexplorer/projectmanager.h>
#include <projectexplorer/projecttree.h>
#include <projectexplorer/runconfigurationaspects.h>
#include <projectexplorer/devicesupport/devicekitaspects.h>
#include <projectexplorer/runcontrol.h>
#include <projectexplorer/target.h>

Expand Down Expand Up @@ -241,7 +242,7 @@ void QbsProjectManagerPlugin::initialize()
connect(m_reparseQbs, &QAction::triggered,
this, &QbsProjectManagerPlugin::reparseCurrentProject);

connect(Core::EditorManager::instance(), &Core::EditorManager::openWithVisualStudio, this, [this](const Utils::FilePath &path) {
connect(Core::EditorManager::instance(), &Core::EditorManager::openWithVisualStudio, this, [](const Utils::FilePath &path) {
RunConfiguration* rc = ProjectManager::startupRunConfiguration();
if (!rc)
return;
Expand Down Expand Up @@ -510,15 +511,19 @@ void QbsProjectManagerPlugin::generateVs2022Project()
if (!bc)
return;

auto commandLine = Utils::CommandLine{QbsSettings::qbsExecutableFilePath()};
const IDeviceConstPtr dev = BuildDeviceKitAspect::device(bc->kit());
if (!dev)
return;

auto commandLine = Utils::CommandLine{QbsSettings::qbsExecutableFilePath(dev)};
commandLine.addArg("generate");
commandLine.addArgs({"-g", "visualstudio2022"});
commandLine.addArgs(
{"-d", QDir::toNativeSeparators((bc->buildDirectory() / "vs2022").toString())});
commandLine.addArgs({"-f", QDir::toNativeSeparators(project->projectFilePath().toString())});
if (QbsSettings::useCreatorSettingsDirForQbs()) {
{"-d", (bc->buildDirectory() / "vs2022").nativePath()});
commandLine.addArgs({"-f", project->projectFilePath().nativePath()});
if (QbsSettings::useCreatorSettingsDirForQbs(dev)) {
commandLine.addArgs(
{"--settings-dir", QDir::toNativeSeparators(QbsSettings::qbsSettingsBaseDir())});
{"--settings-dir", QbsSettings::qbsSettingsBaseDir(dev).nativePath()});
}
commandLine.addArg("config:" + QbsBuildConfiguration::buildTypeName(bc->buildType()));

Expand Down

0 comments on commit 1036c22

Please sign in to comment.