1project( 2 'phosphor-state-manager', 3 'cpp', 4 default_options: [ 5 'warning_level=3', 6 'werror=true', 7 'cpp_std=c++17' 8 ], 9 license: 'Apache-2.0', 10 version: '0.1', 11) 12 13conf = configuration_data() 14conf.set_quoted( 15 'HOST_BUSNAME', get_option('host-busname')) 16conf.set_quoted( 17 'HOST_OBJPATH', get_option('host-objpath')) 18conf.set_quoted( 19 'CHASSIS_BUSNAME', get_option('chassis-busname')) 20conf.set_quoted( 21 'CHASSIS_OBJPATH', get_option('chassis-objpath')) 22conf.set_quoted( 23 'BMC_BUSNAME', get_option('bmc-busname')) 24conf.set_quoted( 25 'BMC_OBJPATH', get_option('bmc-objpath')) 26conf.set_quoted( 27 'HOST_RUNNING_FILE', get_option('host-running-file')) 28conf.set_quoted( 29 'HOST_STATE_PERSIST_PATH', get_option('host-state-persist-path')) 30conf.set_quoted( 31 'POH_COUNTER_PERSIST_PATH', get_option('poh-counter-persist-path')) 32conf.set_quoted( 33 'CHASSIS_STATE_CHANGE_PERSIST_PATH', get_option('chassis-state-change-persist-path')) 34conf.set( 35 'BOOT_COUNT_MAX_ALLOWED', get_option('boot-count-max-allowed')) 36conf.set( 37 'CLASS_VERSION', get_option('class-version')) 38 39configure_file(output: 'config.h', configuration: conf) 40 41sdbusplus = dependency('sdbusplus') 42sdeventplus = dependency('sdeventplus') 43phosphorlogging = dependency('phosphor-logging') 44phosphordbusinterfaces = dependency('phosphor-dbus-interfaces') 45 46cppfs = meson.get_compiler('cpp').find_library('stdc++fs') 47 48executable('phosphor-host-state-manager', 49 'host_state_manager.cpp', 50 'host_state_manager_main.cpp', 51 'settings.cpp', 52 dependencies: [ 53 sdbusplus, sdeventplus, phosphorlogging, 54 phosphordbusinterfaces, cppfs 55 ], 56 implicit_include_directories: true, 57 install: true 58) 59 60executable('phosphor-chassis-state-manager', 61 'chassis_state_manager.cpp', 62 'chassis_state_manager_main.cpp', 63 dependencies: [ 64 sdbusplus, sdeventplus, phosphorlogging, 65 phosphordbusinterfaces, cppfs 66 ], 67 implicit_include_directories: true, 68 install: true 69) 70 71executable('phosphor-bmc-state-manager', 72 'bmc_state_manager.cpp', 73 'bmc_state_manager_main.cpp', 74 dependencies: [ 75 sdbusplus, sdeventplus, phosphorlogging, 76 phosphordbusinterfaces, cppfs 77 ], 78 implicit_include_directories: true, 79 install: true 80) 81 82executable('phosphor-discover-system-state', 83 'discover_system_state.cpp', 84 'settings.cpp', 85 dependencies: [ 86 sdbusplus, phosphorlogging 87 ], 88 implicit_include_directories: true, 89 install: true 90) 91 92executable('phosphor-host-check', 93 'host_check_main.cpp', 94 dependencies: [ 95 sdbusplus, phosphorlogging 96 ], 97 implicit_include_directories: true, 98 install: true 99) 100 101executable('phosphor-systemd-target-monitor', 102 'systemd_target_monitor.cpp', 103 'systemd_target_parser.cpp', 104 'systemd_target_signal.cpp', 105 dependencies: [ 106 sdbusplus, sdeventplus, phosphorlogging 107 ], 108 implicit_include_directories: true, 109 install: true 110) 111 112install_data('obmcutil', 113 install_mode: 'rwxr-xr-x', 114 install_dir: get_option('bindir') 115) 116 117systemd = dependency('systemd') 118systemd_system_unit_dir = systemd.get_pkgconfig_variable( 119 'systemdsystemunitdir', 120 define_variable: ['prefix', get_option('prefix')]) 121subdir('service_files') 122subdir('target_files') 123 124datadir = join_paths( 125 get_option('sysconfdir'), 126 'phosphor-systemd-target-monitor' 127) 128subdir('data') 129 130build_tests = get_option('tests') 131 132# If test coverage of source files within the root directory are wanted, 133# need to define and build the tests from here 134if not build_tests.disabled() 135gtest = dependency('gtest', main: true, disabler: true, required: build_tests) 136 test( 137 'test_systemd_parser', 138 executable('test_systemd_parser', 139 './test/systemd_parser.cpp', 140 'systemd_target_parser.cpp', 141 dependencies: [ 142 gtest, 143 ], 144 implicit_include_directories: true, 145 include_directories: '../' 146 ) 147 ) 148 149 test( 150 'test_systemd_signal', 151 executable('test_systemd_signal', 152 './test/systemd_signal.cpp', 153 'systemd_target_signal.cpp', 154 dependencies: [ 155 gtest, sdbusplus, sdeventplus, phosphorlogging, 156 ], 157 implicit_include_directories: true, 158 include_directories: '../' 159 ) 160 ) 161endif 162