mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-12 10:03:51 +01:00
This reverts commit 12325b814f
.
This commit is contained in:
parent
12325b814f
commit
0d27381acf
@ -63,18 +63,11 @@ if(NOT DEFINED CMAKE_BUILD_TYPE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
project(JSONCPP
|
project(JSONCPP
|
||||||
# Note: version must be updated in three places when doing a release. This
|
VERSION 1.9.0 # <major>[.<minor>[.<patch>[.<tweak>]]]
|
||||||
# annoying process ensures that amalgamate, CMake, and meson all report the
|
|
||||||
# correct version.
|
|
||||||
# 1. /meson.build
|
|
||||||
# 2. /include/json/version.h
|
|
||||||
# 3. /CMakeLists.txt
|
|
||||||
# IMPORTANT: also update the SOVERSION!!
|
|
||||||
VERSION 1.9.2 # <major>[.<minor>[.<patch>[.<tweak>]]]
|
|
||||||
LANGUAGES CXX)
|
LANGUAGES CXX)
|
||||||
|
|
||||||
message(STATUS "JsonCpp Version: ${JSONCPP_VERSION_MAJOR}.${JSONCPP_VERSION_MINOR}.${JSONCPP_VERSION_PATCH}")
|
message(STATUS "JsonCpp Version: ${JSONCPP_VERSION_MAJOR}.${JSONCPP_VERSION_MINOR}.${JSONCPP_VERSION_PATCH}")
|
||||||
set( JSONCPP_SOVERSION 22 )
|
set( JSONCPP_SOVERSION 21 )
|
||||||
|
|
||||||
option(JSONCPP_WITH_TESTS "Compile and (for jsoncpp_check) run JsonCpp test executables" ON)
|
option(JSONCPP_WITH_TESTS "Compile and (for jsoncpp_check) run JsonCpp test executables" ON)
|
||||||
option(JSONCPP_WITH_POST_BUILD_UNITTEST "Automatically run unit-tests as a post build step" ON)
|
option(JSONCPP_WITH_POST_BUILD_UNITTEST "Automatically run unit-tests as a post build step" ON)
|
||||||
@ -96,6 +89,10 @@ set(DEBUG_LIBNAME_SUFFIX "" CACHE STRING "Optional suffix to append to the libra
|
|||||||
|
|
||||||
set(JSONCPP_USE_SECURE_MEMORY "0" CACHE STRING "-D...=1 to use memory-wiping allocator for STL" )
|
set(JSONCPP_USE_SECURE_MEMORY "0" CACHE STRING "-D...=1 to use memory-wiping allocator for STL" )
|
||||||
|
|
||||||
|
# File version.h is only regenerated on CMake configure step
|
||||||
|
configure_file( "${PROJECT_SOURCE_DIR}/src/lib_json/version.h.in"
|
||||||
|
"${PROJECT_BINARY_DIR}/include/json/version.h"
|
||||||
|
NEWLINE_STYLE UNIX )
|
||||||
configure_file( "${PROJECT_SOURCE_DIR}/version.in"
|
configure_file( "${PROJECT_SOURCE_DIR}/version.in"
|
||||||
"${PROJECT_BINARY_DIR}/version"
|
"${PROJECT_BINARY_DIR}/version"
|
||||||
NEWLINE_STYLE UNIX )
|
NEWLINE_STYLE UNIX )
|
||||||
|
@ -26,6 +26,7 @@ Then,
|
|||||||
LIB_TYPE=shared
|
LIB_TYPE=shared
|
||||||
#LIB_TYPE=static
|
#LIB_TYPE=static
|
||||||
meson --buildtype ${BUILD_TYPE} --default-library ${LIB_TYPE} . build-${LIB_TYPE}
|
meson --buildtype ${BUILD_TYPE} --default-library ${LIB_TYPE} . build-${LIB_TYPE}
|
||||||
|
#ninja -v -C build-${LIB_TYPE} test # This stopped working on my Mac.
|
||||||
ninja -v -C build-${LIB_TYPE}
|
ninja -v -C build-${LIB_TYPE}
|
||||||
cd build-${LIB_TYPE}
|
cd build-${LIB_TYPE}
|
||||||
meson test --no-rebuild --print-errorlogs
|
meson test --no-rebuild --print-errorlogs
|
||||||
|
38
amalgamate.py
Executable file → Normal file
38
amalgamate.py
Executable file → Normal file
@ -1,5 +1,3 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
"""Amalgamate json-cpp library sources into a single source and header file.
|
"""Amalgamate json-cpp library sources into a single source and header file.
|
||||||
|
|
||||||
Works with python2.6+ and python3.4+.
|
Works with python2.6+ and python3.4+.
|
||||||
@ -11,9 +9,6 @@ import os
|
|||||||
import os.path
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
INCLUDE_PATH = "include/json"
|
|
||||||
SRC_PATH = "src/lib_json"
|
|
||||||
|
|
||||||
class AmalgamationFile:
|
class AmalgamationFile:
|
||||||
def __init__(self, top_dir):
|
def __init__(self, top_dir):
|
||||||
self.top_dir = top_dir
|
self.top_dir = top_dir
|
||||||
@ -71,15 +66,15 @@ def amalgamate_source(source_top_dir=None,
|
|||||||
header.add_text("/// If defined, indicates that the source file is amalgamated")
|
header.add_text("/// If defined, indicates that the source file is amalgamated")
|
||||||
header.add_text("/// to prevent private header inclusion.")
|
header.add_text("/// to prevent private header inclusion.")
|
||||||
header.add_text("#define JSON_IS_AMALGAMATION")
|
header.add_text("#define JSON_IS_AMALGAMATION")
|
||||||
header.add_file(os.path.join(INCLUDE_PATH, "version.h"))
|
header.add_file("include/json/version.h")
|
||||||
header.add_file(os.path.join(INCLUDE_PATH, "allocator.h"))
|
header.add_file("include/json/allocator.h")
|
||||||
header.add_file(os.path.join(INCLUDE_PATH, "config.h"))
|
header.add_file("include/json/config.h")
|
||||||
header.add_file(os.path.join(INCLUDE_PATH, "forwards.h"))
|
header.add_file("include/json/forwards.h")
|
||||||
header.add_file(os.path.join(INCLUDE_PATH, "features.h"))
|
header.add_file("include/json/features.h")
|
||||||
header.add_file(os.path.join(INCLUDE_PATH, "value.h"))
|
header.add_file("include/json/value.h")
|
||||||
header.add_file(os.path.join(INCLUDE_PATH, "reader.h"))
|
header.add_file("include/json/reader.h")
|
||||||
header.add_file(os.path.join(INCLUDE_PATH, "writer.h"))
|
header.add_file("include/json/writer.h")
|
||||||
header.add_file(os.path.join(INCLUDE_PATH, "assertions.h"))
|
header.add_file("include/json/assertions.h")
|
||||||
header.add_text("#endif //ifndef JSON_AMALGAMATED_H_INCLUDED")
|
header.add_text("#endif //ifndef JSON_AMALGAMATED_H_INCLUDED")
|
||||||
|
|
||||||
target_header_path = os.path.join(os.path.dirname(target_source_path), header_include_path)
|
target_header_path = os.path.join(os.path.dirname(target_source_path), header_include_path)
|
||||||
@ -99,8 +94,8 @@ def amalgamate_source(source_top_dir=None,
|
|||||||
header.add_text("/// If defined, indicates that the source file is amalgamated")
|
header.add_text("/// If defined, indicates that the source file is amalgamated")
|
||||||
header.add_text("/// to prevent private header inclusion.")
|
header.add_text("/// to prevent private header inclusion.")
|
||||||
header.add_text("#define JSON_IS_AMALGAMATION")
|
header.add_text("#define JSON_IS_AMALGAMATION")
|
||||||
header.add_file(os.path.join(INCLUDE_PATH, "config.h"))
|
header.add_file("include/json/config.h")
|
||||||
header.add_file(os.path.join(INCLUDE_PATH, "forwards.h"))
|
header.add_file("include/json/forwards.h")
|
||||||
header.add_text("#endif //ifndef JSON_FORWARD_AMALGAMATED_H_INCLUDED")
|
header.add_text("#endif //ifndef JSON_FORWARD_AMALGAMATED_H_INCLUDED")
|
||||||
|
|
||||||
target_forward_header_path = os.path.join(os.path.dirname(target_source_path),
|
target_forward_header_path = os.path.join(os.path.dirname(target_source_path),
|
||||||
@ -121,11 +116,12 @@ def amalgamate_source(source_top_dir=None,
|
|||||||
#endif
|
#endif
|
||||||
""")
|
""")
|
||||||
source.add_text("")
|
source.add_text("")
|
||||||
source.add_file(os.path.join(SRC_PATH, "json_tool.h"))
|
lib_json = "src/lib_json"
|
||||||
source.add_file(os.path.join(SRC_PATH, "json_reader.cpp"))
|
source.add_file(os.path.join(lib_json, "json_tool.h"))
|
||||||
source.add_file(os.path.join(SRC_PATH, "json_valueiterator.inl"))
|
source.add_file(os.path.join(lib_json, "json_reader.cpp"))
|
||||||
source.add_file(os.path.join(SRC_PATH, "json_value.cpp"))
|
source.add_file(os.path.join(lib_json, "json_valueiterator.inl"))
|
||||||
source.add_file(os.path.join(SRC_PATH, "json_writer.cpp"))
|
source.add_file(os.path.join(lib_json, "json_value.cpp"))
|
||||||
|
source.add_file(os.path.join(lib_json, "json_writer.cpp"))
|
||||||
|
|
||||||
print("Writing amalgamated source to %r" % target_source_path)
|
print("Writing amalgamated source to %r" % target_source_path)
|
||||||
source.write_to(target_source_path)
|
source.write_to(target_source_path)
|
||||||
|
@ -378,7 +378,7 @@ bool JSON_API parseFromStream(CharReader::Factory const&,
|
|||||||
/** \brief Read from 'sin' into 'root'.
|
/** \brief Read from 'sin' into 'root'.
|
||||||
*
|
*
|
||||||
* Always keep comments from the input JSON.
|
* Always keep comments from the input JSON.
|
||||||
*
|
*
|
||||||
* This can be used to read a file into a particular sub-object.
|
* This can be used to read a file into a particular sub-object.
|
||||||
* For example:
|
* For example:
|
||||||
* \code
|
* \code
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
#ifndef JSON_VERSION_H_INCLUDED
|
|
||||||
#define JSON_VERSION_H_INCLUDED
|
|
||||||
|
|
||||||
// Note: version must be updated in three places when doing a release. This
|
|
||||||
// annoying process ensures that amalgamate, CMake, and meson all report the
|
|
||||||
// correct version.
|
|
||||||
// 1. /meson.build
|
|
||||||
// 2. /include/json/version.h
|
|
||||||
// 3. /CMakeLists.txt
|
|
||||||
// IMPORTANT: also update the SOVERSION!!
|
|
||||||
|
|
||||||
#define JSONCPP_VERSION_STRING "1.9.2"
|
|
||||||
#define JSONCPP_VERSION_MAJOR 1
|
|
||||||
#define JSONCPP_VERSION_MINOR 9
|
|
||||||
#define JSONCPP_VERSION_PATCH 2
|
|
||||||
#define JSONCPP_VERSION_QUALIFIER
|
|
||||||
#define JSONCPP_VERSION_HEXA \
|
|
||||||
((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | \
|
|
||||||
(JSONCPP_VERSION_PATCH << 8))
|
|
||||||
|
|
||||||
#ifdef JSONCPP_USING_SECURE_MEMORY
|
|
||||||
#undef JSONCPP_USING_SECURE_MEMORY
|
|
||||||
#endif
|
|
||||||
#define JSONCPP_USING_SECURE_MEMORY 0
|
|
||||||
// If non-zero, the library zeroes any memory that it has allocated before
|
|
||||||
// it frees its memory.
|
|
||||||
|
|
||||||
#endif // JSON_VERSION_H_INCLUDED
|
|
37
meson.build
37
meson.build
@ -1,15 +1,7 @@
|
|||||||
project(
|
project(
|
||||||
'jsoncpp',
|
'jsoncpp',
|
||||||
'cpp',
|
'cpp',
|
||||||
|
version : '1.9.0',
|
||||||
# Note: version must be updated in three places when doing a release. This
|
|
||||||
# annoying process ensures that amalgamate, CMake, and meson all report the
|
|
||||||
# correct version.
|
|
||||||
# 1. /meson.build
|
|
||||||
# 2. /include/json/version.h
|
|
||||||
# 3. /CMakeLists.txt
|
|
||||||
# IMPORTANT: also update the SOVERSION!!
|
|
||||||
version : '1.9.2',
|
|
||||||
default_options : [
|
default_options : [
|
||||||
'buildtype=release',
|
'buildtype=release',
|
||||||
'cpp_std=c++11',
|
'cpp_std=c++11',
|
||||||
@ -17,6 +9,25 @@ project(
|
|||||||
license : 'Public Domain',
|
license : 'Public Domain',
|
||||||
meson_version : '>= 0.50.0')
|
meson_version : '>= 0.50.0')
|
||||||
|
|
||||||
|
jsoncpp_ver_arr = meson.project_version().split('.')
|
||||||
|
jsoncpp_major_version = jsoncpp_ver_arr[0]
|
||||||
|
jsoncpp_minor_version = jsoncpp_ver_arr[1]
|
||||||
|
jsoncpp_patch_version = jsoncpp_ver_arr[2]
|
||||||
|
|
||||||
|
jsoncpp_cdata = configuration_data()
|
||||||
|
jsoncpp_cdata.set('JSONCPP_VERSION', meson.project_version())
|
||||||
|
jsoncpp_cdata.set('JSONCPP_VERSION_MAJOR', jsoncpp_major_version)
|
||||||
|
jsoncpp_cdata.set('JSONCPP_VERSION_MINOR', jsoncpp_minor_version)
|
||||||
|
jsoncpp_cdata.set('JSONCPP_VERSION_PATCH', jsoncpp_patch_version)
|
||||||
|
jsoncpp_cdata.set('JSONCPP_USE_SECURE_MEMORY',0)
|
||||||
|
|
||||||
|
jsoncpp_gen_sources = configure_file(
|
||||||
|
input : 'src/lib_json/version.h.in',
|
||||||
|
output : 'version.h',
|
||||||
|
configuration : jsoncpp_cdata,
|
||||||
|
install : true,
|
||||||
|
install_dir : join_paths(get_option('prefix'), get_option('includedir'), 'json')
|
||||||
|
)
|
||||||
|
|
||||||
jsoncpp_headers = [
|
jsoncpp_headers = [
|
||||||
'include/json/allocator.h',
|
'include/json/allocator.h',
|
||||||
@ -28,7 +39,6 @@ jsoncpp_headers = [
|
|||||||
'include/json/json.h',
|
'include/json/json.h',
|
||||||
'include/json/reader.h',
|
'include/json/reader.h',
|
||||||
'include/json/value.h',
|
'include/json/value.h',
|
||||||
'include/json/version.h',
|
|
||||||
'include/json/writer.h']
|
'include/json/writer.h']
|
||||||
jsoncpp_include_directories = include_directories('include')
|
jsoncpp_include_directories = include_directories('include')
|
||||||
|
|
||||||
@ -46,12 +56,13 @@ endif
|
|||||||
|
|
||||||
jsoncpp_lib = library(
|
jsoncpp_lib = library(
|
||||||
'jsoncpp',
|
'jsoncpp',
|
||||||
[ jsoncpp_headers,
|
[ jsoncpp_gen_sources,
|
||||||
|
jsoncpp_headers,
|
||||||
'src/lib_json/json_tool.h',
|
'src/lib_json/json_tool.h',
|
||||||
'src/lib_json/json_reader.cpp',
|
'src/lib_json/json_reader.cpp',
|
||||||
'src/lib_json/json_value.cpp',
|
'src/lib_json/json_value.cpp',
|
||||||
'src/lib_json/json_writer.cpp'],
|
'src/lib_json/json_writer.cpp'],
|
||||||
soversion : 22,
|
soversion : 21,
|
||||||
install : true,
|
install : true,
|
||||||
include_directories : jsoncpp_include_directories,
|
include_directories : jsoncpp_include_directories,
|
||||||
cpp_args: dll_export_flag)
|
cpp_args: dll_export_flag)
|
||||||
@ -68,7 +79,7 @@ jsoncpp_dep = declare_dependency(
|
|||||||
include_directories : jsoncpp_include_directories,
|
include_directories : jsoncpp_include_directories,
|
||||||
link_with : jsoncpp_lib,
|
link_with : jsoncpp_lib,
|
||||||
version : meson.project_version(),
|
version : meson.project_version(),
|
||||||
)
|
sources : jsoncpp_gen_sources)
|
||||||
|
|
||||||
# tests
|
# tests
|
||||||
python = import('python3').find_python()
|
python = import('python3').find_python()
|
||||||
|
@ -45,9 +45,9 @@ set( PUBLIC_HEADERS
|
|||||||
${JSONCPP_INCLUDE_DIR}/json/features.h
|
${JSONCPP_INCLUDE_DIR}/json/features.h
|
||||||
${JSONCPP_INCLUDE_DIR}/json/value.h
|
${JSONCPP_INCLUDE_DIR}/json/value.h
|
||||||
${JSONCPP_INCLUDE_DIR}/json/reader.h
|
${JSONCPP_INCLUDE_DIR}/json/reader.h
|
||||||
${JSONCPP_INCLUDE_DIR}/json/version.h
|
|
||||||
${JSONCPP_INCLUDE_DIR}/json/writer.h
|
${JSONCPP_INCLUDE_DIR}/json/writer.h
|
||||||
${JSONCPP_INCLUDE_DIR}/json/assertions.h
|
${JSONCPP_INCLUDE_DIR}/json/assertions.h
|
||||||
|
${PROJECT_BINARY_DIR}/include/json/version.h
|
||||||
)
|
)
|
||||||
|
|
||||||
source_group( "Public API" FILES ${PUBLIC_HEADERS} )
|
source_group( "Public API" FILES ${PUBLIC_HEADERS} )
|
||||||
@ -57,7 +57,8 @@ set(jsoncpp_sources
|
|||||||
json_reader.cpp
|
json_reader.cpp
|
||||||
json_valueiterator.inl
|
json_valueiterator.inl
|
||||||
json_value.cpp
|
json_value.cpp
|
||||||
json_writer.cpp)
|
json_writer.cpp
|
||||||
|
version.h.in)
|
||||||
|
|
||||||
# Install instructions for this target
|
# Install instructions for this target
|
||||||
if(JSONCPP_WITH_CMAKE_PACKAGE)
|
if(JSONCPP_WITH_CMAKE_PACKAGE)
|
||||||
|
22
src/lib_json/version.h.in
Normal file
22
src/lib_json/version.h.in
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
// DO NOT EDIT. This file (and "version") is a template used by the build system
|
||||||
|
// (either CMake or Meson) to generate a "version.h" header file.
|
||||||
|
#ifndef JSON_VERSION_H_INCLUDED
|
||||||
|
#define JSON_VERSION_H_INCLUDED
|
||||||
|
|
||||||
|
#define JSONCPP_VERSION_STRING "@JSONCPP_VERSION@"
|
||||||
|
#define JSONCPP_VERSION_MAJOR @JSONCPP_VERSION_MAJOR@
|
||||||
|
#define JSONCPP_VERSION_MINOR @JSONCPP_VERSION_MINOR@
|
||||||
|
#define JSONCPP_VERSION_PATCH @JSONCPP_VERSION_PATCH@
|
||||||
|
#define JSONCPP_VERSION_QUALIFIER
|
||||||
|
#define JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) \
|
||||||
|
| (JSONCPP_VERSION_MINOR << 16) \
|
||||||
|
| (JSONCPP_VERSION_PATCH << 8))
|
||||||
|
|
||||||
|
#ifdef JSONCPP_USING_SECURE_MEMORY
|
||||||
|
#undef JSONCPP_USING_SECURE_MEMORY
|
||||||
|
#endif
|
||||||
|
#define JSONCPP_USING_SECURE_MEMORY @JSONCPP_USE_SECURE_MEMORY@
|
||||||
|
// If non-zero, the library zeroes any memory that it has allocated before
|
||||||
|
// it frees its memory.
|
||||||
|
|
||||||
|
#endif // JSON_VERSION_H_INCLUDED
|
1
version.txt
Normal file
1
version.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
1.8.4
|
Loading…
Reference in New Issue
Block a user