Andrew Jeffery | 9c76679 | 2022-08-10 23:12:49 +0930 | [diff] [blame] | 1 | project('libpldm', ['c','cpp'], |
| 2 | default_options: [ |
| 3 | 'buildtype=debugoptimized', |
| 4 | 'warning_level=3', |
| 5 | 'werror=true', |
| 6 | 'cpp_std=c++20', |
| 7 | 'c_std=c17', |
| 8 | 'tests=' + (meson.is_subproject() ? 'disabled' : 'enabled'), |
| 9 | ], |
Andrew Jeffery | a2ce136 | 2023-02-13 15:26:29 +1030 | [diff] [blame] | 10 | version: '0.2.0', |
Andrew Jeffery | 9c76679 | 2022-08-10 23:12:49 +0930 | [diff] [blame] | 11 | meson_version: '>=0.63.0', |
| 12 | ) |
| 13 | |
| 14 | add_project_arguments('-D_DEFAULT_SOURCE',language:['c']) |
| 15 | |
| 16 | libpldm_sources = files() |
| 17 | subdir('src') |
| 18 | |
Andrew Jeffery | c63f63a | 2023-02-24 22:29:33 +1030 | [diff] [blame] | 19 | libpldm_include_dir = ['include', 'src'] |
Andrew Jeffery | 9c76679 | 2022-08-10 23:12:49 +0930 | [diff] [blame] | 20 | libpldm_headers = files() |
| 21 | |
| 22 | subdir('include/libpldm') |
| 23 | |
| 24 | libpldm = library( |
| 25 | 'pldm', |
| 26 | libpldm_sources, |
| 27 | implicit_include_directories: false, |
| 28 | include_directories: libpldm_include_dir, |
| 29 | version: meson.project_version(), |
| 30 | install: true |
| 31 | ) |
| 32 | |
| 33 | install_headers( |
| 34 | libpldm_headers, |
| 35 | subdir:'libpldm' |
| 36 | ) |
| 37 | |
| 38 | libpldm_dep = declare_dependency( |
| 39 | include_directories: libpldm_include_dir, |
| 40 | link_with: libpldm) |
| 41 | |
| 42 | import('pkgconfig').generate( |
| 43 | name: 'libpldm', |
| 44 | description: 'PLDM protocol encode/decode C lib', |
| 45 | version: meson.project_version(), |
| 46 | libraries: libpldm) |
| 47 | |
| 48 | if get_option('tests').enabled() |
| 49 | subdir('tests') |
| 50 | endif |