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 | |
| 14 | phosphor_logging = dependency( |
| 15 | 'phosphor-logging', |
| 16 | fallback: [ |
| 17 | 'phosphor-logging', |
| 18 | 'phosphor_logging_dep']) |
| 19 | sdbusplus = dependency( |
| 20 | 'sdbusplus', |
| 21 | fallback: ['sdbusplus', 'sdbusplus_dep']) |
| 22 | |
| 23 | if get_option('tests').enabled() |
| 24 | gtest = dependency('gtest', main: true, disabler: true, required: false) |
| 25 | gmock = dependency('gmock', disabler: true, required: false) |
| 26 | if not gtest.found() or not gmock.found() |
| 27 | gtest_proj = import('cmake').subproject('googletest', required: false) |
| 28 | if gtest_proj.found() |
| 29 | gtest = declare_dependency( |
| 30 | dependencies: [ |
| 31 | dependency('threads'), |
| 32 | gtest_proj.dependency('gtest'), |
| 33 | gtest_proj.dependency('gtest_main'), |
| 34 | ] |
| 35 | ) |
| 36 | gmock = gtest_proj.dependency('gmock') |
| 37 | else |
| 38 | assert( |
| 39 | not get_option('tests').enabled(), |
| 40 | 'Googletest is required if tests are enabled' |
| 41 | ) |
| 42 | endif |
| 43 | endif |
| 44 | subdir('src/test') |
| 45 | subdir('libmapper/test') |
| 46 | endif |
| 47 | |
Brad Bishop | 0aa1590 | 2019-05-08 21:30:01 -0400 | [diff] [blame] | 48 | install_headers('libmapper/mapper.h') |
| 49 | |
| 50 | libmapper = library( |
| 51 | 'mapper', |
| 52 | 'libmapper/mapper.c', |
| 53 | dependencies: [ dependency('libsystemd') ], |
| 54 | gnu_symbol_visibility: 'hidden', |
| 55 | version: meson.project_version(), |
| 56 | install: true) |
| 57 | |
| 58 | import('pkgconfig').generate( |
| 59 | name: 'libmapper', |
| 60 | description: 'OpenBMC service discovery utility library', |
| 61 | version: meson.project_version(), |
| 62 | libraries: libmapper) |
| 63 | |
| 64 | executable( |
| 65 | 'mapper', |
| 66 | 'libmapper/app.c', |
| 67 | link_with: libmapper, |
| 68 | dependencies: [ dependency('libsystemd') ], |
| 69 | install: true) |
| 70 | |
| 71 | executable( |
| 72 | 'mapperx', |
| 73 | [ |
| 74 | 'src/main.cpp', |
| 75 | 'src/argument.cpp', |
| 76 | 'src/processing.cpp', |
| 77 | 'src/associations.cpp', |
| 78 | ], |
| 79 | dependencies: [ |
| 80 | dependency('boost'), |
| 81 | dependency('libsystemd'), |
| 82 | phosphor_logging, |
| 83 | sdbusplus, |
| 84 | dependency('systemd'), |
| 85 | dependency('threads'), |
| 86 | dependency('tinyxml2'), |
| 87 | ], |
| 88 | install: true |
| 89 | ) |
| 90 | |
| 91 | executable( |
| 92 | 'phosphor-unit-failure-monitor', |
| 93 | [ |
| 94 | 'fail-monitor/argument.cpp', |
| 95 | 'fail-monitor/main.cpp', |
| 96 | 'fail-monitor/monitor.cpp', |
| 97 | ], |
| 98 | dependencies: [ |
| 99 | phosphor_logging, |
| 100 | ], |
| 101 | install: true |
| 102 | ) |