blob: 04136e990b5a4addc34d85dfe27ec118b6d6db42 [file] [log] [blame]
Zane Shelleyba5dc162020-11-09 21:47:55 -06001# OpenBMC openpower-libhei project, see README.md for details.
Ben Tyner941aaeb2019-04-26 17:38:10 -05002project('openpower-libhei', 'cpp',
Zane Shelleyfefc0162021-12-20 17:29:46 -06003 version: '0.1', meson_version: '>=0.51.0',
Ben Tyner941aaeb2019-04-26 17:38:10 -05004 default_options: [
5 'warning_level=3',
6 'werror=true',
Zane Shelley83a8d552020-05-07 15:08:52 -05007 'cpp_std=c++14',
Ben Tyner0fa81f72019-09-05 14:30:02 -05008 ])
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#-------------------------------------------------------------------------------
13buildinfo = vcs_tag(command: ['git', 'describe', '--always', '--long'],
14 input: 'buildinfo.hpp.in',
15 output: 'buildinfo.hpp',
16 replace_string:'@BUILDINFO@',
17 fallback: '0')
18
19#-------------------------------------------------------------------------------
Zane Shelleyba5dc162020-11-09 21:47:55 -060020# libhei library
21#-------------------------------------------------------------------------------
22
Ben Tyner032bf9e2020-05-06 21:27:54 -050023incdir = include_directories('src')
Ben Tyner941aaeb2019-04-26 17:38:10 -050024
Zane Shelleydd69c962020-05-05 22:19:11 -050025libhei_src = [
26 'src/chip_data/hei_chip_data.cpp',
27 'src/isolator/hei_isolator.cpp',
28 'src/isolator/hei_isolation_chip.cpp',
29 'src/isolator/hei_isolation_node.cpp',
30 'src/register/hei_hardware_register.cpp',
31 'src/util/hei_bit_string.cpp',
32]
Ben Tyner7c796052020-02-03 19:00:37 -060033
34libhei_dep = declare_dependency(include_directories : incdir,
Ben Tyner552992a2021-04-15 10:57:17 -050035 sources : [libhei_src, buildinfo])
Ben Tyner7c796052020-02-03 19:00:37 -060036
Ben Tyner032bf9e2020-05-06 21:27:54 -050037# build static library libhei.a (note that the libray name is hei, the
38# resulting filename will be libhei.a)
39libhei_static = static_library('hei',
40 dependencies: libhei_dep,
41 install: true)
42
Zane Shelley3a02e242020-05-08 16:25:36 -050043install_headers(
Zane Shelleye46e4252022-12-05 17:12:44 -060044 'src/hei_buildinfo.hpp',
Zane Shelley3a02e242020-05-08 16:25:36 -050045 'src/hei_chip.hpp',
46 'src/hei_isolation_data.hpp',
47 'src/hei_main.hpp',
48 'src/hei_signature.hpp',
49 'src/hei_types.hpp',
50 'src/hei_user_interface.hpp',
Zane Shelleyd12b8fd2022-01-19 09:32:06 -060051 'src/hei_util.hpp',
Zane Shelley3a02e242020-05-08 16:25:36 -050052 subdir : 'libhei'
53)
Ben Tyner032bf9e2020-05-06 21:27:54 -050054
Zane Shelley995be6c2021-02-24 15:48:55 -060055install_headers(
56 'src/util/hei_bit_string.hpp',
57 'src/util/hei_flyweight.hpp',
58 subdir : 'libhei/util'
59)
60
Ben Tyner032bf9e2020-05-06 21:27:54 -050061pkg_mod = import('pkgconfig')
62
63pkg_mod.generate(libraries : libhei_static,
64 version : '0.1',
65 name : 'libhei',
66 subdirs: 'libhei',
67 filebase : 'hei',
68 description : 'Openpower Hardware Error Isolator')
69
Zane Shelleyba5dc162020-11-09 21:47:55 -060070#-------------------------------------------------------------------------------
71# Chip Data Files
72#-------------------------------------------------------------------------------
73
Zane Shelley2215d232023-04-07 14:43:40 -050074subdir('chip_data')
Zane Shelleyba5dc162020-11-09 21:47:55 -060075
76#-------------------------------------------------------------------------------
77# Test
78#-------------------------------------------------------------------------------
79
Zane Shelleyad103b92019-07-31 15:57:54 -050080build_tests = get_option('tests')
Ben Tyner941aaeb2019-04-26 17:38:10 -050081
Zane Shelleyad103b92019-07-31 15:57:54 -050082if not build_tests.disabled()
Zane Shelleyad103b92019-07-31 15:57:54 -050083 subdir('test')
Ben Tyner941aaeb2019-04-26 17:38:10 -050084endif
Zane Shelleyba5dc162020-11-09 21:47:55 -060085