This repository has been archived by the owner on Jun 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
63 lines (52 loc) · 1.67 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
cmake_minimum_required (VERSION 3.6 FATAL_ERROR)
project (security-manager CXX)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lstdc++fs \
-Werror \
-Wall \
-Wextra \
-Wshadow \
-Wnon-virtual-dtor \
-Wold-style-cast \
-Wunused \
-Woverloaded-virtual \
-Wpedantic \
-Wconversion \
-Wmisleading-indentation \
-Wduplicated-cond \
-Wduplicated-branches \
-Wlogical-op \
-Wnull-dereference \
-Wuseless-cast \
-Wdouble-promotion \
-Wformat=2 \
")
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
add_executable (security-manager src/security-manager.cpp)
target_include_directories (security-manager PRIVATE ${CMAKE_SOURCE_DIR})
target_link_libraries (${PROJECT_NAME} -lstdc++fs)
target_link_libraries (${PROJECT_NAME} gpiodcxx)
target_link_libraries (${PROJECT_NAME} systemd)
target_link_libraries (${PROJECT_NAME} sdbusplus)
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include)
install (
TARGETS security-manager
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/static
)
find_package (Boost 1.66 REQUIRED)
include_directories (${BOOST_SRC_DIR})
add_definitions (-DBOOST_ERROR_CODE_HEADER_ONLY)
add_definitions (-DBOOST_SYSTEM_NO_DEPRECATED)
add_definitions (-DBOOST_ALL_NO_LIB)
add_definitions (-DBOOST_NO_RTTI)
add_definitions (-DBOOST_NO_TYPEID)
add_definitions (-DBOOST_ASIO_DISABLE_THREADS)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-rtti")
set (
SERVICE_FILES
${PROJECT_SOURCE_DIR}/service_files/xyz.openbmc_project.SecurityManager.service
)
install (FILES ${SERVICE_FILES} DESTINATION /lib/systemd/system/)