# # 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 common ; import os ; import path ; import property ; import bench.jam ; import feature ; path-constant HERE : . ; .BENCH_FILES = [ os.environ BENCH_FILES ] ; 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 $(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 $(HERE)/data/*.json ] ; notfile run : @run-bench : bench : : $(bench-files) ; explicit run ; rule run-bench ( target : sources * : props * ) { local flags = [ property.select flags : $(props) ] ; flags += [ property.select bench.option : $(props) ] ; FLAGS on $(target) = $(flags:G=) ; local launcher = [ property.select bench.launcher : $(props) ] ; if $(launcher) { launcher = "$(launcher:G=) " ; launcher = "$(launcher:J=) " ; } else { launcher = "" ; } LAUNCHER on $(target) = $(launcher) ; local files = [ property.select bench.file : $(props) ] ; FILES on $(target) = $(files:G=) ; local dir = [ on $(target) return $(LOCATE) ] ; if $(dir) { dir = [ path.make $(dir) ] ; dir = $(dir)/$(target:G=) ; common.MkDir $(dir) ; DEPENDS $(target) : $(dir) ; } } actions run-bench { $(LAUNCHER)$(>) $(FLAGS) $(FILES) }