-
Notifications
You must be signed in to change notification settings - Fork 276
/
Copy pathCMakeLists.txt
98 lines (90 loc) · 2.9 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
add_thrift_file(BLOOM BloomFilter.thrift frozen2)
add_library (cachelib_common
BloomFilter.cpp
Cohort.cpp
FurcHash.cpp
CountDownLatch.cpp
${BLOOM_THRIFT_FILES}
hothash/HotHashDetector.cpp
PercentileStats.cpp
PeriodicWorker.cpp
piecewise/GenericPieces.cpp
piecewise/RequestRange.cpp
Serialization.cpp
Utils.cpp
)
add_dependencies(cachelib_common thrift_generated_files)
target_link_libraries(cachelib_common PUBLIC
Threads::Threads
FBThrift::thriftcpp2
FBThrift::thriftprotocol
Folly::folly
Folly::follybenchmark
Folly::folly_exception_tracer
Folly::folly_exception_tracer_base
Folly::folly_exception_counter
numa
)
install(TARGETS cachelib_common
EXPORT cachelib-exports
DESTINATION ${LIB_INSTALL_DIR} )
if (BUILD_TESTS)
add_library (common_test_utils STATIC
TestUtils.cpp
)
target_link_libraries (common_test_utils PUBLIC
cachelib_common
gflags
GTest::gtest
GTest::gtest_main
)
add_library (common_test_support OBJECT
hothash/HotHashDetectorTest.cpp
piecewise/GenericPiecesTest.cpp
piecewise/RequestRangeTest.cpp
)
target_link_libraries (common_test_support PUBLIC
cachelib_common
common_test_utils
gflags
GTest::gtest
GTest::gtest_main
)
function (ADD_TEST SOURCE_FILE)
# Add any additional libraries BEFORE the "common_test_support" to ensure
# that the linking ordering is correct (e.g. if any of them requires
# "gflags", gflags should appear AFTER it).
generic_add_test("common-test" "${SOURCE_FILE}"
"${ARGN}" common_test_support)
endfunction()
add_test (tests/AccessTrackerTest.cpp)
# need allocator/memory/tests/TestBase.cpp:
#add_test (tests/ApproxSplitSetTest.cpp allocator_test_support)
add_test (tests/BloomFilterTest.cpp)
add_test (tests/BytesEqualTest.cpp)
add_test (tests/CohortTests.cpp)
add_test (tests/CounterTests.cpp)
add_test (tests/CountMinSketchTest.cpp)
add_test (tests/EventInterfaceTest.cpp allocator_test_support)
add_test (tests/HashTests.cpp)
add_test (tests/IteratorsTests.cpp)
add_test (tests/MutexTests.cpp)
add_test (tests/PeriodicWorkerTest.cpp)
add_test (tests/SerializationTest.cpp allocator_test_support)
add_test (tests/UtilTests.cpp)
add_test (tests/CountDownLatchTest.cpp)
add_test (tests/UtilTestsRSS.cpp)
endif()