Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 1 | cmake_minimum_required (VERSION 3.6) |
| 2 | project (sel-logger CXX) |
| 3 | set (CMAKE_CXX_STANDARD 17) |
| 4 | set (CMAKE_CXX_STANDARD_REQUIRED ON) |
| 5 | |
| 6 | add_executable (sel-logger src/sel_logger.cpp) |
| 7 | |
| 8 | option ( |
| 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 Potade | afbaa09 | 2019-03-06 16:18:13 -0800 | [diff] [blame] | 14 | |
| 15 | option ( |
| 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. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 22 | target_compile_definitions ( |
| 23 | sel-logger PRIVATE |
| 24 | $<$<BOOL:${SEL_LOGGER_MONITOR_THRESHOLD_EVENTS}>: -DSEL_LOGGER_MONITOR_THRESHOLD_EVENTS> |
Nikhil Potade | afbaa09 | 2019-03-06 16:18:13 -0800 | [diff] [blame] | 25 | $<$<BOOL:${REDFISH_LOG_MONITOR_PULSE_EVENTS}>: -DREDFISH_LOG_MONITOR_PULSE_EVENTS> |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 26 | ) |
| 27 | |
| 28 | target_include_directories (sel-logger PRIVATE ${CMAKE_SOURCE_DIR}) |
| 29 | |
Jason M. Bills | c4a336f | 2019-04-23 10:43:10 -0700 | [diff] [blame] | 30 | target_link_libraries (sel-logger systemd sdbusplus pthread phosphor_logging -lstdc++fs) |
Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 31 | |
| 32 | include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include) |
| 33 | |
| 34 | install (TARGETS sel-logger |
| 35 | RUNTIME DESTINATION bin |
| 36 | LIBRARY DESTINATION lib |
| 37 | ARCHIVE DESTINATION lib/static) |
| 38 | |
| 39 | find_package (Boost 1.66 REQUIRED) |
| 40 | include_directories (${BOOST_SRC_DIR}) |
| 41 | |
| 42 | add_definitions (-DBOOST_ERROR_CODE_HEADER_ONLY) |
| 43 | add_definitions (-DBOOST_SYSTEM_NO_DEPRECATED) |
| 44 | add_definitions (-DBOOST_ALL_NO_LIB) |
| 45 | add_definitions (-DBOOST_NO_RTTI) |
| 46 | add_definitions (-DBOOST_NO_TYPEID) |
| 47 | |
| 48 | set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") |
| 49 | set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-rtti") |
| 50 | |
| 51 | set ( |
| 52 | SERVICE_FILES |
| 53 | ${PROJECT_SOURCE_DIR}/service_files/xyz.openbmc_project.Logging.IPMI.service |
| 54 | ) |
| 55 | install (FILES ${SERVICE_FILES} DESTINATION /lib/systemd/system/) |