# # Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com) # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # # Official repository: https://github.com/boostorg/json # import boost-json-bench ; import common ; import feature ; import notfile ; import os ; import path ; import property ; import toolset ; local has_nlohmann_json = [ glob lib/nlohmann/single_include/nlohmann/json.hpp ] ; if $(has_nlohmann_json) { has_nlohmann_json = "" ; } local has_rapidjson = [ glob lib/rapidjson/include/rapidjson/rapidjson.h ] ; if $(has_rapidjson) { has_rapidjson = "" ; } exe bench : bench.cpp /boost/json//boost_json : ../test ../example $(has_nlohmann_json)BOOST_JSON_HAS_NLOHMANN_JSON $(has_rapidjson)BOOST_JSON_HAS_RAPIDJSON ; install bench-local : bench : . true ; explicit bench-local ; always bench-local ; local bench-files = [ glob-tree-ex data : *.json ] ; notfile run : @run-bench : bench : : $(bench-files) ; explicit run ; rule run-bench ( target : sources * : props * ) { local launcher = [ property.select bench.launcher : $(props) ] ; if $(launcher) { launcher = "$(launcher:G=) " ; launcher = "$(launcher:J=) " ; } else { launcher = "" ; } LAUNCHER on $(target) = $(launcher) ; } actions run-bench bind FILES { $(LAUNCHER) $(>) $(FLAGS) $(FILES) } toolset.flags $(__name__).run-bench FLAGS : ; toolset.flags $(__name__).run-bench FLAGS : ; toolset.flags $(__name__).run-bench FILES : ;