-
Notifications
You must be signed in to change notification settings - Fork 66
/
CMakeLists.txt
75 lines (58 loc) · 1.74 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
cmake_minimum_required(VERSION 3.11.0 FATAL_ERROR)
message("-- The cmake version is ${CMAKE_VERSION}")
if (${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
message(FATAL_ERROR
"You are trying to cmake in-tree and this is not supported. Please run "
"the following instead:\n"
" $ rm CMakeCache.txt\n"
" $ mkdir build\n"
" $ cd build\n"
" $ cmake ..\n"
" $ ninja")
endif()
# cmake includes
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
set(PACKAGE_NAME "skip")
set(PACKAGE_VERSION "0.1")
set(GIT_EXISTS FALSE)
if (EXISTS ${CMAKE_SOURCE_DIR}/.git)
set(GIT_EXISTS TRUE)
endif ()
project(${PACKAGE_NAME} LANGUAGES C CXX ASM)
# Force the use of c++17 without GNU extensions
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
include(SkipOptions)
include(SkipCompiler)
include(SkipUtil)
include(SkipFunctions)
if (APPLE)
set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl")
endif ()
if(USE_JEMALLOC)
add_definitions(-DUSE_JEMALLOC)
endif()
set(ENABLE_ASYNC_MYSQL OFF)
set(ENABLE_MCROUTER OFF)
set(ENABLE_GOOGLETEST ON)
set(JEMALLOC_ENABLED ON)
find_package(Clang)
# This allows us to strip unused code using -gc-sections
add_compile_options(-ffunction-sections -fdata-sections)
if(CMAKE_VERSION VERSION_LESS "3.11.0")
# Allow use of 'test' target
cmake_policy(SET CMP0037 OLD)
endif()
add_custom_target(test)
# TODO: Workaround for T22755682 (LLVM bug).
set(SKIP_COMPILE_FLAGS --nbe-flags=--nogoto)
set(LKG_DIR ${CMAKE_SOURCE_DIR}/lkg)
set(TOOLS_DIR ${CMAKE_SOURCE_DIR}/tools)
add_subdirectory(third-party)
add_subdirectory(lkg)
add_subdirectory(src)
add_subdirectory(tests)
if (NOT BUILD_TOOLS)
message(FATAL_ERROR "BUILD_TOOLS not set")
endif()