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 | ], |
| 10 | version: '0.1.0', |
| 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 | |
| 19 | libpldm_include_dir = ['include'] |
| 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 |