Skip to content

Commit

Permalink
Update xmake.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
Chi-EEE committed Jan 19, 2025
1 parent 60bc1be commit 998ae35
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions packages/q/quickjs-ng/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ package("quickjs-ng")
io.replace("CMakeLists.txt", "xcheck_add_c_compiler_flag(-Werror)", "", {plain = true})
io.replace("CMakeLists.txt", "if(NOT WIN32 AND NOT EMSCRIPTEN)", "if(0)", {plain = true})

if package:is_plat("wasm") then
package:add("ldflags", "-sMALLOC=emmalloc")
end

local configs = {"-DBUILD_QJS_LIBC=ON"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
Expand All @@ -54,13 +50,7 @@ package("quickjs-ng")
end
local opt = {}
if package:is_plat("wasm") then
table.insert(configs, "-DEMSCRIPTEN=1")
table.insert(configs, "-D__wasi__=1")
table.insert(configs, "-DEMSCRIPTEN_SYSTEM_PROCESSOR=" .. package:targetarch())
-- https://stackoverflow.com/questions/58854858/undefined-symbol-stack-chk-guard-in-libopenh264-so-when-building-ffmpeg-wit
-- https://github.com/emscripten-core/emscripten/issues/17030
opt.cxflags = {"-fno-stack-protector", "-U_FORTIFY_SOURCE"}
opt.ldflags = {"-fno-stack-protector", "-U_FORTIFY_SOURCE"}
io.replace("quickjs-libc.c", "!defined(__wasi__)", " !defined(__wasi__) && !defined(EMSCRIPTEN)", {plain = true})
end
import("package.tools.cmake").install(package, configs, opt)
for _, filedir in ipairs(os.filedirs("**")) do
Expand Down

0 comments on commit 998ae35

Please sign in to comment.