George Liu | b198609 | 2022-06-21 08:35:47 +0800 | [diff] [blame] | 1 | project( |
| 2 | 'phosphor-power-control', 'cpp', |
| 3 | version: '1.0.0', |
| 4 | meson_version: '>=0.58.0', |
| 5 | default_options: [ |
| 6 | 'warning_level=3', |
| 7 | 'werror=true', |
| 8 | 'cpp_std=c++20', |
| 9 | ] |
| 10 | ) |
| 11 | |
| 12 | phosphor_logging_dep = dependency('phosphor-logging') |
| 13 | gpioplus_dep = dependency('gpioplus') |
| 14 | |
| 15 | cpp = meson.get_compiler('cpp') |
| 16 | if cpp.has_header_symbol( |
| 17 | 'nlohmann/json.hpp', |
| 18 | 'nlohmann::json::string_t', |
| 19 | required:false) |
| 20 | nlohmann_json_dep = declare_dependency() |
| 21 | else |
| 22 | nlohmann_json_dep = dependency('nlohmann-json') |
| 23 | endif |
| 24 | |
| 25 | deps = [ |
| 26 | phosphor_logging_dep, |
| 27 | nlohmann_json_dep, |
| 28 | gpioplus_dep, |
| 29 | ] |
| 30 | |
| 31 | sources = [ |
| 32 | 'chassiskill.cpp', |
| 33 | ] |
| 34 | |
| 35 | executable( |
| 36 | 'chassiskill', |
| 37 | sources, |
| 38 | implicit_include_directories: false, |
| 39 | dependencies: deps, |
| 40 | install: true, |
| 41 | install_dir: get_option('libexecdir')) |