I have a post-build command like this:
Now, if there are no .a files in the current directory (because they've all been moved to the lib/ directory already) this will return a non-zero exit code. This will prevent any later targets from being compiled.
For example, I just created a new project in an empty directory. I added an extra target after the default one (with a different .exe name ofcourse), and one .cpp file per target containing the most trivial program possible:
I then added the post-build command above ('move *.a lib/') to the default target (and created a directory lib just to be complete). Now when I 'build all', I get:
Project : Untitled1
Compiler : GNU GCC Compiler (called directly)
Directory : D:\C++\Projects\Example\
--------------------------------------------------------------------------------
Linking executable: Untitled1.exe
Running post-build step: default
mv: cannot stat `*.a': No such file or directory
Process terminated with status 1 (0 minutes, 1 seconds)
0 errors, 0 warnings
So the second target won't be built. Now imagine the first target was a .dll, so the post-build command would actually make sense. That post-build command would then be successful
only the first time after the .dll was last built. If the command was run even when the .dll didn't need to be rebuilt, Code::Blocks would return above error each and every time when 'rebuilding all' until the .dll was for whatever reason rebuilt.
Not good.