3
3
# project(jl-bench-eqs)
4
4
5
5
# set(CMAKE_BUILD_TYPE Debug)
6
+ include (FetchContent )
7
+
6
8
set (BUILD_TESTING OFF ) # Disable Faker tests
7
9
FetchContent_Declare (faker
8
10
GIT_REPOSITORY https://github.com/cieslarmichal/faker-cxx.git
@@ -11,6 +13,13 @@ FetchContent_Declare(faker
11
13
12
14
FetchContent_MakeAvailable (faker )
13
15
16
+ FetchContent_Declare (
17
+ cxxopts
18
+ GIT_REPOSITORY https://github.com/jarro2783/cxxopts.git
19
+ GIT_TAG v3.3.1
20
+ )
21
+ FetchContent_MakeAvailable (cxxopts )
22
+
14
23
add_executable (jl-bench-eq src/benchmark-equality.cpp )
15
24
add_compile_options (-Wall -Wextra -Wunused-variable )
16
25
@@ -64,22 +73,20 @@ target_link_libraries(jl-bench-membership PRIVATE jsonlogic faker-cxx)
64
73
# ${CMAKE_BINARY_DIR}/_deps/faker-src/include
65
74
# )
66
75
67
- add_executable (jl-bench-complex1 src/benchmark-complex1.cpp )
68
- target_compile_options (jl-bench-complex1 PRIVATE -O3 )
69
- target_include_directories (jl-bench-complex1 SYSTEM PRIVATE
70
- ${CMAKE_CURRENT_SOURCE_DIR} /../bench/include
71
- ${CMAKE_CURRENT_SOURCE_DIR} /../include
72
- )
73
-
74
- configure_file (${CMAKE_SOURCE_DIR} /bench/src/complex1.json ${CMAKE_BINARY_DIR} /bench/complex1.json COPYONLY )
75
- target_link_libraries (jl-bench-complex1 PRIVATE jsonlogic faker-cxx )
76
76
77
- add_executable (jl-bench-simple-and src/benchmark-simple-and.cpp )
78
- target_compile_options (jl-bench-simple-and PRIVATE -O3 )
79
- target_include_directories (jl-bench-simple-and SYSTEM PRIVATE
77
+ add_executable (jl-bench-generic src/benchmark-generic.cpp )
78
+ target_include_directories (jl-bench-generic SYSTEM PRIVATE
80
79
${CMAKE_CURRENT_SOURCE_DIR} /../bench/include
81
80
${CMAKE_CURRENT_SOURCE_DIR} /../include
82
81
)
83
82
84
- configure_file (${CMAKE_SOURCE_DIR} /bench/src/simple-and.json ${CMAKE_BINARY_DIR} /bench/simple-and.json COPYONLY )
85
- target_link_libraries (jl-bench-simple-and PRIVATE jsonlogic faker-cxx )
83
+ target_link_libraries (jl-bench-generic PRIVATE faker-cxx jsonlogic cxxopts )
84
+ target_compile_features (jl-bench-generic PRIVATE cxx_std_20 )
85
+ target_compile_options (jl-bench-generic PRIVATE -O3 )
86
+
87
+ # Copy all .json files from bench/src to the build directory's bench folder
88
+ file (GLOB BENCH_JSON_FILES "${CMAKE_SOURCE_DIR} /bench/src/*.json" )
89
+ foreach (jsonfile ${BENCH_JSON_FILES} )
90
+ get_filename_component (jsonfile_name "${jsonfile} " NAME )
91
+ configure_file (${jsonfile} ${CMAKE_BINARY_DIR} /bench/${jsonfile_name} COPYONLY )
92
+ endforeach ()
0 commit comments