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 2
/
Copy pathCMakeLists.txt
66 lines (51 loc) · 1.83 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
cmake_minimum_required (VERSION 3.5 FATAL_ERROR)
#Set project name here
project (mctp-emulator CXX)
set (BUILD_SHARED_LIBRARIES OFF)
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
set (
CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -lstdc++fs \
-Werror \
-Wall \
-Wextra \
-Wshadow \
-Wnon-virtual-dtor \
-Wold-style-cast \
-Wcast-align \
-Wunused \
-Woverloaded-virtual \
-Wpedantic \
-Wconversion \
-Wmisleading-indentation \
-Wduplicated-cond \
-Wduplicated-branches \
-Wlogical-op \
-Wnull-dereference \
-Wuseless-cast \
-Wdouble-promotion \
-Wformat=2 \
"
)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-strict-aliasing -Wno-cast-align")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-rtti -I ${STAGING_KERNEL_DIR}/include/uapi
-I ${STAGING_KERNEL_DIR}/include")
set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
#Add header and sources here
set (SRC_FILES ${PROJECT_SOURCE_DIR}/src/main.cpp ${PROJECT_SOURCE_DIR}/src/MCTPBinding.cpp
${PROJECT_SOURCE_DIR}/src/OemBinding.cpp)
set (HEADER_FILES ${PROJECT_SOURCE_DIR}/include/MCTPBinding.hpp
${PROJECT_SOURCE_DIR}/include/OemBinding.hpp)
include_directories (${PROJECT_SOURCE_DIR}/include)
set (
SERVICE_FILES
${PROJECT_SOURCE_DIR}/service_files/xyz.openbmc_project.mctp-emulator.service
)
file(GLOB_RECURSE CONFIG_FILES "${PROJECT_SOURCE_DIR}/configurations/*.json")
add_executable (${PROJECT_NAME} ${SRC_FILES} ${HEADER_FILES})
target_link_libraries (${PROJECT_NAME} i2c sdbusplus -lsystemd
-lmctp_intel -lpthread -lstdc++fs -lphosphor_dbus -lboost_coroutine)
install (TARGETS ${PROJECT_NAME} DESTINATION bin)
install (FILES ${SERVICE_FILES} DESTINATION /lib/systemd/system/)
install (FILES ${CONFIG_FILES} DESTINATION /usr/share/mctp-emulator/)