blob: cbbb23b239319329591ce882760dc76997888d04 [file] [log] [blame]
Jason M. Bills5e049d32018-10-19 12:59:38 -07001cmake_minimum_required (VERSION 3.6)
2project (sel-logger CXX)
3set (CMAKE_CXX_STANDARD 17)
4set (CMAKE_CXX_STANDARD_REQUIRED ON)
5
6add_executable (sel-logger src/sel_logger.cpp)
7
8option (
9 SEL_LOGGER_MONITOR_THRESHOLD_EVENTS
10 "Enable SEL Logger to monitor and automatically
11 log SEL records for threshold sensor events"
12 OFF
13)
Nikhil Potadeafbaa092019-03-06 16:18:13 -080014
15option (
16 REDFISH_LOG_MONITOR_PULSE_EVENTS
17 "Enable logger to monitor and automatically
18 log events to Redfish for pulse type assert-deassert sensor events"
19 OFF
20)
21
Jason M. Bills5e049d32018-10-19 12:59:38 -070022target_compile_definitions (
23 sel-logger PRIVATE
24 $<$<BOOL:${SEL_LOGGER_MONITOR_THRESHOLD_EVENTS}>: -DSEL_LOGGER_MONITOR_THRESHOLD_EVENTS>
Nikhil Potadeafbaa092019-03-06 16:18:13 -080025 $<$<BOOL:${REDFISH_LOG_MONITOR_PULSE_EVENTS}>: -DREDFISH_LOG_MONITOR_PULSE_EVENTS>
Jason M. Bills5e049d32018-10-19 12:59:38 -070026)
27
28target_include_directories (sel-logger PRIVATE ${CMAKE_SOURCE_DIR})
29
Jason M. Billsc4a336f2019-04-23 10:43:10 -070030target_link_libraries (sel-logger systemd sdbusplus pthread phosphor_logging -lstdc++fs)
Jason M. Bills5e049d32018-10-19 12:59:38 -070031
32include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include)
33
34install (TARGETS sel-logger
35 RUNTIME DESTINATION bin
36 LIBRARY DESTINATION lib
37 ARCHIVE DESTINATION lib/static)
38
39find_package (Boost 1.66 REQUIRED)
40include_directories (${BOOST_SRC_DIR})
41
42add_definitions (-DBOOST_ERROR_CODE_HEADER_ONLY)
43add_definitions (-DBOOST_SYSTEM_NO_DEPRECATED)
44add_definitions (-DBOOST_ALL_NO_LIB)
45add_definitions (-DBOOST_NO_RTTI)
46add_definitions (-DBOOST_NO_TYPEID)
47
Andrew Geisslerdf7bc1c2020-10-05 14:28:05 -050048# Temporarily disable rtti
49# See https://github.com/chriskohlhoff/asio/issues/533
50#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
51#set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-rtti")
Jason M. Bills5e049d32018-10-19 12:59:38 -070052
53set (
54 SERVICE_FILES
55 ${PROJECT_SOURCE_DIR}/service_files/xyz.openbmc_project.Logging.IPMI.service
56)
57install (FILES ${SERVICE_FILES} DESTINATION /lib/systemd/system/)