blob: 879210fb2af3863614a6a1a848eeeb14742791f6 [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',
'entity_common_config.proto',
'fan_controller_config.proto',
'fan_pwm_config.proto',
'fan_tach_config.proto',
'fru.proto',
'hft_sensor.proto',
'hft_service.proto',
'hwmon_temp_sensor_config.proto',
'i2c_common_config.proto',
'identifier.proto',
'payload.proto',
'psu_sensor_config.proto',
'reading_range_config.proto',
'resource.proto',
'sensor.proto',
'sensor_identifier.proto',
'sensor_payload.proto',
'shared_mem_sensor_config.proto',
'stable_id.proto',
'subscription_params.proto',
'threshold_config.proto',
'topology_config.proto',
'trace.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
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/sensor_collector.cc',
'configs/blocklist_parser.cc',
'configs/entity_config_json_impl.cc',
'configs/expression.cc',
'file/dir.cc',
'file/path.cc',
'hal/fru_scanner_i2c.cc',
'hal/shared_mem/client.cc',
'hal/shared_mem/metrics.cc',
'hal/shared_mem/segment_manager.cc',
'hal/shared_mem/server.cc',
'hal/sysfs/i2c.cc',
'io/ioctl.cc',
'io/smbus/kernel_dev.cc',
'io/smbus/smbus.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/all_chassis.cc',
'redfish/routes/all_routes.cc',
'redfish/routes/all_sensors.cc',
'redfish/routes/chassis.cc',
'redfish/routes/debug.cc',
'redfish/routes/high_frequency_sensors.cc',
'redfish/routes/sensor.cc',
'redfish/routes/service_root.cc',
'redfish/routes/tlbmc_metrics.cc',
'redfish/routes/tlbmc_root.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_temp_sensor.cc',
'sensors/i2c_hwmon_based_sensor.cc',
'sensors/psu_sensor.cc',
'sensors/sensor.cc',
'sensors/shared_mem_based_sensor.cc',
'service/hft_service.cc',
'store/factory.cc',
'store/store_impl.cc',
'thread/thread.cc',
'time/clock.cc',
'time/proto.cc',
'time/time.cc',
'trace/tracer.cc',
'utils/fru_reader.cc',
'utils/fru_utils.cc',
# go/keep-sorted end
tlbmc_proto_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
tlbmc_lib = static_library(
'tlbmc',
tlbmc_sources,
include_directories : incdir,
dependencies: bmcweb_dependencies,
cpp_args: ['-Wno-error'],
)
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)
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