Skip to content

Commit 3125bef

Browse files
author
Apprentice Alchemist
committed
More stuff.
1 parent fe539a5 commit 3125bef

File tree

5 files changed

+64
-1
lines changed

5 files changed

+64
-1
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
lua51.*
21
out/*
32
Main.hx
43
script.lua

Run.hx

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import sys.io.File;
2+
import sys.io.Process;
3+
4+
using StringTools;
5+
using Lambda;
6+
7+
class Run {
8+
public static function main() {
9+
final args = Sys.args();
10+
final c = Sys.getCwd();
11+
if (args[0] == "rebuild") {
12+
rebuild(args.pop());
13+
}
14+
Sys.setCwd(c);
15+
}
16+
17+
static function rebuild(thispath:String) {
18+
var hxcpp_path:String;
19+
{
20+
final proc = new sys.io.Process("haxelib", ["libpath", "hxcpp"]);
21+
proc.exitCode();
22+
hxcpp_path = proc.stdout.readAll().toString();
23+
proc.close();
24+
}
25+
Sys.setCwd(thispath + "LuaJIT/src");
26+
if (Sys.systemName() == "Windows") {
27+
setupVS();
28+
// Sys.command(hxcpp_path.replace("/", "\\") + "msvc64-setup.bat");
29+
Sys.command("msvcbuild.bat");
30+
File.copy("lua51.dll", "../../lib/Windows64/lua51.dll");
31+
File.copy("lua51.dll", "../../lib/Windows64/lua51.dll");
32+
} else {
33+
Sys.command("make");
34+
if (Sys.systemName() == "Linux")
35+
File.copy("libluajit-5.1.so", "../../lib/Linux64/libluajit-5.1.so");
36+
else
37+
File.copy("libluajit-5.1.dylib", "../../lib/Mac64/libluajit-5.1.dylib");
38+
}
39+
Sys.setCwd(thispath);
40+
}
41+
42+
static function setupVS() {
43+
// var proc = new sys.io.Process("C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vswhere.exe", [
44+
// "-latest",
45+
// "-products",
46+
// "*",
47+
// "-requires",
48+
// "Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
49+
// "-property",
50+
// "installationPath"
51+
// ]);
52+
// proc.exitCode();
53+
// var p = proc.stdout.readAll().toString().split("\n");
54+
// p.pop();
55+
// var path = p.pop();
56+
// trace(path);
57+
// Sys.command(path + "\\VC\\Auxiliary\\Build\\vcvars64.bat",[]);
58+
// proc.close();
59+
}
60+
}

lib/Windows64/lua51.dll

514 KB
Binary file not shown.

lib/Windows64/lua51.lib

59.2 KB
Binary file not shown.

src/Lua.hx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,17 @@ enum abstract GcOptions(Int) {
9797
#elseif cpp
9898
@:include("lua.hpp")
9999
@:buildXml("
100+
<copyFile name='lua51.dll' from='${haxelib:hxlua}/lib/${BINDIR}' overwrite='true' toolId='exe' if='windows'>
101+
<copyFile name='libluajit-5.1.so' from='${haxelib:hxlua}/lib/${BINDIR}' overwrite='true' toolId='exe' if='linux'>
102+
<copyFile name='libluajit-5.1.dylib' from='${haxelib:hxlua}/lib/${BINDIR}' overwrite='true' toolId='exe' if='mac'>
100103
<files id='haxe'>
101104
<compilerflag value='-I${haxelib:hxlua}/LuaJIT/src'/>
102105
</files>
103106
<target id='haxe'>
104107
<libpath name='${haxelib:hxlua}/lib/${BINDIR}'/>
105108
<lib base='lua51' if='windows'/>
106109
<lib base='luajit-5.1' unless='windows'/>
110+
<vflag name='-Wl,-rpath=$ORIGIN' value='' unless='windows'/>
107111
</target>
108112
")
109113
#end

0 commit comments

Comments
 (0)