Allow folly usages only if TD_TEST_FOLLY is defined.

This commit is contained in:
levlam 2022-02-23 15:01:53 +03:00
parent 408aa95f76
commit 1f12b0d8e8
2 changed files with 22 additions and 18 deletions

View File

@ -73,6 +73,7 @@ if (NOT WIN32 AND NOT CYGWIN)
target_link_libraries(bench_queue PRIVATE tdutils) target_link_libraries(bench_queue PRIVATE tdutils)
endif() endif()
if (TD_TEST_FOLLY)
find_package(ABSL QUIET) find_package(ABSL QUIET)
find_package(folly QUIET) find_package(folly QUIET)
find_package(gflags QUIET) find_package(gflags QUIET)
@ -89,3 +90,4 @@ if (ABSL_FOUND AND folly_FOUND)
add_executable(hashmap-build hashmap_build.cpp) add_executable(hashmap-build hashmap_build.cpp)
target_link_libraries(hashmap-build PRIVATE tdutils Folly::folly absl::flat_hash_map absl::hash) target_link_libraries(hashmap-build PRIVATE tdutils Folly::folly absl::flat_hash_map absl::hash)
endif() endif()
endif()

View File

@ -390,6 +390,7 @@ install(TARGETS tdutils EXPORT TdTargets
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
) )
if (TD_TEST_FOLLY)
find_package(benchmark QUIET) find_package(benchmark QUIET)
find_package(folly QUIET) find_package(folly QUIET)
find_package(gflags QUIET) find_package(gflags QUIET)
@ -398,3 +399,4 @@ if (ABSL_FOUND AND benchmark_FOUND AND folly_FOUND)
add_executable(benchmark-hashset test/hashset_benchmark.cpp) add_executable(benchmark-hashset test/hashset_benchmark.cpp)
target_link_libraries(benchmark-hashset PRIVATE tdutils benchmark::benchmark Folly::folly absl::flat_hash_map absl::hash) target_link_libraries(benchmark-hashset PRIVATE tdutils benchmark::benchmark Folly::folly absl::flat_hash_map absl::hash)
endif() endif()
endif()