blob: 061c7e18755d373686bcd1634e36721eaca528b5 [file] [log] [blame]
Zane Shelleyba5dc162020-11-09 21:47:55 -06001# OpenBMC openpower-libhei project, see README.md for details.
Patrick Williamsfffd9832025-02-01 08:38:36 -05002project(
3 'openpower-libhei',
4 'cpp',
5 version: '0.1',
6 meson_version: '>=0.51.0',
7 default_options: ['warning_level=3', 'werror=true', 'cpp_std=c++14'],
8)
Ben Tyner941aaeb2019-04-26 17:38:10 -05009
Zane Shelleyba5dc162020-11-09 21:47:55 -060010#-------------------------------------------------------------------------------
Ben Tyner552992a2021-04-15 10:57:17 -050011# Versioning
12#-------------------------------------------------------------------------------
Patrick Williamsfffd9832025-02-01 08:38:36 -050013buildinfo = vcs_tag(
14 command: ['git', 'describe', '--always', '--long'],
15 input: 'buildinfo.hpp.in',
16 output: 'buildinfo.hpp',
17 replace_string: '@BUILDINFO@',
18 fallback: '0',
19)
Ben Tyner552992a2021-04-15 10:57:17 -050020
21#-------------------------------------------------------------------------------
Zane Shelleyba5dc162020-11-09 21:47:55 -060022# libhei library
23#-------------------------------------------------------------------------------
24
Ben Tyner032bf9e2020-05-06 21:27:54 -050025incdir = include_directories('src')
Ben Tyner941aaeb2019-04-26 17:38:10 -050026
Zane Shelleydd69c962020-05-05 22:19:11 -050027libhei_src = [
28 'src/chip_data/hei_chip_data.cpp',
29 'src/isolator/hei_isolator.cpp',
30 'src/isolator/hei_isolation_chip.cpp',
31 'src/isolator/hei_isolation_node.cpp',
32 'src/register/hei_hardware_register.cpp',
33 'src/util/hei_bit_string.cpp',
34]
Ben Tyner7c796052020-02-03 19:00:37 -060035
Patrick Williamsfffd9832025-02-01 08:38:36 -050036libhei_dep = declare_dependency(
37 include_directories: incdir,
38 sources: [libhei_src, buildinfo],
39)
Ben Tyner7c796052020-02-03 19:00:37 -060040
Ben Tyner032bf9e2020-05-06 21:27:54 -050041# build static library libhei.a (note that the libray name is hei, the
42# resulting filename will be libhei.a)
Patrick Williamsfffd9832025-02-01 08:38:36 -050043libhei_static = static_library('hei', dependencies: libhei_dep, install: true)
Ben Tyner032bf9e2020-05-06 21:27:54 -050044
Zane Shelley3a02e242020-05-08 16:25:36 -050045install_headers(
Zane Shelleye46e4252022-12-05 17:12:44 -060046 'src/hei_buildinfo.hpp',
Zane Shelley3a02e242020-05-08 16:25:36 -050047 'src/hei_chip.hpp',
48 'src/hei_isolation_data.hpp',
49 'src/hei_main.hpp',
50 'src/hei_signature.hpp',
51 'src/hei_types.hpp',
52 'src/hei_user_interface.hpp',
Zane Shelleyd12b8fd2022-01-19 09:32:06 -060053 'src/hei_util.hpp',
Patrick Williamsfffd9832025-02-01 08:38:36 -050054 subdir: 'libhei',
Zane Shelley3a02e242020-05-08 16:25:36 -050055)
Ben Tyner032bf9e2020-05-06 21:27:54 -050056
Zane Shelley995be6c2021-02-24 15:48:55 -060057install_headers(
58 'src/util/hei_bit_string.hpp',
59 'src/util/hei_flyweight.hpp',
Patrick Williamsfffd9832025-02-01 08:38:36 -050060 subdir: 'libhei/util',
Zane Shelley995be6c2021-02-24 15:48:55 -060061)
62
Ben Tyner032bf9e2020-05-06 21:27:54 -050063pkg_mod = import('pkgconfig')
64
Patrick Williamsfffd9832025-02-01 08:38:36 -050065pkg_mod.generate(
66 libraries: libhei_static,
67 version: '0.1',
68 name: 'libhei',
69 subdirs: 'libhei',
70 filebase: 'hei',
71 description: 'Openpower Hardware Error Isolator',
72)
Ben Tyner032bf9e2020-05-06 21:27:54 -050073
Zane Shelleyba5dc162020-11-09 21:47:55 -060074#-------------------------------------------------------------------------------
75# Chip Data Files
76#-------------------------------------------------------------------------------
77
Zane Shelley2215d232023-04-07 14:43:40 -050078subdir('chip_data')
Zane Shelleyba5dc162020-11-09 21:47:55 -060079
80#-------------------------------------------------------------------------------
81# Test
82#-------------------------------------------------------------------------------
83
Zane Shelleyad103b92019-07-31 15:57:54 -050084build_tests = get_option('tests')
Ben Tyner941aaeb2019-04-26 17:38:10 -050085
Patrick Williams19eeabe2025-01-30 17:48:25 -050086if build_tests.allowed()
Patrick Williamsfffd9832025-02-01 08:38:36 -050087 subdir('test')
Ben Tyner941aaeb2019-04-26 17:38:10 -050088endif
Zane Shelleyba5dc162020-11-09 21:47:55 -060089