Skip to content

Commit 218763a

Browse files
Christophe DelordChristophe Delord
authored andcommitted
add luax.lar to the pure lua release
1 parent 429756b commit 218763a

File tree

3 files changed

+31
-25
lines changed

3 files changed

+31
-25
lines changed

build.lua

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,27 +1197,31 @@ local function luax_archive(archive, compilation_targets)
11971197
},
11981198
},
11991199

1200-
-- Lua headers
1201-
F.map(compress "$tmp/lib/headers", {
1202-
"lua/lua.h",
1203-
"lua/luaconf.h",
1204-
"lua/lauxlib.h",
1205-
}),
1206-
1207-
-- Binary runtimes
1208-
compilation_targets : map(function(target)
1209-
local libs = F.flatten {
1210-
main_luax[target.name],
1211-
main_libluax[target.name],
1212-
libluax[target.name],
1213-
liblua[target.name],
1214-
openssl_libs[target.name],
1215-
}
1216-
if has_partial_ld(target) then
1217-
libs = { build_once("$tmp"/target.name/"obj"/"luax.o") { partial_ld[target.name], libs } }
1218-
end
1219-
return F.map(compress("$tmp/lib/targets"/target.name), libs)
1220-
end),
1200+
compilation_targets and {
1201+
1202+
-- Lua headers
1203+
F.map(compress "$tmp/lib/headers", {
1204+
"lua/lua.h",
1205+
"lua/luaconf.h",
1206+
"lua/lauxlib.h",
1207+
}),
1208+
1209+
-- Binary runtimes
1210+
compilation_targets : map(function(target)
1211+
local libs = F.flatten {
1212+
main_luax[target.name],
1213+
main_libluax[target.name],
1214+
libluax[target.name],
1215+
liblua[target.name],
1216+
openssl_libs[target.name],
1217+
}
1218+
if has_partial_ld(target) then
1219+
libs = { build_once("$tmp"/target.name/"obj"/"luax.o") { partial_ld[target.name], libs } }
1220+
end
1221+
return F.map(compress("$tmp/lib/targets"/target.name), libs)
1222+
end),
1223+
1224+
} or {},
12211225

12221226
}
12231227

@@ -1230,6 +1234,7 @@ acc(libraries) {
12301234
local luax_lar = targets : map2t(function(target)
12311235
return target.name, release and luax_archive("$tmp/dist"/target.name/"lib/luax.lar", cross and targets or F{target})
12321236
end)
1237+
luax_lar.lua = luax_archive("$tmp/dist/lua/lib/luax.lar")
12331238

12341239
--===================================================================
12351240
section "LuaX Lua implementation"
@@ -1694,9 +1699,10 @@ local dist = (function()
16941699
local cp_to = F.curry(function(dest, file)
16951700
return build.cp("$dist"/"lua"/dest/file:basename()) { file }
16961701
end)
1702+
local lar = {luax_lar.lua}
16971703
local files = {
16981704
binaries:filter(pure_lua) : map(cp_to"bin"),
1699-
libraries:filter(pure_lua) : map(cp_to"lib"),
1705+
(libraries:filter(pure_lua) .. lar) : map(cp_to"lib"),
17001706
}
17011707
local name = F{
17021708
"luax",

luax/luax_assets.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ local function find_archive()
4545

4646
local N = F.keys(arg) : minimum()
4747

48-
for i = N, 0 do
48+
for i = 0, N, -1 do
4949

5050
local path = findpath(arg[i])
5151
if path then

luax/luax_cmd_compile.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ local function print_targets()
5353
path and "" or " [NOT FOUND]"))
5454
end)
5555
local assets = require "luax_assets"
56-
if assets.path then
56+
if assets.path and assets.targets then
5757
local luax_lar = assets.path:gsub("^"..home, "~")
5858
if assets.targets[sys.name] then
5959
print(("%-22s%s"):format("native", luax_lar))
@@ -66,7 +66,7 @@ local function print_targets()
6666
end
6767
print("")
6868
print(("Lua compiler: %s (LuaX %s)"):format(_VERSION, _LUAX_VERSION))
69-
if assets.path then
69+
if assets.path and assets.targets then
7070
local build_config = require "luax_build_config"
7171
print(("C compiler : %s"):format(build_config.compiler.full_version))
7272
end

0 commit comments

Comments
 (0)