Hej !
I want to call a function in macro initialization context (called from the .hxml file).
This function is in a file that has some macro function and some not, separated by #if macro
directives.
public static function addDirectives(){
if( haxe.macro.Compiler.getDefine( "a_define" ) != null ){
haxe.macro.Compiler.define( "my_define" );
}
}
If I put this function in macro
section, compiler throws me macro-in-macro
but if I put it in !macro
compilers can’t find this function…
I think I could work if it was in another file but I don’t want to add a file just for one little macro initialization function.
is there any compiler directives that maybe kind of “separate” the macro contexts ?
Something like #if macro_init
?
What are my possibilities please ?
Thanks for your answers !