Browse Source

Try 5

pull/432/head
Unmanned Player 7 years ago
parent
commit
2ac3b94a33
2 changed files with 34 additions and 18 deletions
  1. +3
    -13
      CMakeLists.txt
  2. +31
    -5
      README.md

+ 3
- 13
CMakeLists.txt View File

@@ -74,19 +74,9 @@ if (HAVE_INTTYPES_H)
set(JSON_C_HAVE_INTTYPES_H 1)
endif()

if (MSVC)
check_symbol_exists(isnan "math.h" HAVE_DECL_ISNAN)
check_symbol_exists(_isnan "float.h" HAVE_DECL__ISNAN)
else()
check_symbol_exists(isnan "math.h" HAVE_DECL_ISNAN)
check_symbol_exists(_isnan "math.h" HAVE_DECL__ISNAN)
endif()

if (MSVC)
check_symbol_exists(_finite "float.h" HAVE_DECL__FINITE)
else()
check_symbol_exists(_finite "math.h" HAVE_DECL__FINITE)
endif()
check_symbol_exists(isnan "math.h" HAVE_DECL_ISNAN)
check_symbol_exists(_isnan "float.h" HAVE_DECL__ISNAN)
check_symbol_exists(_finite "float.h" HAVE_DECL__FINITE)

check_symbol_exists(INFINITY "math.h" HAVE_DECL_INFINITY)
check_symbol_exists(isinf "math.h" HAVE_DECL_ISINF)


+ 31
- 5
README.md View File

@@ -5,8 +5,9 @@
2. [Building on Unix](#buildunix)
3. [Install Prerequisites](#installprereq)
4. [Building with partial threading support](#buildthreaded)
5. [Linking to libjson-c](#linking)
6. [Using json-c](#using)
5. [Building with CMake](#CMake)
6. [Linking to libjson-c](#linking)
7. [Using json-c](#using)

JSON-C - A JSON implementation in C <a name="overview"></a>
-----------------------------------
@@ -15,8 +16,8 @@ Build Status
* [AppVeyor Build](https://ci.appveyor.com/project/hawicz/json-c) ![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/json-c/json-c?branch=master&svg=true)
* [Travis Build](https://travis-ci.org/json-c/json-c) ![Travis Build Status](https://travis-ci.org/json-c/json-c.svg?branch=master)

JSON-C implements a reference counting object model that allows you to easily
construct JSON objects in C, output them as JSON formatted strings and parse
JSON-C implements a reference counting object model that allows you to easily
construct JSON objects in C, output them as JSON formatted strings and parse
JSON formatted strings back into the C representation of JSON objects.
It aims to conform to [RFC 7159](https://tools.ietf.org/html/rfc7159).

@@ -72,7 +73,7 @@ Install prerequisites <a name="installprereq"></a>
-----------------------

If you are on a relatively modern system, you'll likely be able to install
the prerequisites using your OS's packaging system.
the prerequisites using your OS's packaging system.

### Install using apt (e.g. Ubuntu 16.04.2 LTS)
```sh
@@ -134,6 +135,31 @@ lh_char_hash, uses a compare-and-swap operation to ensure the randomly
seed is only generated once. Because this is a one-time operation, it
is always compiled in when the compare-and-swap operation is available.

Building with CMake <a name="CMake"></a>
--------------------

To use [CMake](https://cmake.org/cmake-tutorial/), build it like:

```sh
mkdir build
cd build
cmake ../
make
```

CMake can take a few options.

Variable | Type | Description
------------------|------|--------------
BUILD_SHARED_LIBS | Bool | The default build generates static library. Enable this to generate shared (dll/so) library.
ENABLE_RDRAND | Bool | Enable RDRAND Hardware RNG Hash Seed
ENABLE_THREADING | Bool | Enable partial threading support

Pass these options as `-D` on CMake's command-line.

```sh
cmake -DBUILD_SHARED_LIBS=On ...
```

Linking to `libjson-c` <a name="linking">
----------------------


Loading…
Cancel
Save