Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I precompile a haxelib library so that it doesn't recompile every time I build the project?

I'm building a game with Haxe and NME. My code was compiling pretty quickly, but then I added the Nape physics engine with haxelib and now my compile time has increased by quite a lot.

My guess is that the Nape library is being recompiled every time, since it looks like the output is a single swf file, and removing the library reduces compile time back to what it was.

Is it possible to compile Nape once and not have to keep recompiling it every time I build? Is the solution different for the Neko target?

like image 389
davidscolgan Avatar asked Feb 16 '23 23:02

davidscolgan


1 Answers

I don't use NME, so i'm not sure how this fits into NME's build tools, but with plain haxe you would use a build server, eg:

haxe --wait 4000

to start the server, and then when building, add

--connect 4000

For as long as the build server is running and being used, the compiler will cache the results of compiling modules, so things like nape will only be compiled the first time round, and for as long as code is not changed, the only thing compiler will do is generate the .swf

like image 195
deltaluca Avatar answered Feb 21 '23 15:02

deltaluca