FTXUI/cmake/ftxui_benchmark.cmake

32 lines
843 B
CMake
Raw Normal View History

if (NOT WIN32)
FetchContent_Declare(googlebenchmark
GIT_REPOSITORY "https://github.com/google/benchmark"
GIT_TAG 62937f91b5c763a8e119d0c20c67b87bde8eff1c
2022-04-17 21:47:20 +08:00
GIT_PROGRESS TRUE
)
2022-01-23 00:58:33 +08:00
FetchContent_GetProperties(googlebenchmark)
2022-04-17 21:47:20 +08:00
set (BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE INTERNAL "")
set (BENCHMARK_ENABLE_TESTING OFF CACHE INTERNAL "")
2022-01-23 00:58:33 +08:00
if(NOT googlebenchmark_POPULATED)
FetchContent_Populate(googlebenchmark)
2022-04-17 21:47:20 +08:00
add_subdirectory(
${googlebenchmark_SOURCE_DIR}
${googlebenchmark_BINARY_DIR}
EXCLUDE_FROM_ALL
)
2022-01-23 00:58:33 +08:00
endif()
add_executable(ftxui_benchmark
src/ftxui/dom/benchmark_test.cpp
)
target_link_libraries(ftxui_benchmark
PRIVATE dom
PRIVATE benchmark::benchmark
PRIVATE benchmark::benchmark_main
)
target_include_directories(ftxui_benchmark
PRIVATE src
)
endif()