Build/Package: Improve printing

Former-commit-id: c0b3bb1c20ed6b0fdcac34bd35e0c9fea6e5a46c [formerly 918686c05b0ac0cacbcd029a8ba95d1250dab731] [formerly fb1bdc4ec327c2b6588cb5fe4977a4fa23728a72 [formerly 9b359f94196467899e015de6107d2dd44c7037c1]]
Former-commit-id: a0d6e9386e7970e160655bd1da7e7594754a1635 [formerly f63b6d2e66666389f5fa1c595d5229bcd068b1b4]
Former-commit-id: ba34434a83785d2879a365ac324e3230bedec4ac
This commit is contained in:
Lynix 2016-09-29 18:00:05 +02:00
parent 3ba86d0caa
commit 59788a6aab
1 changed files with 12 additions and 9 deletions

View File

@ -15,15 +15,14 @@ ACTION.Function = function ()
elseif (#libDirs == 0) then elseif (#libDirs == 0) then
error("No subdirectory was found in the lib directory, have you built the engine yet?") error("No subdirectory was found in the lib directory, have you built the engine yet?")
else else
libDir = libDirs[1] .. "/" libDir = path.getname(libDirs[1])
print("No directory was set by the --pack-libdir command, \"" .. libDir .. "\" will be used") print("No directory was set by the --pack-libdir command, \"" .. libDir .. "\" will be used")
end end
else
libDir = "../lib/" .. libDir .. "/"
end end
if (not os.isdir(libDir)) then local realLibDir = "../lib/" .. libDir .. "/"
error(string.format("\"%s\" doesn't seem to be an existing directory", libDir)) if (not os.isdir(realLibDir)) then
error(string.format("\"%s\" doesn't seem to be an existing directory", realLibDir))
end end
local archEnabled = { local archEnabled = {
@ -31,7 +30,7 @@ ACTION.Function = function ()
["x86"] = false ["x86"] = false
} }
for k,v in pairs(os.matchdirs(libDir .. "*")) do for k,v in pairs(os.matchdirs(realLibDir .. "*")) do
local arch = path.getname(v) local arch = path.getname(v)
if (archEnabled[arch] ~= nil) then if (archEnabled[arch] ~= nil) then
archEnabled[arch] = true archEnabled[arch] = true
@ -90,10 +89,11 @@ ACTION.Function = function ()
binFileMasks = {"**.so"} binFileMasks = {"**.so"}
libFileMasks = {"**.a"} libFileMasks = {"**.a"}
end end
local enabledArchs = {}
for arch, enabled in pairs(archEnabled) do for arch, enabled in pairs(archEnabled) do
if (enabled) then if (enabled) then
local archLibSrc = libDir .. arch .. "/" local archLibSrc = realLibDir .. arch .. "/"
local arch3rdPartyBinSrc = "../extlibs/lib/common/" .. arch .. "/" local arch3rdPartyBinSrc = "../extlibs/lib/common/" .. arch .. "/"
local archBinDst = "bin/" .. arch .. "/" local archBinDst = "bin/" .. arch .. "/"
local archLibDst = "lib/" .. arch .. "/" local archLibDst = "lib/" .. arch .. "/"
@ -118,6 +118,8 @@ ACTION.Function = function ()
Source = arch3rdPartyBinSrc, Source = arch3rdPartyBinSrc,
Target = archBinDst Target = archBinDst
}) })
table.insert(enabledArchs, arch)
end end
end end
@ -225,5 +227,6 @@ ACTION.Function = function ()
end end
end end
print(string.format("Package successfully created at \"%s\" (%u MB, %s)", packageDir, size / (1024 * 1024), libDir)) local config = libDir .. " - " .. table.concat(enabledArchs, ", ")
print(string.format("Package successfully created at \"%s\" (%u MB, %s)", packageDir, size / (1024 * 1024), config))
end end