From 62dd14d60878445fa5ac937b78317d9472affffd Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Tue, 5 Sep 2017 09:24:47 +0100 Subject: [PATCH 1/2] allow hosted application for all targets --- src/plugins/compilergcc/compilergcc.cpp | 36 ++++++++++++------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/src/plugins/compilergcc/compilergcc.cpp b/src/plugins/compilergcc/compilergcc.cpp index a967263fb1..dde496dcd2 100644 --- a/src/plugins/compilergcc/compilergcc.cpp +++ b/src/plugins/compilergcc/compilergcc.cpp @@ -2019,12 +2019,13 @@ int CompilerGCC::Run(ProjectBuildTarget* target) } if ( target->GetTargetType() == ttDynamicLib - || target->GetTargetType() == ttStaticLib ) + || target->GetTargetType() == ttStaticLib + || target->GetTargetType() == ttCommandsOnly ) { // check for hostapp if (target->GetHostApplication().IsEmpty()) { - cbMessageBox(_("You must select a host application to \"run\" a library...")); + cbMessageBox(_("You must select a host application to \"run\" this target...")); m_pProject->SetCurrentlyCompilingTarget(0); return -1; } @@ -2032,29 +2033,26 @@ int CompilerGCC::Run(ProjectBuildTarget* target) command << hostapStr << strSPACE; command << target->GetExecutionParameters(); } - else if (target->GetTargetType() != ttCommandsOnly) + + if (!target->GetHostApplication().IsEmpty()) { - command << execStr << strSPACE; - command << target->GetExecutionParameters(); - // each shell execution must be enclosed to "": - // xterm -T X -e /bin/sh -c "/usr/bin/cb_console_runner X" - // here is last \" - if (commandIsQuoted) - command << strQUOTE; + command << hostapStr << strSPACE; } else { - // commands-only target? - if (target->GetHostApplication().IsEmpty()) - { - cbMessageBox(_("You must select a host application to \"run\" a commands-only target...")); - m_pProject->SetCurrentlyCompilingTarget(0); - return -1; - } - command << hostapStr << strSPACE; - command << target->GetExecutionParameters(); + command << execStr << strSPACE; } + + command << target->GetExecutionParameters(); + + // each shell execution must be enclosed to "": + // xterm -T X -e /bin/sh -c "/usr/bin/cb_console_runner X" + // here is last \" + if (commandIsQuoted) command << strQUOTE; + Manager::Get()->GetMacrosManager()->ReplaceMacros(command, target); + Manager::Get()->GetMacrosManager()->ReplaceEnvVars(command); + wxString script = command; if (platform::macosx) From e60302fb56892306e00fb675baff867ac0254082 Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Mon, 31 May 2021 09:51:59 +0100 Subject: [PATCH 2/2] Expand env vars in hosted application and command line for run --- src/plugins/compilergcc/compilergcc.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/compilergcc/compilergcc.cpp b/src/plugins/compilergcc/compilergcc.cpp index dde496dcd2..f404f79994 100644 --- a/src/plugins/compilergcc/compilergcc.cpp +++ b/src/plugins/compilergcc/compilergcc.cpp @@ -2052,7 +2052,6 @@ int CompilerGCC::Run(ProjectBuildTarget* target) Manager::Get()->GetMacrosManager()->ReplaceMacros(command, target); Manager::Get()->GetMacrosManager()->ReplaceEnvVars(command); - wxString script = command; if (platform::macosx)