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 {
trigger = "no-bytecode",
description = "Don't embed bytecode, but instead use the stripped souce code."
trigger = "bytecode",
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.
-- I embed the actual scripts, rather than Lua bytecodes, because the
-- bytecodes are not portable to different architectures, which causes
-- issues in Mac OS X Universal builds.
-- Embeds minified versions of the actual scripts by default, rather than
-- bytecode, as bytecodes are not portable to different architectures. Use
-- the `--bytecode` flag to override.
--
local scriptCount = 0
@ -67,7 +67,7 @@
local function addScript(result, filename, name, data)
if not data then
if not _OPTIONS["no-bytecode"] then
if _OPTIONS["bytecode"] then
verbosef("Compiling... " .. filename)
local output = path.replaceextension(filename, ".luac")
local res, err = os.compile(filename, output);

View File

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