HaxeFoundation / HaxeFoundation/haxe

[cpp] Can we simplify forced release compilation?

Open
#8,026 2 comments 0 reactions 0 assignees View on GitHub
enhancement platform-cpp
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.