blob: e1097d6d11e9559b7d566c03b4dc8fbf996be1f5 [file] [log] [blame]
Andrew Jeffery9c766792022-08-10 23:12:49 +09301project('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 Jefferya2ce1362023-02-13 15:26:29 +103010 version: '0.2.0',
Andrew Jeffery9c766792022-08-10 23:12:49 +093011 meson_version: '>=0.63.0',
12)
13
14add_project_arguments('-D_DEFAULT_SOURCE',language:['c'])
15
16libpldm_sources = files()
17subdir('src')
18
Andrew Jefferyc63f63a2023-02-24 22:29:33 +103019libpldm_include_dir = ['include', 'src']
Andrew Jeffery9c766792022-08-10 23:12:49 +093020libpldm_headers = files()
Rashmica Guptac1b66f42022-12-09 16:24:45 +110021libpldm_transport_headers = files()
Andrew Jeffery9c766792022-08-10 23:12:49 +093022
23subdir('include/libpldm')
24
25libpldm = library(
26 'pldm',
27 libpldm_sources,
28 implicit_include_directories: false,
29 include_directories: libpldm_include_dir,
30 version: meson.project_version(),
31 install: true
32 )
33
34install_headers(
35 libpldm_headers,
36 subdir:'libpldm'
37 )
38
Rashmica Guptac1b66f42022-12-09 16:24:45 +110039install_headers(
40 libpldm_transport_headers,
41 subdir:'libpldm/transport'
42 )
43
Andrew Jeffery9c766792022-08-10 23:12:49 +093044libpldm_dep = declare_dependency(
45 include_directories: libpldm_include_dir,
46 link_with: libpldm)
47
48import('pkgconfig').generate(
49 name: 'libpldm',
50 description: 'PLDM protocol encode/decode C lib',
51 version: meson.project_version(),
52 libraries: libpldm)
53
Rashmica Guptac1b66f42022-12-09 16:24:45 +110054compiler = meson.get_compiler('c')
55conf = configuration_data()
56if compiler.has_header('poll.h')
57 conf.set('PLDM_HAS_POLL', 1)
58endif
59configure_file(output: 'config.h',
60 configuration: conf
61)
62
Andrew Jeffery9c766792022-08-10 23:12:49 +093063if get_option('tests').enabled()
64 subdir('tests')
65endif