diff --git a/hxcpp-debug-server/hxcpp/debug/jsonrpc/Macro.hx b/hxcpp-debug-server/hxcpp/debug/jsonrpc/Macro.hx index ddd0c8b..d540467 100644 --- a/hxcpp-debug-server/hxcpp/debug/jsonrpc/Macro.hx +++ b/hxcpp-debug-server/hxcpp/debug/jsonrpc/Macro.hx @@ -6,7 +6,9 @@ import haxe.macro.Compiler; class Macro { macro public static function injectServer():Void { if (Context.defined("cpp") && Context.defined("debug")) { - Context.getType("hxcpp.debug.jsonrpc.Server"); + Context.onAfterInitMacros(() -> { + Context.getType("hxcpp.debug.jsonrpc.Server"); + }); Compiler.define("HXCPP_DEBUGGER"); } }