From c96b22fac7f68ce7d0c09a073dd8a8ab192effd0 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 20 Feb 2025 10:14:06 +0100 Subject: [PATCH] CMake: Use simpler and more correct code for running custom targets Amends 5537a102e6df273afe63f9323410873831896c6d The arguments for the CMake call that runs custom targets with the `qtc_runnable` feature must be split with the rules for the platform that they will be run on. The conceptually correct thing is to use the OS type from the CMake executable (which is the build target info's targetFilePath). Using CommandLine with an empty executable is confusing and conceptually wrong. Use ProcessArgs::joinArgs with the right OS type directly instead. Change-Id: Ibc0aa087d07922e8720b4304b9d3ba17d774cc7d Reviewed-by: Cristian Adam --- src/plugins/projectexplorer/desktoprunconfiguration.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/desktoprunconfiguration.cpp b/src/plugins/projectexplorer/desktoprunconfiguration.cpp index 83c08acebda..0fcaa7d3ee3 100644 --- a/src/plugins/projectexplorer/desktoprunconfiguration.cpp +++ b/src/plugins/projectexplorer/desktoprunconfiguration.cpp @@ -145,7 +145,8 @@ void DesktopRunConfiguration::updateTargetInformation() const QStringList argumentsList = bti.additionalData.toMap()["arguments"].toStringList(); if (!argumentsList.isEmpty()) - aspect()->setArguments(CommandLine{"", argumentsList}.arguments()); + aspect()->setArguments( + ProcessArgs::joinArgs(argumentsList, bti.targetFilePath.osType())); emit aspect()->environmentChanged(); }