Force unimported hx file to be compiled on the cpp target

42 views
Skip to first unread message

Rui Campos

unread,
May 13, 2014, 10:26:47 AM5/13/14
to haxe...@googlegroups.com
Hi,

This is a cpp specific question, I'm not sure what the behaviour is in other targets.

How do I force a hx file to be compiled by haxe when that file is never imported or referenced? By compiling I mean that the file gets generated to cpp, and then appears on the Build.xml. I read about the macros keep, include, etc.. I tried them out but was unsuccessful, maybe I'm doing something wrong, still it would be cool to have some tips! :)

Thanks!

Luca

unread,
May 13, 2014, 1:43:58 PM5/13/14
to haxe...@googlegroups.com
This isn't a c++ specific question :)

Just add the file name to the compiler arguments.

haxe File.hx ... other args

will include File.hx in the compile.

Hugh

unread,
May 14, 2014, 12:28:54 AM5/14/14
to haxe...@googlegroups.com

Hi,

You need to refer to the file - so either on the command line as suggested, or "import" it.  If it is like a bunch of plugins, probably easiest to import all the plugins together from a single "PluginManager" that you know will be linked in somehow.

Then you will need to  @:keep all the plugin classes, so the dead-code-elimination does not remove them.

Hugh

Juraj Kirchheim

unread,
May 14, 2014, 3:46:56 AM5/14/14
to haxe...@googlegroups.com
I would add that the extension is optional. You can just `haxe path.to.Module`.
> --
> To post to this group haxe...@googlegroups.com
> http://groups.google.com/group/haxelang?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Haxe" group.
> For more options, visit https://groups.google.com/d/optout.

Rui Campos

unread,
May 14, 2014, 6:07:20 AM5/14/14
to haxe...@googlegroups.com
Damn! Can't believe it was that simple... Guess that's what you get when you start hacking into an existing complex system, and don't properly study the basics :) 

Thanks!
Reply all
Reply to author
Forward
0 new messages