From 9066ed074c7d6f578557a6a884bf8094dbd42596 Mon Sep 17 00:00:00 2001 From: Dmitry Arkhipov Date: Thu, 10 Oct 2024 11:52:13 +0300 Subject: [PATCH] bench jamfile cleanup --- bench/Jamfile | 33 +++++++++------------------------ bench/bench.jam | 5 ----- bench/boost-json-bench.jam | 5 +++++ 3 files changed, 14 insertions(+), 29 deletions(-) delete mode 100644 bench/bench.jam create mode 100644 bench/boost-json-bench.jam diff --git a/bench/Jamfile b/bench/Jamfile index 4493558ec..21f8e0649 100644 --- a/bench/Jamfile +++ b/bench/Jamfile @@ -7,17 +7,14 @@ # Official repository: https://github.com/boostorg/json # -import bench ; +import boost-json-bench ; import common ; import feature ; import notfile ; import os ; import path ; import property ; - -path-constant HERE : . ; - -.BENCH_FILES = [ os.environ BENCH_FILES ] ; +import toolset ; local has_nlohmann_json = [ glob lib/nlohmann/single_include/nlohmann/json.hpp ] ; @@ -46,16 +43,12 @@ install bench-local : bench : . true ; explicit bench-local ; always bench-local ; -local bench-files = [ glob $(HERE)/data/*.json ] ; +local bench-files = [ glob-tree-ex 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) { @@ -67,21 +60,13 @@ rule run-bench ( target : sources * : props * ) 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 +actions run-bench bind FILES { - $(LAUNCHER)$(>) $(FLAGS) $(FILES) + $(LAUNCHER) $(>) $(FLAGS) $(FILES) } + +toolset.flags $(__name__).run-bench FLAGS : ; +toolset.flags $(__name__).run-bench FLAGS : ; +toolset.flags $(__name__).run-bench FILES : ; diff --git a/bench/bench.jam b/bench/bench.jam deleted file mode 100644 index 5c16acba0..000000000 --- a/bench/bench.jam +++ /dev/null @@ -1,5 +0,0 @@ -import feature ; - -feature.feature bench.option : : free optional ; -feature.feature bench.launcher : : free optional ; -feature.feature bench.file : : free optional ; diff --git a/bench/boost-json-bench.jam b/bench/boost-json-bench.jam new file mode 100644 index 000000000..975627827 --- /dev/null +++ b/bench/boost-json-bench.jam @@ -0,0 +1,5 @@ +import feature ; + +feature.feature bench.file : : free dependency ; +feature.feature bench.launcher : : free incidental optional ; +feature.feature bench.option : : free incidental ;