forked from redpanda-data/redpanda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
36 lines (30 loc) · 1.17 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
# Redirect control for internal Redpanda builds
if(VECTORIZED_CMAKE_DIR)
cmake_minimum_required(VERSION 3.22)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(${VECTORIZED_CMAKE_DIR}/main.cmake)
return()
endif()
cmake_minimum_required(VERSION 3.24)
project(redpanda LANGUAGES CXX)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# make "lld" be the default since a full statically linked build using "ld" will
# often fail due to being oom killed at the end of the build when many large
# targets are being linked in parallel.
include(CheckLinkerFlag)
set(Redpanda_LINKER "lld" CACHE STRING "Linker to use")
set(Redpanda_LINKER_FLAGS "-fuse-ld=${Redpanda_LINKER}")
check_linker_flag(CXX ${Redpanda_LINKER_FLAGS} HAVE_Redpanda_LINKER_FLAGS)
if(NOT HAVE_Redpanda_LINKER_FLAGS)
message(FATAL_ERROR "Linker ${Redpanda_LINKER} not found or not supported")
endif()
add_link_options(${Redpanda_LINKER_FLAGS})
include(dependencies)
include(v_library)
include(testing)
add_subdirectory(src)