Conditional IncBin
BlitzMax Forums/BlitzMax Programming/Conditional IncBin
| ||
I'm trying to turn IncBin support on/off in my program to avoid the long compile times until I'm building to release, but the problem is that putting IncBin commands in a function, regardless of whether it gets called or not, results in the media being included with the exe. Ex: Global buildMode = 1, buildStr$ ' 1 = Dev | 2 = Release If buildMode = 2 Then buildStr$ = "incbin::" If buildMode = 2 Then IncludeBin Global img = LoadImage(buildStr$ + "gfx/img.png") Function IncludeBin() Print "hit" IncBin "gfx/img.png" End FunctionSwitching the buildMode doesn't stop the image from being included, the only way to do so is to comment out the function altogether. It's odd because "hit" never gets printed either, even though the IncBin command is being called somehow. Is there a way to do this? |
| ||
This is why I've been asked for ?Release alongside ?Debug. The powers that be have seen it unneccessary, apparently. |
| ||
I would also be handy for making demo/full builds. Steve |
| ||
gets my vote, the demo version idea would be brilliant :D |
| ||
Didn't the other blitzbasics let you do conditional compilation if it was a constant being compared? Does Blitzmax do this? Like: If someconstant stuff ; only include if true EndIf |
| ||
I think so but the existance of ?debug gives some unsureness. Additional flags could be programmed by users themselfs, in src/bmk you find the BMK which does read and parse this precompiler commands. |
| ||
I think these should be included ?if ?else ?elseif |
| ||
Azathoth: You forgot -?Define -?Undefine -?EndIf I want macros, damnit. |
| ||
Yea, macros would be good; though I was really talking about using constants. Is '?EndIf' need? doesn't just '?' on its own terminate the conditional compilation block? |
| ||
Nope, gotta have ?Endif so it doesn't close, say, another scope. |
| ||
Oh ok |