Is it possible to abort compilation from the code?

40 views
Skip to first unread message

Hitmark7

unread,
Mar 24, 2016, 2:13:11 PM3/24/16
to Haxe
Hello.

I'm writting a program for several targets, but some features are not available for all of them. I would like to abort the compilation if another programmer tries to use these features on the wrong target. I'm using conditional compilation this way:

#if neko
   
return neko.Web.getURI();
#elseif php
   
return php.Web.getURI();
#else
   
<Insert here something that aborts compilation "gracefully", maybe even with a custom error message>
#end

Any ideas? I would hate to intentionally write a malformed expression in order to raise a syntactic error.

Thanks!

Simon Krajewski

unread,
Mar 24, 2016, 2:15:13 PM3/24/16
to haxe...@googlegroups.com
#error Yes

Simon
Reply all
Reply to author
Forward
0 new messages