77# Official repository: https://github.com/boostorg/json
88#
99
10- import bench ;
10+ import boost-json- bench ;
1111import common ;
1212import feature ;
1313import notfile ;
1414import os ;
1515import path ;
1616import property ;
17-
18- path-constant HERE : . ;
19-
20- .BENCH_FILES = [ os.environ BENCH_FILES ] ;
17+ import toolset ;
2118
2219local has_nlohmann_json = [
2320 glob lib/nlohmann/single_include/nlohmann/json.hpp ] ;
@@ -46,16 +43,12 @@ install bench-local : bench : <location>. <hardcode-dll-paths>true ;
4643explicit bench-local ;
4744always bench-local ;
4845
49- local bench-files = [ glob $(HERE)/ data/ *.json ] ;
46+ local bench-files = [ glob-tree-ex data : *.json ] ;
5047notfile run : @run-bench : bench : : <bench.file>$(bench-files) ;
5148explicit run ;
5249
5350rule run-bench ( target : sources * : props * )
5451{
55- local flags = [ property.select flags : $(props) ] ;
56- flags += [ property.select bench.option : $(props) ] ;
57- FLAGS on $(target) = $(flags:G=) ;
58-
5952 local launcher = [ property.select bench.launcher : $(props) ] ;
6053 if $(launcher)
6154 {
@@ -67,21 +60,13 @@ rule run-bench ( target : sources * : props * )
6760 launcher = "" ;
6861 }
6962 LAUNCHER on $(target) = $(launcher) ;
70-
71- local files = [ property.select bench.file : $(props) ] ;
72- FILES on $(target) = $(files:G=) ;
73-
74- local dir = [ on $(target) return $(LOCATE) ] ;
75- if $(dir)
76- {
77- dir = [ path.make $(dir) ] ;
78- dir = $(dir)/$(target:G=) ;
79- common.MkDir $(dir) ;
80- DEPENDS $(target) : $(dir) ;
81- }
8263}
8364
84- actions run-bench
65+ actions run-bench bind FILES
8566{
86- $(LAUNCHER)$(>) $(FLAGS) $(FILES)
67+ $(LAUNCHER) $(>) $(FLAGS) $(FILES)
8768}
69+
70+ toolset.flags $(__name__).run-bench FLAGS : <flag> ;
71+ toolset.flags $(__name__).run-bench FLAGS : <bench.option> ;
72+ toolset.flags $(__name__).run-bench FILES : <bench.file> ;
0 commit comments