News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

I can't run a command only build target

Started by ollydbg, September 16, 2023, 04:57:28 AM

Previous topic - Next topic

ollydbg

Hi, I have a build target named "MakePackage", in this target, I select its type is "command only".

In the pre-build or post-build script, I wrote the command like:


cmd /c MakePackageRelease.cmd


With this command, I just copy all the exes and dlls to a specified folder.

I used this for a long time. But with the recent SVN C::B, I see this function does not work, because when I click the "run" button of the target, it will prompt

[Window Title]
codeblocks.exe

[Content]
You must select a host application to "run" a commands-only target...

[OK]


Which means I have to specify a host program?

So, I believe this is a regression. :)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

ollydbg

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

ollydbg

Please note that the "commands only" type build target has the "executable" option disable, so I can't set a executable of this target.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Miguel Gimenez

The commits in that ticket are related to the Run button enabled state, not to execution. See my reply in the ticket.

ollydbg

Quote from: Miguel Gimenez on September 16, 2023, 11:48:14 AM
The commits in that ticket are related to the Run button enabled state, not to execution. See my reply in the ticket.

Oh, sorry, I think I have made a mistake.

For a commands only target, it can be "build", I mean The commands I wrote in the "pre-build" and "post-build" option, which can be run if I click the "Build" button.

But this kinds of targets can NOT be executed, so the "Run button" get disabled.

That's a normal behavior, and I have made a mistake, I should click the build button, not the run button. Sorry about the noise.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Miguel Gimenez

Then, should the Run button be disabled always for Command only targets?

ollydbg

Quote from: Miguel Gimenez on September 16, 2023, 12:55:41 PM
Then, should the Run button be disabled always for Command only targets?

I think for a command only targets, when I build this target, it just run some commands.
What is the result of the running commands, maybe it generate an exe file? In this case, "Run" button is needed.

In-fact, I have other minor issues about the "command only targets", I see that the "Search directories" in the Build option is disabled. Which means if I have a to add some code in my command to add a directory to the PATH variable when I "Build" the target. I'm not sure you understand this, I mean in normal Console or GUI targets, the "Linker's search directories" is automatically added to the PATH when I "Build" or "Run" the targets. But currently I can't edit that field.

This is a example cmd(named AAA.cmd), the contents are like below:


@echo off
set "current_path=%~dp0"
set "new_path1=%current_path%lib"
set PATH=%new_path1%;%PATH%
start "" /wait "C:\Program Files (x86)\AAAAA\ABC.exe"


Then I have put the below code in the "pre or post build steps" in the command only target's build options.


cmd /c AAA.cmd
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.