Commit Graph
14 Commits
Author SHA1 Message Date
Sam James 87087ded64 meson: improve test handling
Tests will now be built at `meson test`-time, so there's no cost if the
user isn't going to run them.

This is better than guarding on build type, as distros may want to test production
builds before shipping.

Signed-off-by: Sam James <sam@gentoo.org>
2026-07-24 07:37:41 +01:00
Sam James cf958091ad meson: wire up extra_libs option
This is more elegant as a meson feature option because feature options
propagate in a useful way to `dependency(..., required: ...)`.

Without this, the option was ignored. Wiring it up naively meant that
disabling it still searched for libbsd as well, so a feature option
is the best fit.

Also, mark it as a dependency of `arc4random`.

Signed-off-by: Sam James <sam@gentoo.org>
2026-07-24 07:37:40 +01:00
Tyler Erickson 56a0e3f478 fix installing json-c headers with meson and missing pkgconfig file
This commit fixes the install path for json-c headers when running `meson install`.
Previously some showed in /usr/include/ rather than /usr/include/json-c

This also adds generating the pkgconfig .pc file for this project.

Signed-off-by: Tyler Erickson <tyler.erickson@seagate.com>
2026-07-13 15:48:20 -06:00
Rosen Penev 1d4885ad09 fix compilation with clang-cl
Something in the configure stage goes wrong where it believe strncasecmp
is present but the header defining it is not. Work around this.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2026-02-05 13:46:00 -08:00
Rosen Penev 92a4911e88 meson: use static library for tests
Needed as tests use private APIs that are not exported.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2026-02-05 13:46:00 -08:00
Rosen Penev 798d8f7235 meson: add license information
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2026-02-05 13:21:54 -08:00
Rosen Penev a0c6bb32dd meson: simplify __thread check and fix MinGW
> was missing.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2026-02-05 13:21:54 -08:00
Rosen Penev af2671a212 meson: use override_dependency
Allows wraps to use the dependency_names syntax instead of the possibly
changing variable syntax.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2026-02-05 13:21:54 -08:00
Anton Lundin dc44b05961 Fix typo
That include line wasn't valid code, so that resulted in:
Checking for size of "size_t" : -1

And later on:
json-c/json_patch.c:28:2: error: #error Unable to determine size of size_t
2025-12-01 11:37:59 +01:00
Rosen Penev f565798e2c meson: remove useless if
get_supported_arguments already handles this.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2025-11-04 10:45:20 -08:00
Rosen Penev 8c012da8a6 meson: add header to size_t check
Might be needed under MSVC.
2025-11-04 10:45:20 -08:00
Rosen Penev bd7355470e meson: replace target_machine with host_machine
The latter is the canonical way to express this.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2025-11-04 10:45:20 -08:00
Rosen Penev 40fe4d2b04 meson: use loops for checks
All of these are effectively the same. No point in duplicating it
everywhere.

Remove prefix from has_function. Apparently having the prefix in there
changes behavior.

Also fix an error on MinGW where SSIZE_T_MAX is undefined.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2025-11-04 10:44:42 -08:00
Tyler Erickson e3a33ae8ae make: Adding support for building json-c with meson
Adding meson build files for json-c that work similarly to the cmake build files.
Where it made sense, I reused existing cmake .h.in files or generated entirely from meson.
All tests were done with GCC and Clang in ubuntu 24.04, Windows using MSVC 2022 and Clang-cl from llvm's repo using version 21.1.3

Signed-off-by: Tyler Erickson <tyler.erickson@seagate.com>
2025-10-20 12:08:01 -06:00