diff options
| author | ruki <[email protected]> | 2019-08-24 09:34:36 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-08-24 09:34:36 +0800 |
| commit | 1305c501fe88c18931c7a13ff33f48d52a796d00 (patch) | |
| tree | b183c0048afe7abc5ca5e848f64ec54abbd73cc7 /xmake/modules/private/utils/bcsave.lua | |
| parent | a884abeaf4144885648016742a573f9a47a56d5a (diff) | |
reserve debug info for archive
Diffstat (limited to 'xmake/modules/private/utils/bcsave.lua')
| -rw-r--r-- | xmake/modules/private/utils/bcsave.lua | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/xmake/modules/private/utils/bcsave.lua b/xmake/modules/private/utils/bcsave.lua index 591626127..041bd9a8f 100644 --- a/xmake/modules/private/utils/bcsave.lua +++ b/xmake/modules/private/utils/bcsave.lua @@ -46,24 +46,30 @@ function save(sourcedir, outputdir, opt) -- save all lua files to bitcode files local oldir = os.cd(sourcedir) + local total_lua = 0 + local total_bc = 0 for _, luafile in ipairs(os.files(path.join(sourcedir, "**.lua"))) do -- get relative lua file path to decrease bitcode file size (without strip) luafile = path.relative(luafile, sourcedir) - -- trace - vprint("generating %s ..", luafile) - -- get bitcode file path local bcfile = path.join(outputdir, luafile) -- generate bitcode file bcsave(luafile, bcfile, {strip = opt.strip}) + + -- trace + local luasize = os.filesize(luafile) + local bcsize = os.filesize(bcfile) + total_lua = total_lua + luasize + total_bc = total_bc + bcsize + vprint("generating %s (%d => %d)..", luafile, luasize, bcsize) end os.cd(oldir) -- trace - cprint("${bright}bitcode files have been generated in %s", outputdir) + cprint("${bright}bitcode files have been generated in %s, size: %d => %d", outputdir, total_lua, total_bc) end -- main entry |
