The -lm was missing in the pkgconfig file that was generated. This adds that similar to the CMake build system's output.
Signed-off-by: Tyler Erickson <tyler.erickson@seagate.com>
Signed-off-by: Sam James <sam@gentoo.org>
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>
Windows was failing tests due to how the Windows API works with some of the calls used.
When opening and reading a file O_BINARY is needed otherwise it fails for size checks. This is due to how Windows handles newlines and counts between text and binary mode file reads.
Also fixed is the test for /dev/null.
In Windows, this fails, but crashes due to a missing return statement when it cannot open this file.
I also tried telling windows to open the special file NUL, however that leads to a CRT crash later in the test that cannot be stopped and will always fail. Rather than fail a test that Windows will always fail, it has been disabled in that specific case.
Signed-off-by: Tyler Erickson <tyler.erickson@seagate.com>
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>
Clang-cl will fail to build and produce warnings about redefining existing symbols, mostly for float.h and math.h compatibility.
To resolve this, this moves the clang-cl detection earlier in the CMakeLists.txt so that CLANG_CL can be checked properly where there is an existing MSVC workaround for these symbols.
This resolves the build using the latest clang-cl from the LLVM clang repo as well as clang-cl that can be installed with MSVC 2022.
Signed-off-by: Tyler Erickson <tyler.erickson@seagate.com>