-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·59 lines (50 loc) · 1.33 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
#
# Copyright (C) 2024 Patrick Rotsaert
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
cmake_minimum_required(VERSION 3.22)
project(bitcask CXX)
include(deps.cmake)
function(add_cxx_executable TARGET)
add_executable(${TARGET} ${ARGN})
target_compile_features(${TARGET} PRIVATE cxx_std_20)
target_compile_options(${TARGET} PRIVATE
"$<$<COMPILE_LANG_AND_ID:CXX,ARMClang,AppleClang,Clang,GNU,LCC>:$<BUILD_INTERFACE:-Wall;-Wextra;-pedantic;-Werror>>"
"$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:$<BUILD_INTERFACE:/W4;/WX>>"
)
endfunction()
add_cxx_executable(bitcask
bitcask.cpp
bitcask.h
datadir.cpp
datadir.h
datafile.cpp
datafile.h
hintfile.cpp
hintfile.h
keydir.cpp
keydir.h
basictypes.h
locktypes.hpp
lockfile.cpp
lockfile.h
lockfile_impl_posix.hpp
crc32.cpp
crc32.h
file.cpp
file.h
hton.h
config.h.in
main.cpp
test_operation.h
make_random_operations.cpp
make_random_operations.h
counter_timer.hpp
syncqueue.hpp
)
target_link_libraries(bitcask PRIVATE fmt::fmt)
option(BITCASK_THREAD_SAFE "Compile with locking code" true)
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)
target_include_directories(bitcask PRIVATE ${CMAKE_CURRENT_BINARY_DIR})