-
Notifications
You must be signed in to change notification settings - Fork 319
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
122 lines (108 loc) · 3.52 KB
/
CMakeLists.txt
File metadata and controls
122 lines (108 loc) · 3.52 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
122
# 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_library (cachelib_cachebench
./cache/Cache.cpp
./cache/TimeStampTicker.cpp
./consistency/LogEventStream.cpp
./consistency/ShortThreadId.cpp
./consistency/ValueHistory.cpp
./consistency/ValueTracker.cpp
./runner/FastShutdown.cpp
./runner/IntegrationStressor.cpp
./runner/ProgressTracker.cpp
./runner/Runner.cpp
./runner/Stressor.cpp
./util/CacheConfig.cpp
./util/Config.cpp
./util/NandWrites.cpp
./workload/BlockChunkCache.cpp
./workload/BlockChunkReplayGenerator.cpp
./workload/PieceWiseCache.cpp
./workload/OnlineGenerator.cpp
./workload/WorkloadGenerator.cpp
./workload/PieceWiseReplayGenerator.cpp
./workload/SimpleFlashBenchmarkGenerator.cpp
)
add_dependencies(cachelib_cachebench thrift_generated_files)
target_link_libraries(cachelib_cachebench PUBLIC
cachelib_datatype
cachelib_allocator
gflags
)
add_library (cachelib_binary_trace_gen
./runner/Runner.cpp
./runner/Stressor.cpp
./util/CacheConfig.cpp
./util/Config.cpp
./workload/BlockChunkCache.cpp
./workload/BlockChunkReplayGenerator.cpp
./workload/PieceWiseCache.cpp
./workload/OnlineGenerator.cpp
./workload/WorkloadGenerator.cpp
./workload/PieceWiseReplayGenerator.cpp
)
add_dependencies(cachelib_binary_trace_gen thrift_generated_files)
target_link_libraries(cachelib_binary_trace_gen PUBLIC
cachelib_datatype
cachelib_allocator
gflags
)
if ((CMAKE_SYSTEM_NAME STREQUAL Linux) AND
(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64))
else()
target_compile_definitions(cachelib_cachebench PRIVATE SKIP_OPTION_SIZE_VERIFY)
endif()
add_executable (cachebench main.cpp)
add_executable (binary_trace_gen binary_trace_gen.cpp)
target_link_libraries(cachebench cachelib_cachebench)
target_link_libraries(binary_trace_gen cachelib_binary_trace_gen)
if (BUILD_WITH_DTO)
target_link_libraries(cachebench accel-config DTO::dto)
endif()
install(
TARGETS
cachebench
binary_trace_gen
DESTINATION ${BIN_INSTALL_DIR}
)
if (BUILD_SHARED_LIBS)
install(
TARGETS cachelib_cachebench
EXPORT cachelib-exports
DESTINATION ${LIB_INSTALL_DIR}
)
endif ()
if (BUILD_TESTS)
add_library (cachebench_test_support INTERFACE )
target_link_libraries (cachebench_test_support INTERFACE
cachelib_cachebench
glog::glog
gflags
GTest::gtest
GTest::gtest_main
GTest::gmock
)
function (add_source_test SOURCE_FILE)
generic_add_source_test("cachebench-test" "${SOURCE_FILE}"
cachebench_test_support "${ARGN}")
endfunction()
add_source_test (workload/tests/WorkloadGeneratorTest.cpp)
add_source_test (workload/tests/PieceWiseCacheTest.cpp)
add_source_test (consistency/tests/RingBufferTest.cpp)
add_source_test (consistency/tests/ShortThreadIdTest.cpp)
add_source_test (consistency/tests/ValueHistoryTest.cpp)
add_source_test (consistency/tests/ValueTrackerTest.cpp)
add_source_test (util/tests/NandWritesTest.cpp)
add_source_test (cache/tests/TimeStampTickerTest.cpp)
endif()