diff --git a/language/lua/xmake.lua b/language/lua/xmake.lua new file mode 100644 index 0000000..4d4ccab --- /dev/null +++ b/language/lua/xmake.lua @@ -0,0 +1,40 @@ +-- xmake.lua for building Lua + +add_cxflags("/wd4530") +-- Target: Lua library and executables +target("lua") + set_kind("static") + set_languages("c99") + add_files("src/*.c") + remove_files("src/lua.c", "src/luac.c") + add_defines("LUA_COMPAT_5_3") + add_includedirs("src") + set_targetdir("$(buildir)/lib") + set_filename("lua.lib") + set_default(true) + +-- Target: Lua interpreter (lua) +target("lua_interpreter") + set_kind("binary") + set_languages("c99") + add_files("src/lua.c") + add_deps("lua") + add_includedirs("src") + + -- 设置目标文件名 + set_targetdir("$(buildir)/bin") + set_filename("lua.exe") + set_default(true) + +-- Target: Lua compiler (luac) +target("lua_compiler") + set_kind("binary") -- 可执行文件 + set_languages("c99") + add_files("src/luac.c") + add_deps("lua") -- 依赖 lua 库 + add_includedirs("src") + + -- 设置目标文件名 + set_targetdir("$(buildir)/bin") + set_filename("luac.exe") + set_default(true) \ No newline at end of file