diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2022-12-04 15:24:28 -0500 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2022-12-04 15:24:28 -0500 |
commit | 9d674fc0937c8843d1c0bef98e72cd39864f08bd (patch) | |
tree | 89c311790510ffb231ae9e0e2bb2bf77cde3d645 | |
parent | 85b453cec99b80a5bea4f0777d19676486ac15e7 (diff) | |
download | lite-xl-plugin-manager-9d674fc0937c8843d1c0bef98e72cd39864f08bd.tar.gz lite-xl-plugin-manager-9d674fc0937c8843d1c0bef98e72cd39864f08bd.zip |
Made LIVE more clear.
-rwxr-xr-x | build.sh | 8 | ||||
-rw-r--r-- | src/lpm.c | 9 |
2 files changed, 11 insertions, 6 deletions
@@ -36,9 +36,11 @@ fi [[ "$@" != *"-llua"* ]] && CFLAGS="$CFLAGS -Ilib/lua -DMAKE_LIB=1" && SRCS="$SRCS lib/lua/onelua.c" # Build the pre-packaged lua file into the executbale. -[[ ! -e "lua.exe" ]] && gcc -Ilib/lua -o lua.exe lib/lua/onelua.c -lm -./lua.exe -e 'io.open("src/lpm.luac", "wb"):write(string.dump(assert(loadfile("src/lpm.lua"))))' -xxd -i src/lpm.luac > src/lpm.lua.c +if [[ "$@" != *"-DLPM_LIVE" ]]; then + [[ ! -e "lua.exe" ]] && gcc -Ilib/lua -o lua.exe lib/lua/onelua.c -lm + ./lua.exe -e 'io.open("src/lpm.luac", "wb"):write(string.dump(assert(loadfile("src/lpm.lua"))))' + xxd -i src/lpm.luac > src/lpm.lua.c +fi [[ $OSTYPE != 'msys'* && $CC != *'mingw'* && $CC != "emcc" ]] && LDFLAGS=" $LDFLAGS -ldl -pthread" [[ $OSTYPE == 'msys'* || $CC == *'mingw'* ]] && LDFLAGS="$LDFLAGS -lbcrypt -lws2_32 -lz -lwinhttp -lole32 -lcrypt32 -lrpcrt4" @@ -831,8 +831,11 @@ static const luaL_Reg system_lib[] = { #endif -extern const char src_lpm_luac[]; -extern unsigned int src_lpm_luac_len; +#ifndef LPM_LIVE + extern const char src_lpm_luac[]; + extern unsigned int src_lpm_luac_len; +#endif + int main(int argc, char* argv[]) { git_libgit2_init(); lua_State* L = luaL_newstate(); @@ -858,7 +861,7 @@ int main(int argc, char* argv[]) { lua_setglobal(L, "PLATFORM"); lua_pushliteral(L, LITE_ARCH_TUPLE); lua_setglobal(L, "ARCH"); - #if LPM_LIVE + #ifdef LPM_LIVE if (luaL_loadfile(L, "src/lpm.lua") || lua_pcall(L, 0, 1, 0)) { #else if (luaL_loadbuffer(L, src_lpm_luac, src_lpm_luac_len, "lpm.lua") || lua_pcall(L, 0, 1, 0)) { |