diff --git a/benchmarks/algorithm/CMakeLists.txt b/benchmarks/algorithm/CMakeLists.txt index 8b829c21e5..cf89a52e54 100644 --- a/benchmarks/algorithm/CMakeLists.txt +++ b/benchmarks/algorithm/CMakeLists.txt @@ -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 @@ -41,6 +43,12 @@ if (benchmark_FOUND) $) 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) diff --git a/benchmarks/algorithm/LineIntersectorPerfTest.cpp b/benchmarks/algorithm/LineIntersectorPerfTest.cpp index eaa1d77629..151fe5a528 100644 --- a/benchmarks/algorithm/LineIntersectorPerfTest.cpp +++ b/benchmarks/algorithm/LineIntersectorPerfTest.cpp @@ -32,8 +32,8 @@ using geos::algorithm::LineIntersector; template 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);