|
@@ -13,7 +13,7 @@ package("quickjs-ng")
|
|
|
|
|
|
add_configs("libc", {description = "Build standard library modules as part of the library", default = false, type = "boolean"})
|
|
add_configs("libc", {description = "Build standard library modules as part of the library", default = false, type = "boolean"})
|
|
|
|
|
|
- if is_plat("linux", "bsd") then
|
|
|
|
|
|
+ if is_plat("linux", "bsd", "cross") then
|
|
add_syslinks("m", "pthread")
|
|
add_syslinks("m", "pthread")
|
|
end
|
|
end
|
|
|
|
|
|
@@ -28,14 +28,9 @@ package("quickjs-ng")
|
|
assert(minor and minor >= 30, "package(quickjs-ng) require vs_toolset >= 14.3")
|
|
assert(minor and minor >= 30, "package(quickjs-ng) require vs_toolset >= 14.3")
|
|
end
|
|
end
|
|
end)
|
|
end)
|
|
- on_check("wasm", "cross", function (package)
|
|
|
|
- if package:version():eq("0.8.0") then
|
|
|
|
- raise("package(quickjs-ng v0.8.0) unsupported platform")
|
|
|
|
- end
|
|
|
|
- end)
|
|
|
|
end
|
|
end
|
|
|
|
|
|
- on_install("!iphoneos and (!windows or windows|!x86)", function (package)
|
|
|
|
|
|
+ on_install(function (package)
|
|
io.replace("CMakeLists.txt", "xcheck_add_c_compiler_flag(-Werror)", "", {plain = true})
|
|
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})
|
|
io.replace("CMakeLists.txt", "if(NOT WIN32 AND NOT EMSCRIPTEN)", "if(0)", {plain = true})
|
|
|
|
|
|
@@ -49,12 +44,27 @@ package("quickjs-ng")
|
|
if package:config("shared") and package:is_plat("windows") then
|
|
if package:config("shared") and package:is_plat("windows") then
|
|
table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON")
|
|
table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON")
|
|
end
|
|
end
|
|
|
|
+ if package:is_plat("wasm") then
|
|
|
|
+ io.replace("quickjs-libc.c", " defined(__wasi__)", " (defined(__wasi__) || defined(EMSCRIPTEN))", {plain = true})
|
|
|
|
+ io.replace("quickjs-libc.c", " !defined(__wasi__)", " (!defined(__wasi__) && !defined(EMSCRIPTEN))", {plain = true})
|
|
|
|
+ end
|
|
|
|
+ if package:is_plat("linux", "bsd", "cross") then
|
|
|
|
+ io.replace("CMakeLists.txt", "M_LIBRARIES OR CMAKE_C_COMPILER_ID STREQUAL \"TinyCC\"", "1", {plain = true}) -- m library link
|
|
|
|
+ end
|
|
import("package.tools.cmake").install(package, configs)
|
|
import("package.tools.cmake").install(package, configs)
|
|
|
|
|
|
if package:is_plat("windows") and package:is_debug() then
|
|
if package:is_plat("windows") and package:is_debug() then
|
|
local dir = package:installdir(package:config("shared") and "bin" or "lib")
|
|
local dir = package:installdir(package:config("shared") and "bin" or "lib")
|
|
os.vcp(path.join(package:buildir(), "qjs.pdb"), dir)
|
|
os.vcp(path.join(package:buildir(), "qjs.pdb"), dir)
|
|
end
|
|
end
|
|
|
|
+
|
|
|
|
+ os.trycp("*.h", package:installdir("include"))
|
|
|
|
+ os.trycp(path.join(package:buildir(), "**.a"), package:installdir("lib"))
|
|
|
|
+ os.trycp(path.join(package:buildir(), "**.so"), package:installdir("lib"))
|
|
|
|
+ os.trycp(path.join(package:buildir(), "**.dylib"), package:installdir("lib"))
|
|
|
|
+ os.trycp(path.join(package:buildir(), "**.lib"), package:installdir("lib"))
|
|
|
|
+ os.trycp(path.join(package:buildir(), "**.dll"), package:installdir("bin"))
|
|
|
|
+ package:add("links", "qjs")
|
|
end)
|
|
end)
|
|
|
|
|
|
on_test(function (package)
|
|
on_test(function (package)
|