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 | |
| parent | a884abeaf4144885648016742a573f9a47a56d5a (diff) | |
reserve debug info for archive
| -rwxr-xr-x | scripts/archive-all.sh | 2 | ||||
| -rwxr-xr-x | scripts/makeself/build-runfile.sh | 2 | ||||
| -rw-r--r-- | xmake/modules/private/utils/bcsave.lua | 14 |
3 files changed, 12 insertions, 6 deletions
diff --git a/scripts/archive-all.sh b/scripts/archive-all.sh index aa320b6a6..ff39e5257 100755 --- a/scripts/archive-all.sh +++ b/scripts/archive-all.sh @@ -17,7 +17,7 @@ git submodule foreach git clean -dfX # copy files to tmpdir/xmake mkdir -p $tmpdir/xmake/scripts -xmake l -v private.utils.bcsave -s -o $tmpdir/repo/bcxmake $tmpdir/repo/xmake || exit +xmake l -v private.utils.bcsave -o $tmpdir/repo/bcxmake $tmpdir/repo/xmake || exit cd $tmpdir/repo || exit cp -r ./core $tmpdir/xmake mv bcxmake $tmpdir/xmake/xmake diff --git a/scripts/makeself/build-runfile.sh b/scripts/makeself/build-runfile.sh index 85377dd82..5a204bcea 100755 --- a/scripts/makeself/build-runfile.sh +++ b/scripts/makeself/build-runfile.sh @@ -19,7 +19,7 @@ git submodule foreach git clean -dfX # copy files to tmpdir/xmake mkdir -p $tmpdir/xmake/scripts -xmake l -v private.utils.bcsave -s -o $tmpdir/repo/bcxmake $tmpdir/repo/xmake || exit +xmake l -v private.utils.bcsave -o $tmpdir/repo/bcxmake $tmpdir/repo/xmake || exit cd $tmpdir/repo || exit cp -r ./core $tmpdir/xmake mv bcxmake $tmpdir/xmake/xmake 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 |
