Reverse operation of bytecode embedding flag: from --no-bytecode to --bytecode

See [issue #384](https://github.com/premake/premake-core/issues/384) for more information
This commit is contained in:
Jason Perkins 2016-02-14 19:05:40 -05:00
parent 305430ac11
commit 461304c89b
3 changed files with 11 additions and 7 deletions

View File

@ -74,8 +74,8 @@
} }
newoption { newoption {
trigger = "no-bytecode", trigger = "bytecode",
description = "Don't embed bytecode, but instead use the stripped souce code." description = "Embed scripts as bytecode instead of stripped souce code"
} }
-- --

View File

@ -1,8 +1,8 @@
-- --
-- Embed the Lua scripts into src/host/scripts.c as static data buffers. -- Embed the Lua scripts into src/host/scripts.c as static data buffers.
-- I embed the actual scripts, rather than Lua bytecodes, because the -- Embeds minified versions of the actual scripts by default, rather than
-- bytecodes are not portable to different architectures, which causes -- bytecode, as bytecodes are not portable to different architectures. Use
-- issues in Mac OS X Universal builds. -- the `--bytecode` flag to override.
-- --
local scriptCount = 0 local scriptCount = 0
@ -67,7 +67,7 @@
local function addScript(result, filename, name, data) local function addScript(result, filename, name, data)
if not data then if not data then
if not _OPTIONS["no-bytecode"] then if _OPTIONS["bytecode"] then
verbosef("Compiling... " .. filename) verbosef("Compiling... " .. filename)
local output = path.replaceextension(filename, ".luac") local output = path.replaceextension(filename, ".luac")
local res, err = os.compile(filename, output); local res, err = os.compile(filename, output);

View File

@ -111,7 +111,11 @@
-- --
print("Updating embedded scripts...") print("Updating embedded scripts...")
if kind == "source" then
z = execQuiet("premake5 embed") z = execQuiet("premake5 embed")
else
z = execQuiet("premake5 --bytecode embed")
end
if z ~= 0 then if z ~= 0 then
error("failed to update the embedded scripts", 0) error("failed to update the embedded scripts", 0)
end end