Yes! You use the wrong target...
Codeblocks has 4 hierarchies:
1) Workspace (loose collection of projects
2) Projects (collection of targets that have something in common, like compiler options)
3) Virtual targets, a collection of targets, that have to build at the same time (can not have any speciffic settings)
4) Targets: The actual receipts to make your program
Your project is build like this:
hello_exceptions <- Project
|
|----- Debug_clang900 <-- Target
|----- Release_clang900 <-- Target
And your pre and post build steps look like this:
hello_exceptions
|
|----- Debug_clang900
| |-----Post build [[IO.copy log]]
|
|----- Release_clang900
|---- Pre build: [[Log()]]
Codeblocks starts at the top and goes down the tree, but only one branch. If you build "Debug_clang900" target only this build steps are executed....
So you can do this (Solution 1):
hello_exceptions
|
|----- Debug_clang900
| |----- Post build [[IO.copy log]]
|
|----- Release_clang900
|---- Post build [[IO.copy log]]
|---- Pre build: [[Log()]]
or this (Solution 2):
hello_exceptions
|---- Post build [[IO.copy log]]
|
|----- Debug_clang900
| |----- Pre build: [[Log()]]
|
|----- Release_clang900
Or you select the right target:
To select a target:
Build->Select Target->Debug_clang900
Build->Rebuild
And you will get the copied log
To fix the post build steps (solution 1)
Project->Build options->Select Debug_clang900 on the left->Pre/Post build steps->Copy your script -> Select Release_clang900 on the left-> Pre/Post build steps-> paste the script
To fix the project (solution 2)
Remove the Script from Project->Build options->Select Debug_clang900 on the left->Pre/Post build steps
Add it to Project->Build options->Select Project name on the left->Pre/Post build steps
[Edit:] I messed up the debug and release things. Now they should be in sync with your project file