From 97515cb51f0d88d8fe26305c7bfc27b776baec66 Mon Sep 17 00:00:00 2001 From: Jackson Date: Mon, 1 Mar 2021 22:00:10 -0500 Subject: [PATCH] Bugfix/meson (#52) * Added meson files for boost.json --- CMakeLists.txt | 2 +- include/rpc_adapters/meson.build | 8 +++++++- meson.build | 2 +- meson_options.txt | 1 + tests/meson.build | 4 ++++ 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f0f48a90..0428bf26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,7 +168,7 @@ install(FILES "${PROJECT_SOURCE_DIR}/include/rpc.hpp" option(BUILD_NJSON_ADAPTER "Build the adapter for nlohmann/json" ON) option(BUILD_RAPIDJSON_ADAPTER "Build the adapter for rapidjson" ON) -option(BUILD_BOOST_JSON_ADAPTER "Build the adapter for Boost.JSON" ON) +option(BUILD_BOOST_JSON_ADAPTER "Build the adapter for Boost.JSON" OFF) add_subdirectory(include/rpc_adapters) diff --git a/include/rpc_adapters/meson.build b/include/rpc_adapters/meson.build index 6c5e1265..96f78805 100644 --- a/include/rpc_adapters/meson.build +++ b/include/rpc_adapters/meson.build @@ -10,5 +10,11 @@ if get_option('build_rapidjson_adapter') add_project_arguments('-DRPC_HPP_RAPIDJSON_ENABLED', language : 'cpp') endif -adapter_list = ['rpc_njson.hpp', 'rpc_rapidjson.hpp'] +if get_option('build_boost_json_adapter') + boost_json_dep = dependency('boost', version : '>=1.75.0') + boost_json_adapter_dep = declare_dependency(dependencies : [rpc_hpp_dep, boost_json_dep]) + add_project_arguments('-DRPC_HPP_BOOST_JSON_ENABLED', language : 'cpp') +endif + +adapter_list = ['rpc_njson.hpp', 'rpc_rapidjson.hpp', 'rpc_boost_json.hpp'] install_headers(adapter_list) diff --git a/meson.build b/meson.build index 56329ef1..bc98ab44 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('rpc.hpp', 'cpp', - version : '0.2.3', + version : '0.2.4', license : 'BSD-3-Clause', default_options : [ 'cpp_std=c++17', diff --git a/meson_options.txt b/meson_options.txt index d774d580..9804d215 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,2 +1,3 @@ option('build_njson_adapter', type : 'boolean', value : true) option('build_rapidjson_adapter', type : 'boolean', value : true) +option('build_boost_json_adapter', type : 'boolean', value : false) diff --git a/tests/meson.build b/tests/meson.build index 0a3cdd8b..0fb9d408 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -14,6 +14,10 @@ if get_option('build_rapidjson_adapter') test_dependencies += [rapidjson_adapter_dep] endif +if get_option('build_boost_json_adapter') + test_dependencies += [boost_json_adapter_dep] +endif + rpc_test_exe = executable('rpc_test', 'rpc.test.cpp', link_with : lib_catch2, dependencies : test_dependencies, install : false, cpp_args : [project_warnings, '-DRPC_HPP_ENABLE_POINTERS']) test('rpc_test', rpc_test_exe)