mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-26 02:00:50 +08:00
Meson updates (#1124)
* Modernize meson.build * Make tests optional * Use `files()` for quick sanity checks * Bump version to 1.9.3 * Bump SOVERSION, as some functions were removed and structs were changed, as determined by libabigail.
This commit is contained in:
parent
f11611c878
commit
6bc55ec35d
@ -70,7 +70,7 @@ project(JSONCPP
|
|||||||
# 2. /include/json/version.h
|
# 2. /include/json/version.h
|
||||||
# 3. /CMakeLists.txt
|
# 3. /CMakeLists.txt
|
||||||
# IMPORTANT: also update the SOVERSION!!
|
# IMPORTANT: also update the SOVERSION!!
|
||||||
VERSION 1.9.2 # <major>[.<minor>[.<patch>[.<tweak>]]]
|
VERSION 1.9.3 # <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}")
|
||||||
|
@ -9,10 +9,10 @@
|
|||||||
// 3. /CMakeLists.txt
|
// 3. /CMakeLists.txt
|
||||||
// IMPORTANT: also update the SOVERSION!!
|
// IMPORTANT: also update the SOVERSION!!
|
||||||
|
|
||||||
#define JSONCPP_VERSION_STRING "1.9.2"
|
#define JSONCPP_VERSION_STRING "1.9.3"
|
||||||
#define JSONCPP_VERSION_MAJOR 1
|
#define JSONCPP_VERSION_MAJOR 1
|
||||||
#define JSONCPP_VERSION_MINOR 9
|
#define JSONCPP_VERSION_MINOR 9
|
||||||
#define JSONCPP_VERSION_PATCH 2
|
#define JSONCPP_VERSION_PATCH 3
|
||||||
#define JSONCPP_VERSION_QUALIFIER
|
#define JSONCPP_VERSION_QUALIFIER
|
||||||
#define JSONCPP_VERSION_HEXA \
|
#define JSONCPP_VERSION_HEXA \
|
||||||
((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | \
|
((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | \
|
||||||
|
33
meson.build
33
meson.build
@ -9,7 +9,7 @@ project(
|
|||||||
# 2. /include/json/version.h
|
# 2. /include/json/version.h
|
||||||
# 3. /CMakeLists.txt
|
# 3. /CMakeLists.txt
|
||||||
# IMPORTANT: also update the SOVERSION!!
|
# IMPORTANT: also update the SOVERSION!!
|
||||||
version : '1.9.2',
|
version : '1.9.3',
|
||||||
default_options : [
|
default_options : [
|
||||||
'buildtype=release',
|
'buildtype=release',
|
||||||
'cpp_std=c++11',
|
'cpp_std=c++11',
|
||||||
@ -18,7 +18,7 @@ project(
|
|||||||
meson_version : '>= 0.49.0')
|
meson_version : '>= 0.49.0')
|
||||||
|
|
||||||
|
|
||||||
jsoncpp_headers = [
|
jsoncpp_headers = files([
|
||||||
'include/json/allocator.h',
|
'include/json/allocator.h',
|
||||||
'include/json/assertions.h',
|
'include/json/assertions.h',
|
||||||
'include/json/config.h',
|
'include/json/config.h',
|
||||||
@ -28,7 +28,8 @@ jsoncpp_headers = [
|
|||||||
'include/json/reader.h',
|
'include/json/reader.h',
|
||||||
'include/json/value.h',
|
'include/json/value.h',
|
||||||
'include/json/version.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')
|
||||||
|
|
||||||
install_headers(
|
install_headers(
|
||||||
@ -44,13 +45,12 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
jsoncpp_lib = library(
|
jsoncpp_lib = library(
|
||||||
'jsoncpp',
|
'jsoncpp', files([
|
||||||
[ jsoncpp_headers,
|
|
||||||
'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 : 23,
|
||||||
install : true,
|
install : true,
|
||||||
include_directories : jsoncpp_include_directories,
|
include_directories : jsoncpp_include_directories,
|
||||||
cpp_args: dll_export_flag)
|
cpp_args: dll_export_flag)
|
||||||
@ -66,18 +66,21 @@ import('pkgconfig').generate(
|
|||||||
jsoncpp_dep = declare_dependency(
|
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())
|
||||||
)
|
|
||||||
|
|
||||||
# tests
|
# tests
|
||||||
python = import('python').find_installation()
|
if meson.is_subproject() or not get_option('tests')
|
||||||
|
subdir_done()
|
||||||
|
endif
|
||||||
|
|
||||||
|
python = import('python').find_installation('python3')
|
||||||
|
|
||||||
jsoncpp_test = executable(
|
jsoncpp_test = executable(
|
||||||
'jsoncpp_test',
|
'jsoncpp_test', files([
|
||||||
[ 'src/test_lib_json/jsontest.cpp',
|
'src/test_lib_json/jsontest.cpp',
|
||||||
'src/test_lib_json/jsontest.h',
|
|
||||||
'src/test_lib_json/main.cpp',
|
'src/test_lib_json/main.cpp',
|
||||||
'src/test_lib_json/fuzz.cpp'],
|
'src/test_lib_json/fuzz.cpp',
|
||||||
|
]),
|
||||||
include_directories : jsoncpp_include_directories,
|
include_directories : jsoncpp_include_directories,
|
||||||
link_with : jsoncpp_lib,
|
link_with : jsoncpp_lib,
|
||||||
install : false,
|
install : false,
|
||||||
|
5
meson_options.txt
Normal file
5
meson_options.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
option(
|
||||||
|
'tests',
|
||||||
|
type : 'boolean',
|
||||||
|
value : true,
|
||||||
|
description : 'Enable building tests')
|
Loading…
x
Reference in New Issue
Block a user