Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions pkgs/c/compat.quickjs-ng.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
-- keeps its assertions and its debug-dump code (quickjs.c:84-86); upstream's
-- default build type (Release) would define it.
--
-- LINUX ONLY. Built and tested with llvm 22.1.8 on x86_64-linux-gnu, and in an
-- openkal graph for x86_64-linux-gnu. Upstream supports macOS and Windows, but
-- nothing here has built the package there, so those sections are not declared.
-- PLATFORMS. Linux (llvm 22.1.8 on x86_64-linux-gnu, and in an openkal graph),
-- macOS and Windows: the same four sources and flags, as upstream's own CI
-- builds them on all three (clang and MSVC-ABI clang on Windows).
--
-- NO CN MIRROR. The url is upstream's tag archive as a plain string, the
-- fallback docs/cn-mirror.md describes for a contributor without mcpp-res write
Expand Down Expand Up @@ -82,6 +82,18 @@ package = {
sha256 = "559bc4c420475e55c7ab4510adbc562f55d7524d75e8e89d79ce4bb02f5687d9",
},
},
macosx = {
["0.17.0"] = {
url = "https://github.com/quickjs-ng/quickjs/archive/refs/tags/v0.17.0.tar.gz",
sha256 = "559bc4c420475e55c7ab4510adbc562f55d7524d75e8e89d79ce4bb02f5687d9",
},
},
windows = {
["0.17.0"] = {
url = "https://github.com/quickjs-ng/quickjs/archive/refs/tags/v0.17.0.tar.gz",
sha256 = "559bc4c420475e55c7ab4510adbc562f55d7524d75e8e89d79ce4bb02f5687d9",
},
},
},

mcpp = {
Expand Down Expand Up @@ -111,6 +123,11 @@ package = {
-- the C driver, which adds no libm, and quickjs.c's Math functions then
-- fail to link. libdl is left out: only quickjs-libc.c calls dlopen.
linux = { ldflags = { "-lm", "-lpthread" } },
-- libSystem carries libm and pthreads: nothing to add on macOS.
-- Windows: upstream's CMake adds _CRT_SECURE_NO_WARNINGS for MSVC-ABI
-- builds (CMakeLists.txt, `if(MSVC)`), and quickjs.c's thread-safe
-- atomics need nothing beyond the CRT.
windows = { cflags = { "-D_CRT_SECURE_NO_WARNINGS" } },
targets = { ["quickjs-ng"] = { kind = "lib" } },
deps = { },
},
Expand Down
9 changes: 3 additions & 6 deletions tests/examples/quickjs-ng/mcpp.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# QuickJS-ng test project: evaluate JavaScript through the engine and assert
# the values it computes, one group per compiled source file.
#
# compat.quickjs-ng carries a `linux` section only (see the descriptor's
# header), so the dependency is gated and the test compiles to a no-op main()
# elsewhere, the same shape as tests/examples/libaio and tests/examples/wamr.
# the values it computes, one group per compiled source file, on Linux, macOS
# and Windows.
[package]
name = "quickjs-ng-tests"
version = "0.1.0"

[target.'cfg(linux)'.dependencies.compat]
[dependencies.compat]
quickjs-ng = "0.17.0"
8 changes: 0 additions & 8 deletions tests/examples/quickjs-ng/tests/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
// JS_FreeRuntime asserts that no object is still alive (quickjs.c:2699) and an
// object this test forgot to free aborts it.

#ifdef __linux__

#include <quickjs.h>

#include <cstdio>
Expand Down Expand Up @@ -131,9 +129,3 @@ int main() {
}
return 0;
}

#else

int main() { return 0; } // compat.quickjs-ng declares linux only; nothing to assert here.

#endif
Loading