Skip to content

Commit

Permalink
Warn when Google benchmarks are not found but benchmarks are requested.
Browse files Browse the repository at this point in the history
  • Loading branch information
pramsey committed Oct 25, 2024
1 parent d7c51c4 commit 793e19a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions benchmarks/algorithm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ target_link_libraries(perf_interiorpoint_area geos)
add_executable(perf_unaryunion_segments UnaryUnionSegmentsPerfTest.cpp)
target_link_libraries(perf_unaryunion_segments geos)

if (BUILD_BENCHMARKS)

if (benchmark_FOUND)
add_executable(perf_orientation OrientationIndexPerfTest.cpp
${PROJECT_SOURCE_DIR}/src/algorithm/CGAlgorithmsDD.cpp
Expand All @@ -41,6 +43,12 @@ if (benchmark_FOUND)
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>)
target_link_libraries(perf_voronoi PRIVATE
benchmark::benchmark geos)
else()
MESSAGE(WARNING "Unable to find google benchmarks library!")
MESSAGE(WARNING " Some benchmarks will not be built!")
MESSAGE(WARNING " See https://github.com/google/benchmark")
endif()

endif()

add_subdirectory(locate)
4 changes: 2 additions & 2 deletions benchmarks/algorithm/LineIntersectorPerfTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ using geos::algorithm::LineIntersector;

template<typename CoordType>
static void BM_PointIntersection(benchmark::State& state) {
std::size_t n = 1000;
std::size_t seed = 12345;
unsigned int n = 1000;
unsigned int seed = 12345;

std::default_random_engine e(seed);

Expand Down

0 comments on commit 793e19a

Please sign in to comment.