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:
parent
305430ac11
commit
461304c89b
@ -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"
|
||||||
}
|
}
|
||||||
|
|
||||||
--
|
--
|
||||||
|
@ -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);
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user