HaxeFoundation / HaxeFoundation/haxe
[cpp] Can we simplify forced release compilation?
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
We use the following pattern in Lime and OpenFL to improve debug performance:
```haxe
#if !lime_debug
@:fileXml('tags="haxe,release"')
@:noDebug
#end
class SomeClass { ... }
```
We used to experience _extremely_ slow debug performance, since core APIs (especially our OpenGL bindings) we compiled for debug, when a user meant to debug their code, not the Lime or OpenFL libraries.
The solution we are using (above) is currently flagging files to _not_ include debug information from Haxe (`@:noDebug`) and to compile using release optimizations when building the final C++ (such as "-O2" instead of "-g" in GCC) ... but it's a pain to write :smile:
We would love if this could be simplified -- a way to specify that a whole haxelib (at least a class path) will be flagged for release by default instead of debug would be incredible.
As an alternative, I wonder if the meta-data could at least be simpler, such as `@:noDebug` implying `tags="haxe,release"` by default?
Thank you
Contributor guide
Assessment
This issue has not been assessed yet.