User forums > Using Code::Blocks
Help? My pre build script fails; but only under CB.
MortenMacFly:
--- Quote from: rioki on August 29, 2009, 08:38:27 pm ---
--- Code: ---echo "Hello World"
--- End code ---
--- End quote ---
Ah - sorry, that cannot work, indeed. You can try to put everything in a batch file and run it providing the batch file with the required macro as command line params.
--- Quote from: rioki on August 29, 2009, 08:38:27 pm ---Execution of 'echo "Hello World"' in 'D:\Development\IcedLiquid\Trunk\IcedBlue\Installers\IcedBlue-SDK' failed.
--- End quote ---
Would that be the right base folder so that the command (especially "(TARGET_OBJECT_DIR)\*") makes sense in that folder?
Edit: Another Idea: Do you have a conflicting RD executable in the path (for example in the compiler directory) that would not have the same command line params (e.g. a unix derivate)?
rioki:
Ok:
--- Code: ---set TARGET_OUTPUT_BASENAME=IcedBlue-SDK
set TARGET_OUTPUT_DIR=bin\Debug\
set TARGET_OBJECT_DIR=obj\Debug\
set TARGET_NAME=Debug
set nsis=C:\Program Files\NSIS
xcopy /Y %TARGET_OUTPUT_BASENAME%.nsi %TARGET_OBJECT_DIR%
mkdir %TARGET_OBJECT_DIR%include
mkdir %TARGET_OBJECT_DIR%lib
mkdir %TARGET_OBJECT_DIR%bin
xcopy /Y ..\..\Tools\IcedResource\bin\%TARGET_NAME%\IcedResource.exe %TARGET_OBJECT_DIR%\bin
"%nsis%\makensis" %TARGET_OBJECT_DIR%\%TARGET_OUTPUT_BASENAME%.nsi
xcopy /Y %TARGET_OBJECT_DIR%%TARGET_OUTPUT_BASENAME%.exe %TARGET_OUTPUT_DIR%
rd /S /Q %TARGET_OBJECT_DIR%
--- End code ---
Works like a charm...
rioki:
FIXED:
Using the following command works:
--- Code: ---cmd /C "rd /Q /S $(TARGET_OBJECT_DIR"
--- End code ---
Why? Well in cmd rd or rmdir is not a program like on *nix. It is a built in command that is translated to API call.
Actually I would like "Shell to run command in:" option for win two... Would either add bash from MSys or cmd...
oBFusCATed:
If you want to have unix tools on windows you can install UnixTools or GnuWin32.
I'm using the former and I'm happy wiNIX user :) :)
rioki:
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.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version