Zane Shelley | ba5dc16 | 2020-11-09 21:47:55 -0600 | [diff] [blame] | 1 | # OpenBMC openpower-libhei project, see README.md for details. |
Ben Tyner | 941aaeb | 2019-04-26 17:38:10 -0500 | [diff] [blame] | 2 | project('openpower-libhei', 'cpp', |
Zane Shelley | fefc016 | 2021-12-20 17:29:46 -0600 | [diff] [blame] | 3 | version: '0.1', meson_version: '>=0.51.0', |
Ben Tyner | 941aaeb | 2019-04-26 17:38:10 -0500 | [diff] [blame] | 4 | default_options: [ |
| 5 | 'warning_level=3', |
| 6 | 'werror=true', |
Zane Shelley | 83a8d55 | 2020-05-07 15:08:52 -0500 | [diff] [blame] | 7 | 'cpp_std=c++14', |
Ben Tyner | 0fa81f7 | 2019-09-05 14:30:02 -0500 | [diff] [blame] | 8 | ]) |
Ben Tyner | 941aaeb | 2019-04-26 17:38:10 -0500 | [diff] [blame] | 9 | |
Zane Shelley | ba5dc16 | 2020-11-09 21:47:55 -0600 | [diff] [blame] | 10 | #------------------------------------------------------------------------------- |
Ben Tyner | 552992a | 2021-04-15 10:57:17 -0500 | [diff] [blame] | 11 | # Versioning |
| 12 | #------------------------------------------------------------------------------- |
| 13 | buildinfo = 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 Shelley | ba5dc16 | 2020-11-09 21:47:55 -0600 | [diff] [blame] | 20 | # libhei library |
| 21 | #------------------------------------------------------------------------------- |
| 22 | |
Ben Tyner | 032bf9e | 2020-05-06 21:27:54 -0500 | [diff] [blame] | 23 | incdir = include_directories('src') |
Ben Tyner | 941aaeb | 2019-04-26 17:38:10 -0500 | [diff] [blame] | 24 | |
Zane Shelley | dd69c96 | 2020-05-05 22:19:11 -0500 | [diff] [blame] | 25 | libhei_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 Tyner | 7c79605 | 2020-02-03 19:00:37 -0600 | [diff] [blame] | 33 | |
| 34 | libhei_dep = declare_dependency(include_directories : incdir, |
Ben Tyner | 552992a | 2021-04-15 10:57:17 -0500 | [diff] [blame] | 35 | sources : [libhei_src, buildinfo]) |
Ben Tyner | 7c79605 | 2020-02-03 19:00:37 -0600 | [diff] [blame] | 36 | |
Ben Tyner | 032bf9e | 2020-05-06 21:27:54 -0500 | [diff] [blame] | 37 | # build static library libhei.a (note that the libray name is hei, the |
| 38 | # resulting filename will be libhei.a) |
| 39 | libhei_static = static_library('hei', |
| 40 | dependencies: libhei_dep, |
| 41 | install: true) |
| 42 | |
Zane Shelley | 3a02e24 | 2020-05-08 16:25:36 -0500 | [diff] [blame] | 43 | install_headers( |
Zane Shelley | e46e425 | 2022-12-05 17:12:44 -0600 | [diff] [blame] | 44 | 'src/hei_buildinfo.hpp', |
Zane Shelley | 3a02e24 | 2020-05-08 16:25:36 -0500 | [diff] [blame] | 45 | '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 Shelley | d12b8fd | 2022-01-19 09:32:06 -0600 | [diff] [blame] | 51 | 'src/hei_util.hpp', |
Zane Shelley | 3a02e24 | 2020-05-08 16:25:36 -0500 | [diff] [blame] | 52 | subdir : 'libhei' |
| 53 | ) |
Ben Tyner | 032bf9e | 2020-05-06 21:27:54 -0500 | [diff] [blame] | 54 | |
Zane Shelley | 995be6c | 2021-02-24 15:48:55 -0600 | [diff] [blame] | 55 | install_headers( |
| 56 | 'src/util/hei_bit_string.hpp', |
| 57 | 'src/util/hei_flyweight.hpp', |
| 58 | subdir : 'libhei/util' |
| 59 | ) |
| 60 | |
Ben Tyner | 032bf9e | 2020-05-06 21:27:54 -0500 | [diff] [blame] | 61 | pkg_mod = import('pkgconfig') |
| 62 | |
| 63 | pkg_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 Shelley | ba5dc16 | 2020-11-09 21:47:55 -0600 | [diff] [blame] | 70 | #------------------------------------------------------------------------------- |
| 71 | # Chip Data Files |
| 72 | #------------------------------------------------------------------------------- |
| 73 | |
| 74 | subdir('xml') |
| 75 | |
| 76 | #------------------------------------------------------------------------------- |
| 77 | # Test |
| 78 | #------------------------------------------------------------------------------- |
| 79 | |
Zane Shelley | ad103b9 | 2019-07-31 15:57:54 -0500 | [diff] [blame] | 80 | build_tests = get_option('tests') |
Ben Tyner | 941aaeb | 2019-04-26 17:38:10 -0500 | [diff] [blame] | 81 | |
Zane Shelley | ad103b9 | 2019-07-31 15:57:54 -0500 | [diff] [blame] | 82 | if not build_tests.disabled() |
Zane Shelley | ad103b9 | 2019-07-31 15:57:54 -0500 | [diff] [blame] | 83 | subdir('test') |
Ben Tyner | 941aaeb | 2019-04-26 17:38:10 -0500 | [diff] [blame] | 84 | endif |
Zane Shelley | ba5dc16 | 2020-11-09 21:47:55 -0600 | [diff] [blame] | 85 | |