diff --git a/extraParams.hxml b/extraParams.hxml new file mode 100644 index 000000000..090eb6eae --- /dev/null +++ b/extraParams.hxml @@ -0,0 +1 @@ +--macro lime.Lib.extraParams() \ No newline at end of file diff --git a/lime/Lib.hx b/lime/Lib.hx index b4e569f9f..01f4b3b41 100644 --- a/lime/Lib.hx +++ b/lime/Lib.hx @@ -4,6 +4,11 @@ package lime; import haxe.PosInfos; import lime.utils.Log; +#if macro +import haxe.macro.Compiler; +import haxe.macro.Context; +#end + class Lib { @@ -11,6 +16,25 @@ class Lib { @:noCompletion private static var __sentWarnings = new Map (); + #if macro + public static function extraParams ():Void { + + if (!Context.defined ("tools")) { + + if (!Context.defined ("flash") && (!Context.defined ("js") || Context.defined ("nodejs"))) { + + Compiler.define ("lime-cffi"); + Compiler.define ("native"); + Compiler.define ("lime-curl"); + + } + + } + + } + #end + + public static function notImplemented (api:String, ?posInfo:PosInfos):Void { if (!__sentWarnings.exists (api)) {