Ed Tanous | 2b314e4 | 2025-08-19 15:46:18 -0700 | [diff] [blame] | 1 | project( |
| 2 | 'platform-init', |
| 3 | 'cpp', |
| 4 | meson_version: '>=1.7.0', |
| 5 | version: '0.1', |
| 6 | default_options: ['warning_level=3', 'cpp_std=c++23'], |
| 7 | ) |
| 8 | |
| 9 | gpiodcxx_dep = dependency('libgpiodcxx', default_options: ['bindings=cxx']) |
| 10 | systemd_dep = dependency('systemd') |
| 11 | libsystemd_dep = dependency('libsystemd') |
Marc Olberding | c9c8612 | 2025-09-08 17:45:21 -0700 | [diff] [blame^] | 12 | sdbusplus = dependency('sdbusplus', include_type: 'system') |
| 13 | |
Ed Tanous | 2b314e4 | 2025-08-19 15:46:18 -0700 | [diff] [blame] | 14 | |
| 15 | cli11_dep = dependency('CLI11', required: true, include_type: 'system') |
Marc Olberding | 5d50e52 | 2025-09-03 18:23:32 -0700 | [diff] [blame] | 16 | i2c_dep = meson.get_compiler('cpp').find_library('i2c') |
Ed Tanous | 2b314e4 | 2025-08-19 15:46:18 -0700 | [diff] [blame] | 17 | |
Marc Olberding | 5d50e52 | 2025-09-03 18:23:32 -0700 | [diff] [blame] | 18 | platform_srcs = files('nvidia/gb200.cpp', 'nvidia/nvl32.cpp') |
Marc Olberding | 801bc90 | 2025-08-27 12:55:42 -0700 | [diff] [blame] | 19 | util_srcs = files('gpio.cpp', 'i2c.cpp', 'utilities.cpp') |
| 20 | |
Ed Tanous | 2b314e4 | 2025-08-19 15:46:18 -0700 | [diff] [blame] | 21 | exe = executable( |
| 22 | 'platform', |
Marc Olberding | 801bc90 | 2025-08-27 12:55:42 -0700 | [diff] [blame] | 23 | ['platform.cpp'] + platform_srcs + util_srcs, |
Marc Olberding | c9c8612 | 2025-09-08 17:45:21 -0700 | [diff] [blame^] | 24 | dependencies: [gpiodcxx_dep, libsystemd_dep, cli11_dep, i2c_dep, sdbusplus], |
Marc Olberding | 801bc90 | 2025-08-27 12:55:42 -0700 | [diff] [blame] | 25 | include_directories: ['.', 'nvidia'], |
Ed Tanous | 2b314e4 | 2025-08-19 15:46:18 -0700 | [diff] [blame] | 26 | install: true, |
| 27 | install_dir: get_option('libexecdir'), |
| 28 | ) |
| 29 | |
| 30 | systemd_system_unit_dir = systemd_dep.get_variable('systemd_system_unit_dir') |
| 31 | configure_file( |
| 32 | input: 'platform_init.service.in', |
| 33 | output: 'platform_init.service', |
| 34 | install_dir: systemd_system_unit_dir, |
| 35 | install: true, |
| 36 | configuration: configuration_data( |
| 37 | {'PLATFORM_NAME': get_option('platform-name')}, |
| 38 | ), |
| 39 | ) |