COMMUNITY

How to gen custom hxcpp output file?

how to gen custom hxcpp output file?

such like other platform, -js customname.js

–cpp bin/cpp ?here how to custom output name?

The js target does not generate separate source files, because that’s not practical (at least not without having to rely on a bundler). The cpp target does, and therefore you can only pick a directory to contain them. You can however use Context.onAfterGenerate to copy/move any generated files to their desired location. You’ll have to check if this runs before or after cpp compilation, as that may have implications on what you can and cannot do.

Best,
Juraj

I think it’s more about having customname.exe instead of MainClass.exe, which doesn’t seem possible.

The output file name will be the same as your main class name.
So you can rename your main class to --main App for example, then the output file will be App.exe

You can use the HAXE_OUTPUT_FILE define to rename the output executable.Putting -D HAXE_OUTPUT_FILE=MyCustomName in your hxml file will cause hxcpp to produce MyCustomName.exe.

3 Likes