User forums > Using Code::Blocks

Help? My pre build script fails; but only under CB.

<< < (3/3)

Pecan:

--- Quote from: rioki on August 31, 2009, 09:55:59 am ---I have MSys (MinGW) installed. Yes I ended up writing a shell script... Much more sane...

But I thing the way the pre and post-build scripts are executed is broken. In Code::Blocks (it seems) that every line is taken on its own and it is fed to something like exec(). Instead of passing the entire chunk to cmd or <insert configurable tool here>. You end up with the situation that you can't cd into a different directory and execute some command there.

I (was forced to) use Visual Studio (at my paying job) and coming from there I assumed that the post and pre build scripts run in cmd and you can basically copy and past cmd scripts there. Me bad for assuming that.

--- End quote ---

For me, grouping all the one-liners into a single .cmd file that accepts the CB macros works ok.

For example:

--- Code: ---cmd /c showargs.cmd $(TARGET_OBJECT_DIR)

--- End code ---

with contexts:
echo %0 %1
echo finished

would produce

--- Code: ---Target is up to date.
Running target post-build steps
cmd /c showargs.cmd gcc_mswu\toolbar
C:\Usr\Proj\test\toolbar>echo showargs.cmd gcc_mswu\toolbar
showargs.cmd gcc_mswu\toolbar
C:\Usr\Proj\test\toolbar>echo finished
finished
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings
 


--- End code ---

Navigation

[0] Message Index

[*] Previous page

Go to full version