-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
36 lines (28 loc) · 1.09 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
cmake_minimum_required(VERSION 3.17)
set(PROJECT_VERSION 1.0.0)
set(TARGET_NAME "mt")
project(${TARGET_NAME}
VERSION ${PROJECT_VERSION}
LANGUAGES CXX)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fPIC -fno-omit-frame-pointer -fsanitize=address -Wall -Werror -g")
set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fPIC -fno-omit-frame-pointer -fsanitize=address")
message(CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(CMAKE_EXPORT_COMPILE_COMMANDS)
# For clangd index GNU header files.
set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES})
endif()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
file(GLOB_RECURSE MT_INCLUDE include/*.h)
set(3RD_DIR "${CMAKE_CURRENT_SOURCE_DIR}/3rd")
include_directories(${CMAKE_SOURCE_DIR}/include)
add_library(${TARGET_NAME} SHARED
${MT_INCLUDE}
src/event_loop.cc
)
target_link_libraries(${TARGET_NAME} PUBLIC fmt::fmt)
add_subdirectory(test)
add_subdirectory(3rd)
add_subdirectory(rpc)