This repository has been archived by the owner on Mar 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
135 lines (110 loc) · 4.14 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
cmake_minimum_required(VERSION 3.13)
project(BCDB
VERSION 0.1.0
HOMEPAGE_URL "https://github.com/yotann/bcdb"
LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
"${CMAKE_CURRENT_SOURCE_DIR}/third_party/cmake-modules"
)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_definitions(-Wall
-Wno-covered-switch-default)
elseif (CMAKE_COMPILER_IS_GNUCXX)
add_definitions(-Wall
-Wno-redundant-move # sometimes Clang requires a move that GCC warns about
-Wno-init-list-lifetime)
endif()
include(CoverageFlags)
include(SanitizeFlags)
include(GetRevisionDescription)
get_revision_description(REVISION_DESCRIPTION_FINAL)
find_package(LLVM REQUIRED CONFIG)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
if( ${LLVM_PACKAGE_VERSION} VERSION_LESS 11.0 )
message(FATAL_ERROR "LLVM 11 or newer is required")
endif()
if( ${LLVM_PACKAGE_VERSION} STREQUAL 15.0.0git )
message(WARNING "Support for this version of LLVM is unstable")
elseif( NOT (${LLVM_PACKAGE_VERSION} VERSION_LESS 15.0) )
message(FATAL_ERROR "LLVM 14 or older is required")
endif()
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
if(NOT LLVM_ENABLE_EH)
message(FATAL_ERROR "LLVM must be built with exception handling enabled (LLVM_ENABLE_EH=ON). You may need to build it manually (or use Nix).")
endif()
include(FindPythonInterp)
if( NOT PYTHONINTERP_FOUND )
message(FATAL_ERROR
"Unable to find Python interpreter, required for builds and testing.
Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
endif()
if( ${PYTHON_VERSION_STRING} VERSION_LESS 3.6 )
message(FATAL_ERROR "Python 3.6 or newer is required")
endif()
find_package(LibSodium REQUIRED)
find_package(SQLite3 REQUIRED)
find_package(Boost 1.75 REQUIRED COMPONENTS fiber)
add_library(Boost::Beast INTERFACE IMPORTED)
target_include_directories(Boost::Beast SYSTEM INTERFACE ${Boost_INCLUDE_DIRS})
target_compile_definitions(Boost::Beast INTERFACE BOOST_BEAST_USE_STD_STRING_VIEW)
find_program(CLANG clang)
find_program(CLANGXX clang++)
if(NOT CLANG OR NOT CLANGXX)
message(FATAL_ERROR "Clang is required, but missing")
endif()
set(ENABLE_SMOUT ON)
find_package(RocksDB QUIET)
if(RocksDB_FOUND)
set(WITH_ROCKSDB ON)
else(RocksDB_FOUND)
message(WARNING "Could not find RocksDB library; disabling RocksDB support.")
set(WITH_ROCKSDB OFF)
endif(RocksDB_FOUND)
set(LLVM_BUILD_TOOLS ON)
option(LLVM_ENABLE_ASSERTIONS "Enable assertions" ON)
option(LLVM_ENABLE_WARNINGS "Enable warnings" ON)
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
include(AddLLVM)
include(HandleLLVMOptions)
# Put libs and bins in expected place.
# XXX: We don't setup CMAKE_CFG_INTDIR to distinguish Release/Debug/etc.
set(LLVM_TOOLS_INSTALL_DIR
${CMAKE_INSTALL_BINDIR})
set(LLVM_RUNTIME_OUTPUT_INTDIR
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
set(LLVM_LIBRARY_OUTPUT_INTDIR
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
if(WIN32 OR CYGWIN)
set(LLVM_SHLIB_OUTPUT_INTDIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
else()
set(LLVM_SHLIB_OUTPUT_INTDIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
endif()
link_directories(${LLVM_LIBRARY_DIR})
include_directories(${LLVM_INCLUDE_DIR})
include_directories(${PROJECT_SOURCE_DIR}/include)
include_directories(${PROJECT_SOURCE_DIR}/bcdb/include)
include_directories(${PROJECT_SOURCE_DIR}/memodb/include)
include_directories(${PROJECT_SOURCE_DIR}/outlining/include)
include_directories("${PROJECT_SOURCE_DIR}/third_party/dragonbox/include")
add_custom_target(UnitTests)
add_subdirectory(bcdb/lib)
add_subdirectory(bcdb/tools/bc-align)
add_subdirectory(bcdb/tools/bc-imitate)
add_subdirectory(bcdb/tools/bc-join)
add_subdirectory(bcdb/tools/bc-split)
add_subdirectory(bcdb/tools/bcdb)
add_subdirectory(guided_linking/lib)
add_subdirectory(memodb/lib)
add_subdirectory(memodb/tools/memodb)
add_subdirectory(memodb/tools/memodb-server)
add_subdirectory(memodb/unittests)
add_subdirectory(outlining/lib)
add_subdirectory(outlining/tools/smout)
add_subdirectory(outlining/unittests)
add_subdirectory(test)
add_subdirectory(third_party)