Skip to content

Commit

Permalink
Bugfix/meson (#52)
Browse files Browse the repository at this point in the history
* Added meson files for boost.json
  • Loading branch information
jharmer95 authored Mar 2, 2021
1 parent 4253073 commit 97515cb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
8 changes: 7 additions & 1 deletion include/rpc_adapters/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 4 additions & 0 deletions tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 97515cb

Please sign in to comment.