Speed up builds by skipping CFFI macro
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -94,6 +94,9 @@ class CFFIMacro {
|
||||
|
||||
cffiExpr = 'new cpp.Callable<$typeString> (cpp.Prime._loadPrime ("$library", "$method", "$typeSignature", $lazy))';
|
||||
|
||||
// Sys.println ("private static var " + field.name + ':$typeString = CFFI.loadPrime ("$library", "$method", "$typeSignature");');
|
||||
// Sys.println ("private static var " + field.name + ' = new cpp.Callable<$typeString> (cpp.Prime._loadPrime ("$library", "$method", "$typeSignature", $lazy));');
|
||||
|
||||
} else {
|
||||
|
||||
var args = typeSignature.length - 1;
|
||||
@@ -106,6 +109,8 @@ class CFFIMacro {
|
||||
|
||||
cffiExpr = 'new cpp.Callable<$typeString> (lime.system.CFFI.load ("$library", "$method", $args, $lazy))';
|
||||
|
||||
// Sys.println ("private static var " + field.name + ':$typeString = CFFI.load ("$library", "$method", $args);');
|
||||
|
||||
}
|
||||
|
||||
cffiType = TPath ( { pack: [ "cpp" ], name: "Callable", params: [ TPType (TFun (type.args, type.result).toComplexType ()) ] } );
|
||||
@@ -129,6 +134,20 @@ class CFFIMacro {
|
||||
|
||||
expr += ")";
|
||||
|
||||
// if (Context.defined ("cpp")) {
|
||||
|
||||
// Sys.println ('private static var $cffiName = new cpp.Callable<$typeString> (cpp.Prime._loadPrime ("$library", "$method", "$typeSignature", $lazy));');
|
||||
|
||||
// var _args = "";
|
||||
// for (i in 0...typeArgs.length) {
|
||||
// if (i > 0) _args += ", ";
|
||||
// _args += typeArgs[i].name + ":" + typeArgs[i].t.toString ();
|
||||
// }
|
||||
|
||||
// Sys.println ('private static function ${field.name} ($_args) { $expr; }');
|
||||
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
field.access.push (AInline);
|
||||
|
||||
@@ -214,7 +214,7 @@ class CFFI {
|
||||
|
||||
public static macro function loadPrime (library:String, method:String, signature:String, lazy:Bool = false):Dynamic {
|
||||
|
||||
#if (!display && !macro && cpp)
|
||||
#if (!display && !macro && cpp && !disable_cffi)
|
||||
return cpp.Prime.load (library, method, signature, lazy);
|
||||
#else
|
||||
var args = signature.length - 1;
|
||||
|
||||
Reference in New Issue
Block a user