chore: support benchmarks on Windows

This commit is contained in:
Marcus Holland-Moritz 2024-02-10 13:23:59 +01:00
parent 336cce52bf
commit f125999ffa
3 changed files with 8 additions and 8 deletions

View File

@ -751,14 +751,14 @@ endif()
if(WITH_BENCHMARKS) if(WITH_BENCHMARKS)
if(NOT STATIC_BUILD_DO_NOT_USE) if(NOT STATIC_BUILD_DO_NOT_USE)
pkg_check_modules(BENCHMARK IMPORTED_TARGET benchmark) find_package(benchmark)
if(BENCHMARK_FOUND) if(benchmark_FOUND)
add_executable(dwarfs_benchmark test/dwarfs_benchmark.cpp) add_executable(dwarfs_benchmark test/dwarfs_benchmark.cpp)
target_link_libraries(dwarfs_benchmark test_helpers PkgConfig::BENCHMARK) target_link_libraries(dwarfs_benchmark test_helpers benchmark::benchmark)
list(APPEND BINARY_TARGETS dwarfs_benchmark) list(APPEND BINARY_TARGETS dwarfs_benchmark)
add_executable(multiversioning_benchmark test/multiversioning_benchmark.cpp) add_executable(multiversioning_benchmark test/multiversioning_benchmark.cpp)
target_link_libraries(multiversioning_benchmark test_helpers PkgConfig::BENCHMARK) target_link_libraries(multiversioning_benchmark test_helpers benchmark::benchmark)
list(APPEND BINARY_TARGETS multiversioning_benchmark) list(APPEND BINARY_TARGETS multiversioning_benchmark)
endif() endif()
endif() endif()

View File

@ -42,11 +42,10 @@ target_compile_features(ricepp PUBLIC cxx_std_20)
# target_link_libraries(ricepp_demo PRIVATE ricepp fmt) # target_link_libraries(ricepp_demo PRIVATE ricepp fmt)
if(WITH_BENCHMARKS) if(WITH_BENCHMARKS)
find_package(PkgConfig REQUIRED) find_package(benchmark)
pkg_check_modules(BENCHMARK IMPORTED_TARGET benchmark) if(benchmark_FOUND)
if(BENCHMARK_FOUND)
add_executable(ricepp_benchmark ricepp_benchmark.cpp) add_executable(ricepp_benchmark ricepp_benchmark.cpp)
target_link_libraries(ricepp_benchmark ricepp PkgConfig::BENCHMARK) target_link_libraries(ricepp_benchmark ricepp benchmark::benchmark)
endif() endif()
endif() endif()

View File

@ -1,5 +1,6 @@
{ {
"dependencies": [ "dependencies": [
"benchmark",
"boost-asio", "boost-asio",
"boost-chrono", "boost-chrono",
"boost-context", "boost-context",