Which Flash SWF compiler uses compiler directives?
-
08-07-2019 - |
Solution
I've used mtasc
, and it does not support this kind of conditional compilation. However, it looks like Flex 3's mxmlc
has support for this via the -define
command line option. Also, Haxe does exactly what you want.
OTHER TIPS
The MXMLC compiler also supports conditional compilation, though it is pretty primitive and strangely-implemented.
They didn't implement 'ifdef'. Instead we just get the value after the comma from the assignment. While this works fine for string insertion, it's pretty confusing for booleans.
The following example would only compile the 'release' implementation of the method:
-define=CONFIG::debugging,false -define=CONFIG::release,true
Then in your source code:
CONFIG::debugging
private function configure():void {
// set up for debugging
}
CONFIG::release
private function configure():void {
// set up for release
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow