Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Run.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Run {
static function main() {
RunMain.main();
}
}
1 change: 1 addition & 0 deletions extraRunParams.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-cp tools/run
6 changes: 5 additions & 1 deletion tools/hxcpp/Log.hx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import cpp.vm.Mutex;

#if neko
import neko.Lib;
#else
#elseif cpp
import cpp.Lib;
#end

Expand Down Expand Up @@ -65,7 +65,11 @@ class Log
printMutex.release();

if ((verbose || !terminate) && e != null)
#if (cpp || neko)
Lib.rethrow(e);
#else
throw e;
#end

if (terminate)
Tools.exit(1);
Expand Down
11 changes: 11 additions & 0 deletions tools/run/RunMain.hx
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ class RunMain

public static function executeHxcpp()
{
#if neko
if (!sys.FileSystem.exists("./hxcpp.n"))
return false;
#end

if (Sys.args().indexOf("-DHXCPP_NEKO_BUILDTOOL=1")<0)
{
Expand All @@ -104,6 +106,7 @@ class RunMain
compiled += ".exe";
if (FileSystem.exists(compiled))
{
#if neko
var dotN = FileSystem.stat("hxcpp.n").mtime.getTime();
var dotExe= FileSystem.stat(compiled).mtime.getTime();
if (dotExe<dotN)
Expand All @@ -112,14 +115,22 @@ class RunMain
Sys.println('Warning - $path file is out-of-date. Please delete or rebuild.');
}
else
#end
{
Sys.exit( Sys.command( compiled, Sys.args() ) );
}
}
}
}

#if neko
neko.vm.Loader.local().loadModule("./hxcpp.n");
#elseif eval
Sys.exit(Sys.command("haxe", ["-cp", "tools/hxcpp", "--run", "BuildTool"].concat(Sys.args())));
#else
#error
#end

return true;
}

Expand Down
Loading