blob: 9b6388e023c1233c7dd1b02dd6ae92f1d360f500 [file] [log] [blame]
protoc = find_program('protoc')
grpc_cpp_plugin = find_program('grpc_cpp_plugin')
all_protos = [
# go/keep-sorted start
'ad_hoc_fru_config.proto',
'agent_config_service.proto',
'central_config.proto',
'client_subscription.proto',
'collection_entity.proto',
'data_sink_service.proto',
'entity_common_config.proto',
'fan_controller_config.proto',
'fan_pwm_config.proto',
'fan_tach_config.proto',
'feed_client.proto',
'feed_payload.proto',
'fru.proto',
'fru_component_model.proto',
'fru_service.proto',
'gpio_config.proto',
'hal_common_config.proto',
'hft_service.proto',
'hft_subscription.proto',
'hwmon_temp_sensor_config.proto',
'identifier.proto',
'intel_cpu_sensor_config.proto',
'nic_telemetry_config.proto',
'payload.proto',
'psu_sensor_config.proto',
'reading_range_config.proto',
'reading_transform_config.proto',
'resource.proto',
'sensor.proto',
'sensor_identifier.proto',
'sensor_payload.proto',
'service_messages.proto',
'shared_mem_sensor_config.proto',
'software_metrics.proto',
'software_metrics_config.proto',
'stable_id.proto',
'subscription_params.proto',
'threshold_config.proto',
'topology_config.proto',
'trace.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
data_sink_service_gen = custom_target(
'grpc_data_sink_service_[ch]',
output: ['@BASENAME@.grpc.pb.cc', '@BASENAME@.grpc.pb.h'],
input: ['data_sink_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')],
)
agent_config_service_gen = custom_target(
'grpc_agent_config_service_[ch]',
output: ['@BASENAME@.grpc.pb.cc', '@BASENAME@.grpc.pb.h'],
input: ['agent_config_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')],
)
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/fru_collector.cc',
'collector/gpio_collector.cc',
'collector/metric_collector.cc',
'collector/peci_scanner.cc',
'collector/sensor_collector.cc',
'configs/blocklist_parser.cc',
'configs/entity_config.cc',
'configs/entity_config_json_impl.cc',
'configs/expression.cc',
'configs/proto_config_parser.cc',
'expression/expression.cc',
'feed_client_grpc.cc',
'file/dir.cc',
'file/path.cc',
'grpc_tls_options.cc',
'hal/fake_fru_scanner_fram.cc',
'hal/fru_scanner_fram.cc',
'hal/fru_scanner_i2c.cc',
'hal/gpio/gpio.cc',
'hal/gpio/gpio_monitor.cc',
'hal/nic_veeprom/accessor_v1.cc',
'hal/nic_veeprom/accessor_v2.cc',
'hal/nic_veeprom/interface.cc',
'hal/peci/peci_access_impl.cc',
'hal/shared_mem/client.cc',
'hal/shared_mem/metrics.cc',
'hal/shared_mem/segment_manager.cc',
'hal/shared_mem/server.cc',
'hal/sysfs/hwmon.cc',
'hal/sysfs/i2c.cc',
'hal/sysfs/i3c.cc',
'hal/sysfs/peci.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/action_managers/trust_bundle_manager.cc',
'redfish/routes/all_chassis.cc',
'redfish/routes/all_routes.cc',
'redfish/routes/all_sensors.cc',
'redfish/routes/cable.cc',
'redfish/routes/certificate_service.cc',
'redfish/routes/chassis.cc',
'redfish/routes/debug.cc',
'redfish/routes/fan.cc',
'redfish/routes/metric.cc',
'redfish/routes/power_subsystem.cc',
'redfish/routes/sensor.cc',
'redfish/routes/service_root.cc',
'redfish/routes/task_service.cc',
'redfish/routes/thermal_subsystem.cc',
'redfish/routes/tlbmc_metrics.cc',
'redfish/routes/tlbmc_root.cc',
'redfish/routes/update_service.cc',
'redfish/routing.cc',
'redfish/url.cc',
'redfish/verb.cc',
'scheduler/scheduler.cc',
'sensors/fan_controller.cc',
'sensors/fan_pwm.cc',
'sensors/fan_tach.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/psu_sensor.cc',
'sensors/sensor.cc',
'sensors/shared_mem_based_sensor.cc',
'sensors/virtual_sensor.cc',
'service/fru_service.cc',
'service/hft_service.cc',
'store/factory.cc',
'store/store_hft_adapter.cc',
'store/store_impl.cc',
'subscription/manager_impl.cc',
'thread/thread.cc',
'time/clock.cc',
'time/proto.cc',
'time/time.cc',
'trace/tracer.cc',
'utils/fram_utils.cc',
'utils/fru_reader.cc',
'utils/fru_utils.cc',
# go/keep-sorted end
tlbmc_proto_gen,
fru_service_gen,
hft_service_gen,
data_sink_service_gen,
agent_config_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('libpeci')
bloom_ca_cert_path = get_option('bloom_ca_cert_path')
bloom_ca_cert_path_arg = '-DBLOOM_CA_CERT_PATH="' + bloom_ca_cert_path + '"'
tlbmc_lib = static_library(
'tlbmc',
tlbmc_sources,
include_directories : incdir,
dependencies: bmcweb_dependencies,
cpp_args: ['-Wno-error', bloom_ca_cert_path_arg],
)
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