Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Script hooks added to build system
mandrav:
--- Quote from: duncanka on January 22, 2006, 03:21:10 am ---I haven't yet played around with this feature (don't have the build yet), but I have 2 questions about its usage:
<snip>
Anyway, kudos on a really cool feature! :D
--- End quote ---
When you go into "Project->Build options" a nice red message is displayed that your project is using build scripts so any options you set there might be overriden (depending on the scripts).
--- Quote from: rickg22 on January 22, 2006, 05:30:20 am ---Uk not understand scripting hooks... Uk thinks spooky magic. Uk stays away :lol:
(Translation: Can somebody explain a little further please? :) thanks! )
--- End quote ---
Open the attached project and go to "Project->Properties". Then open a script to see how it looks. Then go to "Settings->Compiler->Other" and enable full logging to see the command-linw when building.
Everything will suddenly make sense ;)
mandrav:
To further explain why it is a really cool feature, read along.
Using build scripts, you can group compiler/linker options into logical units. For example, "optimizations turned on" might mean "-O3 -s" in the compiler and the linker options.
Or for a more complex example, "my app uses unicode wxWidgets" mean pass "-D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -mthreads" as compiler options, add "$(WX)\include" etc in compiler search paths, add similar paths to the linker, etc.
Build scripts allow you to "define" such groups of options. If you look at the sample project I attached, there is a wx*.script which does what I just said.
Now, if I want to create a new wxWidgets-based app all I have to do is copy the script to the new app's folder, attach it to the project and hit "Build" :). See? No fiddling with all kinds of different settings in "Project->Build options". Instant project setup.
Not to mention the fact that the script may use custom variables and global variables ;).
Note however that using build scripts has not rendered "Project->Build options" obsolete. You can still use both. The scripts in the sample app set/unset specific options, they do not override the current build settings (although they could). So for example, I was able to set the "Warnings" compiler flag in the build options (as a project-wide setting) and not in the scripts.
Hope this makes more clear why build hook scripts are the best thing since sliced bread ;) :P.
mandrav:
--- Quote from: Takeshi Miya on January 21, 2006, 10:47:55 pm ---PS: Yiannis, can you update AngelScript to 2.5.0 (latest stable), so I can diff the patch to fix 64 bits compilation?
--- End quote ---
Updated in r1828.
Game_Ender:
So I just want to get the order of precendence right. If have turned on debug(-g) turned on in the project build settings but one of my build scripts for a target turns this off do I have still have the debug for that target.? Also can scripts add new options to the build options dialog? Or when you say "optimizations turned on" are you speeking of haveing a script called "optimizations turned on" attached to a target.
mandrav:
--- Quote ---So I just want to get the order of precendence right.
--- End quote ---
Scripts are executed before the build options are evaluated.
This means the script might alter the build options in any way imaginable.
--- Quote ---If have turned on debug(-g) turned on in the project build settings but one of my build scripts for a target turns this off do I have still have the debug for that target.?
--- End quote ---
Project build options are not inherited by targets but rather added to them. So, if a project build option is unset and the target does not specifically sets it, then it's unset for the target too.
--- Quote ---Also can scripts add new options to the build options dialog?
--- End quote ---
No.
--- Quote ---Or when you say "optimizations turned on" are you speeking of haveing a script called "optimizations turned on" attached to a target.
--- End quote ---
Exactly.
Basically, if you start using scripts, you would only use "Project->Build options" for simple project-wide options (like enable warnings, set the target CPU, etc).
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version