# VALGRIND=1 causes -DVALGRIND=1 to be passed when compiling code To run tests a separate build directory is recommended: mkdir build-test That can slow the tests down considerably, so to disable it use: export USE_VALGRIND=0 Install architecture-independent files in PREFIXĮnable code to support partly multi-threaded useĮnable RDRAND Hardware RNG Hash Seed generation on supported x86/圆4 platforms.Īvoid treating compiler warnings as fatal errorsīy default, if valgrind is available running tests uses it. cmake-configure -prefix=/some/install/pathĬmake-configure can take a few options. cmake-configure wrapper scriptįor those familiar with the old autoconf/autogen.sh/configure method, there is a cmake-configure wrapper script to ease the transition to cmake. Because this is a one-time operation, it is always compiled in when the compare-and-swap operation is available. Separately, the default hash function used for object field keys, lh_char_hash, uses a compare-and-swap operation to ensure the random seed is only generated once. You may turn it on by adjusting your cmake command with: -DENABLE_THREADING=ON Since this may have a performance impact, of at least 3x slower according to, it is disabled by default. ![]() Currently, this is limited to using atomic operations for json_object_get() and json_object_put(). # build a static library onlyĪlthough json-c does not support fully multi-threaded access to object trees, it has some code to help make its use in threaded programs a bit safer. Pass these options as -D on CMake's command-line. on embedded platforms where not even the fallback to time() works. ![]() Set this to OFF to create a shared library only.ĭisable use of Thread-Local Storage (HAVE_THREAD).Ī block of code to use instead of the default implementation of json_c_get_random_seed(), e.g. The default builds position independent code. Set this to OFF to create a shared library only. The default build generates a static (lib/a) library. Set this to OFF to create a static library only. The default build generates a dynamic (dll/so) library. The json-c library is built with CMake, which can take a few options. The library documentation can be generated directly from the source code using Doxygen tool: # in build directory $ make USE_VALGRIND=0 test # optionally skip using valgrind ![]() Note: it's also possible to put your build directory inside the json-c source directory, or even not use a separate build directory at all, but certain things might not work quite right (notably, make distcheck) json-c # See CMake section below for custom arguments If you are on a relatively modern system, you'll likely be able to install the prerequisites using your OS's packaging system. If you already have json-c installed, see Linking to `libjson-c` for how to build and link your program against it.
0 Comments
Leave a Reply. |