-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Auto-fetch benchmark when not available #1039
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,32 @@ find_package(Boost 1.56.0 REQUIRED COMPONENTS program_options) | |
|
||
# FIXME: when we start requiring benchmark >= 1.8.0, reenable | ||
# "readability-redundant-string-cstr" check in .clang-tidy | ||
find_package(benchmark 1.5.4 REQUIRED) | ||
message(STATUS "Found benchmark: ${benchmark_DIR} (version \"${benchmark_VERSION}\")") | ||
find_package(benchmark QUIET 1.5.4) | ||
if(benchmark_FOUND) | ||
message(STATUS "Found benchmark: ${benchmark_DIR} (version \"${benchmark_VERSION}\")") | ||
else() | ||
message(STATUS "benchmark not found, fetching from GitHub") | ||
include(FetchContent) | ||
set(BENCHMARK_ENABLE_TESTING OFF) | ||
|
||
list(APPEND CMAKE_MESSAGE_INDENT "[benchmark] ") | ||
FetchContent_Declare( | ||
googlebenchmark | ||
DOWNLOAD_EXTRACT_TIMESTAMP FALSE | ||
URL https://github.com/google/benchmark/archive/refs/tags/v1.8.0.tar.gz | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you comment on the version you picked? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I decided to up the version so that when we fix the comment about (about reenabling clang-tidy check), we would not need to change this. No other reason. The latest Google Benchmark is 1.8.3, so same major. I am aware of the discussion in Kokkos about problems with fetching new versions in the original PR (something to do with Windows). I'm not sure whether that is still an issue. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI |
||
URL_HASH MD5=8ddf8571d3f6198d37852bcbd964f817 | ||
) | ||
FetchContent_MakeAvailable(googlebenchmark) | ||
list(POP_BACK CMAKE_MESSAGE_INDENT) | ||
|
||
# Suppress clang-tidy diagnostics on code that we do not have control over | ||
IF(CMAKE_CXX_CLANG_TIDY) | ||
set_target_properties(benchmark PROPERTIES CXX_CLANG_TIDY "") | ||
ENDIF() | ||
|
||
target_compile_options(benchmark PRIVATE -w) | ||
target_compile_options(benchmark_main PRIVATE -w) | ||
ENDIF() | ||
|
||
add_subdirectory(brute_force_vs_bvh) | ||
add_subdirectory(dbscan) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with