HaxeFoundation / HaxeFoundation/hxcpp

How to use generate cpp code in 3rd build system

Open
#585 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
330
Forks
227
Avg merge
2d 16h
Merged PRs (30d)
18

Description

Hello.

I use generated from haxe cpp files (Haxe Compiler 3.4.0, hxcpp-3.4.49) in cmake build system (with flags from original build system). And use generated cpp file in business logic module from my project. All work with module processed in main thread. GC inits in main function.

```
int main(int argc,char** argv) {

#if defined HAXE_ENABLED
HX_TOP_OF_STACK
hx::Boot();
__boot_all();
#endif // HAXE_ENABLED
```

And create necessary classes in proxy with selected StackContext

```
hx::StackContext *_hx_ctx = hx::gMultiThreadMode ? hx::tlsStackContext : hx::gMainThreadContext;
m_battle_manager = ::src::SharedTestBattleManager_obj::__alloc( _hx_ctx );
```

I have got a problem with undefined behavior in this module. Any variable corrupts after some time work. (Lua target don't have this problem)

Either I use it uncorrect or add not all necessary flags.

```
-DTARGET_OS_IPHONE
-DIPHONE
-DHXCPP_M64
-D_CRT_SECURE_NO_DEPRECATE
-DHX_UNDEFINE_H
-DHAXE_ENABLED
-DHXCPP_CHECK_POINTER
-DHXCPP_STACK_LINE
-DHXCPP_STACK_TRACE
-DHXCPP_VISIT_ALLOCS
-DHXCPP_API_LEVEL=331
```

Do I use generated cpp files correctly?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.