From 7385e0870ea516bf7e151cb0dc06c260d625e015 Mon Sep 17 00:00:00 2001 From: Sky Johnson Date: Sat, 25 Jan 2025 22:10:49 -0600 Subject: [PATCH] Add generate to the go.mod --- .idea/vcs.xml | 2 -- generate.go | 6 ++++++ go.mod | 2 +- wrapper.go | 9 +++------ 4 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 generate.go diff --git a/.idea/vcs.xml b/.idea/vcs.xml index b56ca89..35eb1dd 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,7 +2,5 @@ - - \ No newline at end of file diff --git a/generate.go b/generate.go new file mode 100644 index 0000000..2a62e30 --- /dev/null +++ b/generate.go @@ -0,0 +1,6 @@ +//go:build exclude + +package luajit + +//go:generate cp -r ../include ./include +//go:generate cp -r ../lib ./lib diff --git a/go.mod b/go.mod index b557b7f..8b18884 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module git.sharkk.net/Sky/LuaJIT-to-Go -go 1.23.4 +go 1.23.4 \ No newline at end of file diff --git a/wrapper.go b/wrapper.go index 2440847..f8968bd 100644 --- a/wrapper.go +++ b/wrapper.go @@ -1,24 +1,21 @@ package luajit /* -#cgo CFLAGS: -I${SRCDIR}/luajit -#cgo windows LDFLAGS: -L${SRCDIR}/luajit -llua51 -#cgo !windows LDFLAGS: -L${SRCDIR}/luajit -lluajit +#cgo CFLAGS: -I${SRCDIR}/include +#cgo windows LDFLAGS: -L${SRCDIR}/lib -llua51 +#cgo !windows LDFLAGS: -L${SRCDIR}/lib -lluajit #include #include #include #include -void init_dll_paths(void); - static int do_string(lua_State *L, const char *s) { int status = luaL_loadstring(L, s); if (status) return status; return lua_pcall(L, 0, LUA_MULTRET, 0); } - static int do_file(lua_State *L, const char *filename) { int status = luaL_loadfile(L, filename); if (status) return status;