Skip to content
This repository was archived by the owner on Apr 16, 2024. It is now read-only.

Latest commit

 

History

History
14 lines (13 loc) · 999 Bytes

File metadata and controls

14 lines (13 loc) · 999 Bytes
  1. Open Xcode;
  2. Create new project from template macOS "Cocoa Application";
  3. rename Supporting Files/main.m to Supporting Files/main.mm
  4. Go to Project Build Settings -> Search Paths -> Header Search Paths and add:
    1. full path to hx.NativeModule/hx/out/lib/cpp-mac-64/include directory & set "recursive"
    2. full path to your-haxelibs/hxcpp/3,4,64/include directory & set "recursive"
  5. Go to Target Settings -> General tab -> Linked Frameworks and Libraries and drag-n-drop hx.NativeModule/hx/out/lib/hx.fat-mac.a into there (or you can and any combination of libs from hx.NativeModule/hx/out/lib/cpp-mac-*/hx.*.a for any arch. I use the fat-lib for example.)
  6. Open Supporting Files/main.mm and:
    • #import <hxcpp.h> (or HxcppConfig.h from out/lib/cpp-mac-*/)
    • #import "Foo.h"
    • HX_TOP_OF_STACK hx::Boot(); __boot_all(); into the body of method main
    • fzzr::example::Foo_obj::test(); as next line after __boot_all()

That's all.