Files
RASCSI/cpp/meson.build
T
Daniel Markstedt 1ee4a320b8 replace compile-time board types with runtime profiles
Move GPIO mappings into a single module and select a board profile at process startup instead of at compile time: Build every GPIO-facing utility for every supported profile. At the same time, we remove support for the historical AIBOM board type since it's the only one using positive logic, the other three variants share the same electrical behavior.

Run piscsi, scsimon, scsiloop, scsidump, or sasidump with -C=STANDARD, FULLSPEC, or GAMERNIUM. FULLSPEC remains the default. To select a profile for the systemd service, set PISCSI_CONNECTION_TYPE and restart the service.
2026-08-31 21:55:50 +02:00

211 lines
5.9 KiB
Meson

controllers_src = [
'controllers/abstract_controller.cpp',
'controllers/controller_manager.cpp',
'controllers/phase_handler.cpp',
'controllers/sasi_controller.cpp',
'controllers/scsi_controller.cpp',
]
devices_src = [
'devices/cd_track.cpp',
'devices/ctapdriver.cpp',
'devices/device_factory.cpp',
'devices/device_logger.cpp',
'devices/device.cpp',
'devices/disk_cache.cpp',
'devices/disk_track.cpp',
'devices/disk.cpp',
'devices/host_services.cpp',
'devices/mode_page_device.cpp',
'devices/primary_device.cpp',
'devices/scsi_command_util.cpp',
'devices/sasi_hd.cpp',
'devices/scsi_daynaport.cpp',
'devices/scsi_printer.cpp',
'devices/scsi_streamer.cpp',
'devices/scsicd.cpp',
'devices/scsihd_nec.cpp',
'devices/scsihd.cpp',
'devices/scsimo.cpp',
'devices/storage_device.cpp',
]
hal_src = [
'hal/bus.cpp',
'hal/connection_profile.cpp',
'hal/data_sample.cpp',
'hal/gpiobus_factory.cpp',
'hal/gpiobus_raspberry.cpp',
'hal/gpiobus_virtual.cpp',
'hal/gpiobus.cpp',
'hal/sbc_version.cpp',
'hal/systimer_raspberry.cpp',
'hal/systimer.cpp',
]
piscsi_core_src = [
'piscsi/command_context.cpp',
'piscsi/localizer.cpp',
'piscsi/piscsi_core.cpp',
'piscsi/piscsi_executor.cpp',
'piscsi/piscsi_image.cpp',
'piscsi/piscsi_response.cpp',
'piscsi/piscsi_service.cpp',
] + controllers_src + devices_src + hal_src
piscsi_src = [
'piscsi/piscsi.cpp',
]
scsictl_core_src = [
'scsictl/scsictl_commands.cpp',
'scsictl/scsictl_core.cpp',
'scsictl/scsictl_display.cpp',
'scsictl/scsictl_parser.cpp',
]
scsictl_src = [
'scsictl/scsictl.cpp',
]
scsidump_core_src = [
'scsidump/scsidump_core.cpp',
]
scsidump_src = [
'scsidump/scsidump.cpp',
] + scsidump_core_src + hal_src
sasidump_core_src = [
'sasidump/sasidump_core.cpp',
]
sasidump_src = [
'sasidump/sasidump.cpp',
] + sasidump_core_src + hal_src
scsiloop_src = [
'scsiloop/scsiloop.cpp',
'scsiloop/scsiloop_core.cpp',
'scsiloop/scsiloop_cout.cpp',
'scsiloop/scsiloop_gpio.cpp',
'scsiloop/scsiloop_timer.cpp',
] + hal_src
scsimon_src = [
'scsimon/scsimon.cpp',
'scsimon/sm_core.cpp',
'scsimon/sm_html_report.cpp',
'scsimon/sm_json_report.cpp',
'scsimon/sm_vcd_report.cpp',
] + hal_src
shared_src = [
'shared/network_util.cpp',
'shared/piscsi_util.cpp',
'shared/piscsi_version.cpp',
]
protobuf_src = [
'shared/protobuf_util.cpp',
]
test_src = [
'test/abstract_controller_test.cpp',
'test/bus_test.cpp',
'test/command_context_test.cpp',
'test/connection_profile_test.cpp',
'test/controller_manager_test.cpp',
'test/ctapdriver_test.cpp',
'test/device_factory_test.cpp',
'test/device_test.cpp',
'test/disk_test.cpp',
'test/host_services_test.cpp',
'test/localizer_test.cpp',
'test/mode_page_device_test.cpp',
'test/network_util_test.cpp',
'test/phase_handler_test.cpp',
'test/piscsi_exceptions_test.cpp',
'test/piscsi_executor_test.cpp',
'test/piscsi_image_test.cpp',
'test/piscsi_response_test.cpp',
'test/piscsi_service_test.cpp',
'test/piscsi_util_test.cpp',
'test/primary_device_test.cpp',
'test/protobuf_util_test.cpp',
'test/scsi_command_util_test.cpp',
'test/sasi_hd_test.cpp',
'test/scsi_controller_test.cpp',
'test/scsi_daynaport_test.cpp',
'test/scsi_printer_test.cpp',
'test/scsicd_test.cpp',
'test/scsictl_commands_test.cpp',
'test/scsictl_display_test.cpp',
'test/scsictl_parser_test.cpp',
'test/scsidump_test.cpp',
'test/scsihd_nec_test.cpp',
'test/scsihd_test.cpp',
'test/scsimo_test.cpp',
'test/storage_device_test.cpp',
'test/test_setup.cpp',
'test/test_shared.cpp',
] + scsidump_core_src
test_platform_src = []
test_link_args = []
if host_machine.system() == 'linux'
test_platform_src += [
'test/gpiobus_raspberry_test.cpp',
'test/linux_os_stubs.cpp',
]
test_link_args += '-Wl,--wrap=fopen64'
endif
test_src += test_platform_src
subdir('generated')
if target.contains('piscsi')
piscsi_bin = executable('piscsi',
piscsi_core_src + piscsi_src + shared_src + protobuf_src + piscsi_interface_src[0],
dependencies : common_deps + [pcap_dep, protobuf_dep],
install : true,
)
endif
if target.contains('scsictl')
scsictl_bin = executable('scsictl',
scsictl_core_src + scsictl_src + shared_src + protobuf_src + piscsi_interface_src[0],
dependencies : common_deps + [protobuf_dep],
install : true,
)
endif
if target.contains('scsimon')
scsimon_bin = executable('scsimon',
scsimon_src + shared_src,
dependencies : common_deps + [protobuf_dep],
install : true,
)
endif
if target.contains('scsiloop') and host_machine.system() == 'linux'
scsiloop_bin = executable('scsiloop',
scsiloop_src + shared_src,
dependencies : common_deps,
install : true,
)
elif target.contains('scsiloop')
message('Skipping scsiloop: it requires Linux on Raspberry Pi GPIO hardware')
endif
if target.contains('scsidump')
scsidump_bin = executable('scsidump',
scsidump_src + shared_src,
dependencies : common_deps + [protobuf_dep],
install : true,
)
endif
if target.contains('sasidump')
sasidump_bin = executable('sasidump',
sasidump_src + shared_src,
dependencies : common_deps + [protobuf_dep],
install : true,
)
endif
if gtest_dep.found() and gmock_dep.found() and target.contains('test')
test_bin = executable('piscsi_test',
piscsi_core_src + scsictl_core_src + test_src + shared_src + protobuf_src + piscsi_interface_src[0],
dependencies : common_deps + [pcap_dep, protobuf_dep, gtest_dep, gmock_dep],
link_args : test_link_args,
install : false
)
test('unit', test_bin, protocol : 'gtest')
endif