User forums > Using Code::Blocks
Conditional Pre-build step?
thomas_on_vacation:
--- Quote from: ironhead on April 11, 2008, 03:12:19 am ---The problem is that when using SVN_BUILD (or $SVN_BUILD or $(SVN_BUILD)) the 'true' clause is always being execute, despite the fact that I've defined SVN_BUILD as '0' (or if I leave it undefined) in the Custom Variables tab. I take it I'm missing something?
--- End quote ---
Hmm, darn... if that's the case, there's a bug :(
The true clause should be exectuted whenever the expression is not false, and "not false" is assumed if none of the following is the case:
1. whatever is inside () has the int value 0 or the ASCII code of '0'
2. whatever is inside () evaluates to an empty string, or
3. is not defined
Apparently, something is going wrong there, if "0" evaluates to true...
Unluckily, I won't be on a computer with Code::Blocks for the next 10 days still, so no bug hunting from my side... Martin, pretty please?
p.s.: Did you know that Windows XP lets you change a French keyboard to a German one with one mouse click, if you only care to look? I just found out... :)
ironhead:
--- Quote from: thomas_on_vacation on April 11, 2008, 07:53:50 pm ---Apparently, something is going wrong there, if "0" evaluates to true...
Unluckily, I won't be on a computer with Code::Blocks for the next 10 days still, so no bug hunting from my side... Martin, pretty please?
--- End quote ---
I'm not sure if it's executing the 'true' clause because of '0' (since I tested $if (0) and it behaved as expected). I think it's more that SVN_BUILD isn't being evaluated.
thomas:
Yes, you're right, it errornously uses the non-expanded string, thank you for pointing it out. There seems to be another problem related to the regex... at least it doesn't seem to grasp everything under all conditions.
A fix will be in svn shortly, probably this afternoon.
thomas:
r5006 should do... it still can't evaluate complicated stuff, but it should work for most reasonable stuff (including what you wanted). I've added a test project, too.
ironhead:
Perfect, thanx! I'll grab the C::B source from SVN and compile it (unless there is a new nightly on the way :) ).
Navigation
[0] Message Index
[*] Previous page
Go to full version