Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 22 additions & 16 deletions benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,28 @@
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

include(FetchContent)
FetchContent_Declare(
googlebenchmark
GIT_REPOSITORY https://github.com/google/benchmark.git
GIT_TAG v1.9.0)

set(BENCHMARK_ENABLE_GTEST_TESTS
OFF
CACHE BOOL "" FORCE)
set(BENCHMARK_ENABLE_TESTING
OFF
CACHE BOOL "" FORCE)
set(BENCHMARK_ENABLE_INSTALL
OFF
CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googlebenchmark)
set(GBENCH_VERSION 1.9.0)

find_package(benchmark ${GBENCH_VERSION} QUIET)

if(NOT benchmark_FOUND)
include(FetchContent)
FetchContent_Declare(
googlebenchmark
GIT_REPOSITORY https://github.com/google/benchmark.git
GIT_TAG v${GBENCH_VERSION})

set(BENCHMARK_ENABLE_GTEST_TESTS
OFF
CACHE BOOL "" FORCE)
set(BENCHMARK_ENABLE_TESTING
OFF
CACHE BOOL "" FORCE)
set(BENCHMARK_ENABLE_INSTALL
OFF
CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googlebenchmark)
endif()

# In MSVC builds, there is no way to determine the actual build type during the
# CMake configuration step. Therefore, this message is printed in all MSVC
Expand Down
Loading