]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/third_party/nlohmann-json/benchmarks/CMakeLists.txt
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / third_party / nlohmann-json / benchmarks / CMakeLists.txt
1 cmake_minimum_required(VERSION 3.11)
2 project(JSON_Benchmarks LANGUAGES CXX)
3
4 # set compiler flags
5 if((CMAKE_CXX_COMPILER_ID MATCHES GNU) OR (CMAKE_CXX_COMPILER_ID MATCHES Clang))
6 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto -DNDEBUG -O3")
7 endif()
8
9 # configure Google Benchmarks
10 include(FetchContent)
11 FetchContent_Declare(
12 benchmark
13 GIT_REPOSITORY https://github.com/google/benchmark.git
14 GIT_TAG origin/main
15 GIT_SHALLOW TRUE
16 )
17
18 FetchContent_GetProperties(benchmark)
19 if(NOT benchmark_POPULATED)
20 FetchContent_Populate(benchmark)
21 set(BENCHMARK_ENABLE_TESTING OFF CACHE INTERNAL "" FORCE)
22 add_subdirectory(${benchmark_SOURCE_DIR} ${benchmark_BINARY_DIR})
23 endif()
24
25 # download test data
26 include(${CMAKE_SOURCE_DIR}/../cmake/download_test_data.cmake)
27
28 # benchmark binary
29 add_executable(json_benchmarks src/benchmarks.cpp)
30 target_compile_features(json_benchmarks PRIVATE cxx_std_11)
31 target_link_libraries(json_benchmarks benchmark ${CMAKE_THREAD_LIBS_INIT})
32 add_dependencies(json_benchmarks download_test_data)
33 target_include_directories(json_benchmarks PRIVATE ${CMAKE_SOURCE_DIR}/../single_include ${CMAKE_BINARY_DIR}/include)