Brad Bishop | 0aa1590 | 2019-05-08 21:30:01 -0400 | [diff] [blame] | 1 | project( |
| 2 | 'phosphor-objmgr', |
| 3 | 'c', 'cpp', |
| 4 | default_options: [ |
Brad Bishop | 370daaa | 2021-08-02 23:30:49 -0400 | [diff] [blame] | 5 | 'cpp_std=c++20', |
Brad Bishop | 0aa1590 | 2019-05-08 21:30:01 -0400 | [diff] [blame] | 6 | 'warning_level=3', |
| 7 | 'werror=true', |
| 8 | ], |
| 9 | license: 'Apache-2.0', |
Brad Bishop | 370daaa | 2021-08-02 23:30:49 -0400 | [diff] [blame] | 10 | meson_version: '>=0.57.0', |
Brad Bishop | 0aa1590 | 2019-05-08 21:30:01 -0400 | [diff] [blame] | 11 | version: '1.0', |
| 12 | ) |
| 13 | |
Patrick Williams | f814e5b | 2022-03-21 11:14:17 -0500 | [diff] [blame] | 14 | phosphor_logging = dependency('phosphor-logging') |
Brad Bishop | 5962db5 | 2022-05-16 21:04:05 -0400 | [diff] [blame^] | 15 | phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces') |
Patrick Williams | f814e5b | 2022-03-21 11:14:17 -0500 | [diff] [blame] | 16 | sdbusplus = dependency('sdbusplus') |
Brad Bishop | 0aa1590 | 2019-05-08 21:30:01 -0400 | [diff] [blame] | 17 | |
| 18 | if get_option('tests').enabled() |
| 19 | gtest = dependency('gtest', main: true, disabler: true, required: false) |
| 20 | gmock = dependency('gmock', disabler: true, required: false) |
| 21 | if not gtest.found() or not gmock.found() |
| 22 | gtest_proj = import('cmake').subproject('googletest', required: false) |
| 23 | if gtest_proj.found() |
| 24 | gtest = declare_dependency( |
| 25 | dependencies: [ |
| 26 | dependency('threads'), |
| 27 | gtest_proj.dependency('gtest'), |
| 28 | gtest_proj.dependency('gtest_main'), |
| 29 | ] |
| 30 | ) |
| 31 | gmock = gtest_proj.dependency('gmock') |
| 32 | else |
| 33 | assert( |
| 34 | not get_option('tests').enabled(), |
| 35 | 'Googletest is required if tests are enabled' |
| 36 | ) |
| 37 | endif |
| 38 | endif |
| 39 | subdir('src/test') |
| 40 | subdir('libmapper/test') |
| 41 | endif |
| 42 | |
Brad Bishop | 0aa1590 | 2019-05-08 21:30:01 -0400 | [diff] [blame] | 43 | install_headers('libmapper/mapper.h') |
| 44 | |
| 45 | libmapper = library( |
| 46 | 'mapper', |
| 47 | 'libmapper/mapper.c', |
| 48 | dependencies: [ dependency('libsystemd') ], |
| 49 | gnu_symbol_visibility: 'hidden', |
| 50 | version: meson.project_version(), |
| 51 | install: true) |
| 52 | |
| 53 | import('pkgconfig').generate( |
| 54 | name: 'libmapper', |
| 55 | description: 'OpenBMC service discovery utility library', |
| 56 | version: meson.project_version(), |
| 57 | libraries: libmapper) |
| 58 | |
| 59 | executable( |
| 60 | 'mapper', |
| 61 | 'libmapper/app.c', |
| 62 | link_with: libmapper, |
| 63 | dependencies: [ dependency('libsystemd') ], |
| 64 | install: true) |
| 65 | |
| 66 | executable( |
| 67 | 'mapperx', |
| 68 | [ |
| 69 | 'src/main.cpp', |
| 70 | 'src/argument.cpp', |
| 71 | 'src/processing.cpp', |
| 72 | 'src/associations.cpp', |
| 73 | ], |
| 74 | dependencies: [ |
| 75 | dependency('boost'), |
| 76 | dependency('libsystemd'), |
Brad Bishop | 5962db5 | 2022-05-16 21:04:05 -0400 | [diff] [blame^] | 77 | phosphor_dbus_interfaces, |
Brad Bishop | 0aa1590 | 2019-05-08 21:30:01 -0400 | [diff] [blame] | 78 | phosphor_logging, |
| 79 | sdbusplus, |
| 80 | dependency('systemd'), |
| 81 | dependency('threads'), |
| 82 | dependency('tinyxml2'), |
| 83 | ], |
| 84 | install: true |
| 85 | ) |
| 86 | |
| 87 | executable( |
| 88 | 'phosphor-unit-failure-monitor', |
| 89 | [ |
| 90 | 'fail-monitor/argument.cpp', |
| 91 | 'fail-monitor/main.cpp', |
| 92 | 'fail-monitor/monitor.cpp', |
| 93 | ], |
| 94 | dependencies: [ |
| 95 | phosphor_logging, |
| 96 | ], |
| 97 | install: true |
| 98 | ) |