-
Notifications
You must be signed in to change notification settings - Fork 319
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
121 lines (111 loc) · 3.98 KB
/
CMakeLists.txt
File metadata and controls
121 lines (111 loc) · 3.98 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# 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(SERIALIZATION serialization/objects.thrift json)
add_library (cachelib_navy
${SERIALIZATION_THRIFT_FILES}
admission_policy/DynamicRandomAP.cpp
admission_policy/RejectRandomAP.cpp
bighash/BigHash.cpp
bighash/Bucket.cpp
bighash/BucketStorage.cpp
block_cache/Allocator.cpp
block_cache/BlockCache.cpp
block_cache/FifoPolicy.cpp
block_cache/HitsReinsertionPolicy.cpp
block_cache/LruPolicy.cpp
block_cache/Region.cpp
block_cache/RegionManager.cpp
block_cache/SparseMapIndex.cpp
common/Buffer.cpp
common/Device.cpp
common/FdpNvme.cpp
common/Hash.cpp
common/NavyThread.cpp
common/SizeDistribution.cpp
common/Types.cpp
driver/Driver.cpp
engine/EnginePair.cpp
Factory.cpp
scheduler/NavyRequestDispatcher.cpp
scheduler/NavyRequestScheduler.cpp
scheduler/ThreadPoolJobScheduler.cpp
scheduler/ThreadPoolJobQueue.cpp
serialization/RecordIO.cpp
testing/MockDevice.cpp
)
add_dependencies(cachelib_navy thrift_generated_files)
if(CMAKE_SYSTEM_NAME STREQUAL Linux)
set(MISSING_FALLOCATE FALSE)
else()
set(MISSING_FALLOCATE TRUE)
target_compile_definitions(cachelib_navy PRIVATE MISSING_FALLOCATE)
target_compile_definitions(cachelib_navy PRIVATE MISSING_FADVISE)
endif()
target_link_libraries(cachelib_navy PUBLIC
cachelib_common
GTest::gmock
)
if (BUILD_WITH_DTO)
target_link_libraries(cachelib_navy PUBLIC DTO::dto)
endif()
install(TARGETS cachelib_navy
EXPORT cachelib-exports
DESTINATION ${LIB_INSTALL_DIR} )
if (BUILD_TESTS)
add_library(navy_test_support
testing/BufferGen.cpp
testing/MockDevice.cpp
testing/MockJobScheduler.cpp
testing/SeqPoints.cpp
)
add_dependencies(navy_test_support thrift_generated_files)
target_link_libraries(navy_test_support PUBLIC
cachelib_navy
glog::glog
gflags
GTest::gtest
GTest::gtest_main
GTest::gmock
)
function (add_source_test SOURCE_FILE)
generic_add_source_test("navy-test" "${SOURCE_FILE}" navy_test_support "${ARGN}")
endfunction()
add_source_test (common/tests/BufferTest.cpp)
add_source_test (common/tests/HashTest.cpp)
add_source_test (common/tests/UtilsTest.cpp)
add_source_test (bighash/tests/BucketStorageTest.cpp)
add_source_test (bighash/tests/BucketTest.cpp)
add_source_test (admission_policy/tests/DynamicRandomAPTest.cpp)
add_source_test (admission_policy/tests/RejectRandomAPTest.cpp)
add_source_test (block_cache/tests/FifoPolicyTest.cpp)
add_source_test (block_cache/tests/HitsReinsertionPolicyTest.cpp)
add_source_test (block_cache/tests/LruPolicyTest.cpp)
add_source_test (block_cache/tests/RegionTest.cpp)
add_source_test (serialization/tests/RecordIOTest.cpp)
add_source_test (serialization/tests/SerializationTest.cpp)
add_source_test (scheduler/tests/OrderedThreadPoolJobSchedulerTest.cpp)
add_source_test (scheduler/tests/ThreadPoolJobSchedulerTest.cpp)
add_source_test (driver/tests/DriverTest.cpp)
# Failes from cmake
# if (NOT MISSING_FALLOCATE)
# add_source_test (common/tests/DeviceTest.cpp)
# endif()
add_source_test (block_cache/tests/AllocatorTest.cpp)
add_source_test (block_cache/tests/RegionManagerTest.cpp)
add_source_test (testing/tests/BufferGenTest.cpp)
add_source_test (testing/tests/MockJobSchedulerTest.cpp)
add_source_test (testing/tests/SeqPointsTest.cpp)
add_source_test (block_cache/tests/BlockCacheTest.cpp)
add_source_test (bighash/tests/BigHashTest.cpp)
endif()