blob: deaa482d3bf342c429ec92429db226cc9c9e6199 [file] [edit]
protoc = find_program('protoc')
grpc_cpp_plugin = find_program('grpc_cpp_plugin')
all_protos = [
# go/keep-sorted start
'ad_hoc_fru_config.proto',
'adc_sensor_config.proto',
'bulk_device_config.proto',
'bus_topology.proto',
'central_config.proto',
'edge_filtering.proto',
'entity_common_config.proto',
'fan_controller_config.proto',
'fan_pwm_config.proto',
'fan_tach_config.proto',
'fru.proto',
'fru_component_model.proto',
'fru_i2c.proto',
'fru_identifier.proto',
'fru_payload.proto',
'fru_service.proto',
'gpio_config.proto',
'gpio_fru_config.proto',
'gpio_sensor_config.proto',
'hal_common_config.proto',
'hft_capabilities.proto',
'hft_service.proto',
'hwmon_temp_sensor_config.proto',
'identifier.proto',
'intel_cpu_sensor_config.proto',
'led_config.proto',
'memory.proto',
'nic_telemetry_config.proto',
'offline_data.proto',
'payload.proto',
'pcie_config.proto',
'power_control.proto',
'power_fault_detector_config.proto',
'power_fault_log_config.proto',
'power_fault_log_entry.proto',
'processor.proto',
'psu_sensor_config.proto',
'reading_range_config.proto',
'reading_transform_config.proto',
'redfish_aggregated_batch_config.proto',
'redfish_aggregated_sensor_config.proto',
'resource.proto',
'sel_config.proto',
'sensor.proto',
'sensor_identifier.proto',
'sensor_instance_properties.proto',
'sensor_payload.proto',
'shared_mem_sensor_config.proto',
'software_metrics.proto',
'software_metrics_config.proto',
'stable_id.proto',
'status.proto',
'subscription_params.proto',
'telemetry_aggregation.proto',
'thermal_config.proto',
'thermal_controller_specification.proto',
'threshold_config.proto',
'topology_config.proto',
'trace.proto',
'true_hitless_metrics.proto',
'usb_fru_config.proto',
'veeprom.proto',
'virtual_sensor_config.proto',
# go/keep-sorted end
]
proto_gen = {}
proto_headers = {}
foreach proto : all_protos
tmp_target = custom_target(
proto,
output: ['@BASENAME@.pb.cc', '@BASENAME@.pb.h'],
input: [proto],
command : [
protoc,
'@INPUT@',
'--proto_path=@CURRENT_SOURCE_DIR@',
'--cpp_out=@OUTDIR@',
'--experimental_editions',
],
install : true,
install_dir : [false, get_option('includedir')],
)
proto_gen += {proto: tmp_target}
proto_headers += {proto: tmp_target[1]}
endforeach
tlbmc_proto_gen = []
foreach proto : all_protos
tlbmc_proto_gen += proto_gen[proto]
endforeach
fru_service_gen = custom_target(
'grpc_fru_service_[ch]',
output: ['@BASENAME@.grpc.pb.cc', '@BASENAME@.grpc.pb.h'],
input: ['fru_service.proto'],
command : [
protoc,
'@INPUT@',
'--proto_path=@CURRENT_SOURCE_DIR@',
'--grpc_out=@OUTDIR@',
'--plugin=protoc-gen-grpc=' + grpc_cpp_plugin.full_path(),
'--experimental_editions',
],
install : true,
install_dir : [false, get_option('includedir')],
)
hft_service_gen = custom_target(
'grpc_hft_service_[ch]',
output: ['@BASENAME@.grpc.pb.cc', '@BASENAME@.grpc.pb.h'],
input: ['hft_service.proto'],
command : [
protoc,
'@INPUT@',
'--proto_path=@CURRENT_SOURCE_DIR@',
'--grpc_out=@OUTDIR@',
'--plugin=protoc-gen-grpc=' + grpc_cpp_plugin.full_path(),
'--experimental_editions',
],
install : true,
install_dir : [false, get_option('includedir')],
)
tlbmc_sources = [
# go/keep-sorted start
'apifs/apifs.cc',
'central_config/config.cc',
'collector/bulk_sensor_collector_base.cc',
'collector/default_bulk_sensor_collector.cc',
'collector/fake_fru_collector.cc',
'collector/fake_gpio_collector.cc',
'collector/fru_collector.cc',
'collector/gpio_collector.cc',
'collector/led_collector.cc',
'collector/metric_collector.cc',
'collector/pcie_collector.cc',
'collector/peci_scanner.cc',
'collector/power_control_collector.cc',
'collector/power_fault_log_collector.cc',
'collector/resource_state_manager.cc',
'collector/sel_collector.cc',
'collector/sensor_collector.cc',
'collector/sensor_collector_aggregator.cc',
'collector/thermal_collector.cc',
'configs/blocklist_parser.cc',
'configs/entity_config.cc',
'configs/entity_config_json_impl.cc',
'configs/expression.cc',
'configs/proto_config_parser.cc',
'configs/rate_limiter_config.cc',
'credentials/credential_manager_impl.cc',
'deterministic_bmc/i2c_walker/i2c_walker_interface.h',
'deterministic_bmc/i2c_walker/uhmm_i2c_walker.cc',
'deterministic_bmc/offline_config_parser/offline_config_parser.cc',
'deterministic_bmc/offline_config_parser/proto_reader.h',
'expression/expression.cc',
'file/dir.cc',
'file/path.cc',
'grpc_tls_options.cc',
'hal/fake_fru_scanner_fram.cc',
'hal/fru_scanner_adc.cc',
'hal/fru_scanner_cable.cc',
'hal/fru_scanner_fram.cc',
'hal/fru_scanner_gpio.cc',
'hal/fru_scanner_i2c.cc',
'hal/fru_scanner_usb.cc',
'hal/gpio/gpio.cc',
'hal/gpio/gpio_monitor.cc',
'hal/gpio/on_demand_gpio.cc',
'hal/led/led.cc',
'hal/led/led_sysfs.cc',
'hal/nic_veeprom/interface.cc',
'hal/peci/peci_access_impl.cc',
'hal/power_fault_detector/power_fault_detector.cc',
'hal/shared_mem/metrics.cc',
'hal/shared_mem/static_client_impl.cc',
'hal/shared_mem/static_client_segment.cc',
'hal/shared_mem/static_server_impl.cc',
'hal/sysfs/hwmon.cc',
'hal/sysfs/i2c.cc',
'hal/sysfs/i3c.cc',
'hal/sysfs/iio.cc',
'hal/sysfs/led.cc',
'hal/sysfs/peci.cc',
'hal/system_registry_impl.cc',
'hft/core/edge_filter.cc',
'hft/core/hft_service.cc',
'hft/core/manager_impl.cc',
'hft/manager_debug_json.cc',
'host_state/host_state_collector.cc',
'host_state/power_control.cc',
'http/http_client.cc',
'io/ioctl.cc',
'io/smbus/kernel_dev.cc',
'io/smbus/smbus.cc',
'metrics/bmc_static_metrics.cc',
'metrics/software_metrics.cc',
'redfish/app.cc',
'redfish/data/stable_id.cc',
'redfish/expand_query_aggregator.cc',
'redfish/query.cc',
'redfish/query_parameters.cc',
'redfish/request.cc',
'redfish/response.cc',
'redfish/routes/action_managers/file_manager.cc',
'redfish/routes/all_chassis.cc',
'redfish/routes/all_routes.cc',
'redfish/routes/all_sensors.cc',
'redfish/routes/assembly.cc',
'redfish/routes/cable.cc',
'redfish/routes/certificate_service.cc',
'redfish/routes/chassis.cc',
'redfish/routes/debug.cc',
'redfish/routes/fan.cc',
'redfish/routes/manager_certificates.cc',
'redfish/routes/managers.cc',
'redfish/routes/metric.cc',
'redfish/routes/pcie.cc',
'redfish/routes/power_fault_log.cc',
'redfish/routes/power_subsystem.cc',
'redfish/routes/power_supply.cc',
'redfish/routes/power_supply_metrics.cc',
'redfish/routes/rate_limiter.cc',
'redfish/routes/redfish_authorization.cc',
'redfish/routes/sensor.cc',
'redfish/routes/service_root.cc',
'redfish/routes/system.cc',
'redfish/routes/system_event_log.cc',
'redfish/routes/task_service.cc',
'redfish/routes/thermal_subsystem.cc',
'redfish/routes/tlbmc_metrics.cc',
'redfish/routes/tlbmc_root.cc',
'redfish/routes/tpuwizard/tpuwizard.cc',
'redfish/routes/update_service.cc',
'redfish/routing.cc',
'redfish/url.cc',
'redfish/verb.cc',
'resource/reset_type.cc',
'resource/syslog_config_utils.cc',
'scheduler/scheduler.cc',
'sensors/adc_sensor.cc',
'sensors/amd_cpu_sensor.cc',
'sensors/fan_controller.cc',
'sensors/fan_pwm.cc',
'sensors/fan_tach.cc',
'sensors/gpio_sensor.cc',
'sensors/hwmon_based_sensor.cc',
'sensors/hwmon_input_device.cc',
'sensors/hwmon_temp_sensor.cc',
'sensors/intel_cpu_sensor.cc',
'sensors/ixc_hwmon_based_sensor.cc',
'sensors/nic_sensor.cc',
'sensors/peci_hwmon_based_sensor.cc',
'sensors/polling_base_sensor.cc',
'sensors/psu_sensor.cc',
'sensors/redfish_aggregated_batch.cc',
'sensors/redfish_aggregated_sensor.cc',
'sensors/sensor.cc',
'sensors/shared_mem_based_sensor.cc',
'sensors/sync_polling_sensor.cc',
'sensors/virtual_sensor.cc',
'service/fru_service.cc',
'store/factory.cc',
'store/octeon10_evk_store.cc',
'store/store_hft_adapter.cc',
'store/store_impl.cc',
'thermal/controller/algorithm/dff.cc',
'thermal/controller/algorithm/eat.cc',
'thermal/controller/algorithm/first_order_adrc.cc',
'thermal/controller/algorithm/pid.cc',
'thermal/controller/algorithm/second_order_adrc.cc',
'thermal/controller/algorithm/stepwise.cc',
'thermal/controller/algorithm/utils/nonlinear_tracking_differentiator.cc',
'thermal/controller/dff_controller.cc',
'thermal/controller/eat_controller.cc',
'thermal/controller/fan_pid_controller.cc',
'thermal/controller/first_order_adrc_controller.cc',
'thermal/controller/optimizer/optimizer_logger.h',
'thermal/controller/optimizer/pid/ziegler_nichols/differentiated_ziegler_nichols.cc',
'thermal/controller/optimizer/pid/ziegler_nichols/ziegler_nichols.cc',
'thermal/controller/pid_controller.cc',
'thermal/controller/second_order_adrc_controller.cc',
'thermal/controller/stepwise_controller.cc',
'thermal/controller_info/controller_info.cc',
'thermal/failsafe_logger.cc',
'thermal/fan_info/fan_info.cc',
'thermal/sensor_info/sensor_info.cc',
'thermal/zone_manager.cc',
'thread/thread.cc',
'time/clock.cc',
'time/proto.cc',
'time/time.cc',
'trace/tracer.cc',
'true_hitless/true_hitless_metrics_parser.cc',
'utils/fram_utils.cc',
'utils/fru_reader.cc',
'utils/fru_utils.cc',
'utils/inotify_watcher.cc',
# go/keep-sorted end
tlbmc_proto_gen,
fru_service_gen,
hft_service_gen,
]
bmcweb_dependencies += dependency('protobuf', required : true)
re2 = dependency('re2', required: false)
if not re2.found()
# find the lib without pkg-config
re2 = cxx.find_library('re2')
endif
bmcweb_dependencies += re2
bmcweb_dependencies += dependency('openssl', required : true, version : '>=3.0.1')
bmcweb_dependencies += dependency('libpeci')
bmcweb_dependencies += dependency('gbmchal')
bmcweb_dependencies += dependency('gbmc_settings')
bmcweb_dependencies += dependency('gbmc-sel-framework')
bmcweb_dependencies += dependency('owner_certificate')
bmcweb_dependencies += dependency('libusb-1.0')
bmcweb_dependencies += dependency('grpc_redfish')
bloom_ca_cert_path = get_option('bloom_ca_cert_path')
bloom_ca_cert_path_arg = '-DBLOOM_CA_CERT_PATH="' + bloom_ca_cert_path + '"'
tlbmc_fru_scan_extra_addrs = get_option('tlbmc-fru-scan-extra-addrs')
tlbmc_fru_scan_args = []
if tlbmc_fru_scan_extra_addrs.length() > 0
tlbmc_fru_scan_args += '-DTLBMC_FRU_SCAN_EXTRA_ADDRS=' + ','.join(tlbmc_fru_scan_extra_addrs)
endif
tlbmc_lib = static_library(
'tlbmc',
tlbmc_sources,
include_directories : incdir,
dependencies: bmcweb_dependencies,
cpp_args: ['-Wno-error', bloom_ca_cert_path_arg, tlbmc_fru_scan_args],
)
tlbmc_lib_dep = declare_dependency(
link_with: [tlbmc_lib],
include_directories: [incdir],
dependencies: bmcweb_dependencies,
)
bmcweb_dependencies += tlbmc_lib_dep
libs_link_with += tlbmc_lib
bmcweb_dependencies += dependency('liburing', required : true)
gpiod = dependency('gpiod', required: false)
if not gpiod.found()
gpiod = cxx.find_library('gpiod', required: true)
endif
bmcweb_dependencies += gpiod
if get_option('tlbmc-pacemaker').enabled()
systemd_dep = dependency('systemd')
systemd_system_unitdir = systemd_dep.get_variable(
pkgconfig: 'systemdsystemunitdir'
)
install_data(
'pacemaker/pacemaker.service',
install_dir: systemd_system_unitdir,
)
endif