-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
55 lines (49 loc) · 1.55 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
cmake_minimum_required(VERSION 3.22)
project(userver-demo LANGUAGES CXX)
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS OFF)
message(STATUS "Using toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
include(cmake/conan.cmake)
conan_cmake_install(
PATH_OR_REFERENCE ${CMAKE_SOURCE_DIR}
INSTALL_FOLDER ${CMAKE_BINARY_DIR}
BUILD missing
ENV "CONAN_CMAKE_GENERATOR=${CMAKE_GENERATOR}"
CONF "tools.cmake.cmaketoolchain:generator=${CMAKE_GENERATOR}"
PROFILE "userver-demo/default"
PROFILE_BUILD "userver-demo/default"
PROFILE_HOST "userver-demo/default"
SETTINGS "build_type=${CMAKE_BUILD_TYPE}"
SETTINGS_BUILD "build_type=${CMAKE_BUILD_TYPE}"
SETTINGS_HOST "build_type=${CMAKE_BUILD_TYPE}"
)
include(${CMAKE_BINARY_DIR}/conan_toolchain.cmake)
find_package(userver 1.0.0 EXACT REQUIRED)
add_grpc_library(userver-demo-proto PROTOS samples/greeter.proto health/health.proto)
add_executable(${PROJECT_NAME}
src/components/samples/greeter_service_component.cpp
src/components/samples/greeter_service_component.h
src/components/health/health_service_component.cpp
src/components/health/health_service_component.h
src/main.cpp
)
target_link_libraries(${PROJECT_NAME}
PRIVATE
userver-demo-proto
)
target_compile_options(${PROJECT_NAME}
PRIVATE
-Werror
-Wall
-Wextra
-Wassign-enum
-Wcast-align
-Wcast-qual
-Wconversion
-Wextra-semi
-Wsign-compare
-Wsign-conversion
-pedantic
-pedantic-errors
)