summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-15 13:03:44 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-15 13:03:44 +0300
commitba75c8b0a1bba03ad92c53375432f122ddb4cb98 (patch)
treeaf8b0b165b865712cfde0f9b485a3cb984f5ac69
parentbd8222e615134c3ec5e7a07b6b1fa97c9bd4a471 (diff)
Use the top-level threads dependency in the tests
The library now declares dependency('threads') at the top level and term_dep carries it, so the tests no longer declare their own. The README says a Meson host gets threads through the dependency, and names dependency('threads') for the amalgamation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
-rw-r--r--README.md14
-rw-r--r--tests/meson.build1
2 files changed, 8 insertions, 7 deletions
diff --git a/README.md b/README.md
index c77883a..454b230 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
term is a headless terminal core: the parser, screen ring, logical-line
history store, write core, and viewport snapshots. It is a C11 library
-with no dependency but libm and, on POSIX, the thread library (`-pthread`).
+with no dependency but libm and threads.
| Path | Contents |
| --- | --- |
@@ -19,15 +19,17 @@ with no dependency but libm and, on POSIX, the thread library (`-pthread`).
Pick one of these:
- **Meson subproject**: `dependency('term')`, or
- `subproject('term').get_variable('term_dep')`. The `arch_flag` option
- sets the lowest instruction set, such as `-march=x86-64-v3`.
+ `subproject('term').get_variable('term_dep')`. It brings libm and
+ `dependency('threads')` with it. The `arch_flag` option sets the lowest
+ instruction set, such as `-march=x86-64-v3`.
- **Amalgamation**: run `tools/amalgamate.py . OUT`. It writes
`OUT/term.c` and `OUT/term.h`. Compile `term.c` with any C11 compiler
- and link libm and the thread library: `cc -std=c11 -pthread -c term.c`
- on POSIX. A Rust `build.rs` needs one
+ and link libm and threads: `dependency('threads')` in Meson, `-pthread`
+ elsewhere on POSIX. A Rust `build.rs` needs one
`cc::Build::new().file("term.c").compile("term")`.
- **Sources**: compile `src/*.c` and `src/osc/*.c` once, with `src` and
- `include/term` on the include path. Link the thread library too.
+ `include/term` on the include path. Link libm and threads, as for the
+ amalgamation.
The library needs nothing else. On Windows the writer lock is an SRWLOCK
from the system library, so it needs no extra link. The `*-amalgamation`
diff --git a/tests/meson.build b/tests/meson.build
index 4fda075..04dab9a 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -1,4 +1,3 @@
-thread_dep = dependency('threads')
dl_dep = cc.find_library('dl', required: false)
python = find_program('python3', native: true, version: '>=3.10')
bash = find_program('bash', native: true)