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', |
Paul Greenwood | dc47e0a | 2019-11-01 16:22:57 -0500 | [diff] [blame] | 3 | version: '0.1', meson_version: '>=0.50.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( |
| 44 | 'src/hei_chip.hpp', |
| 45 | 'src/hei_isolation_data.hpp', |
| 46 | 'src/hei_main.hpp', |
| 47 | 'src/hei_signature.hpp', |
| 48 | 'src/hei_types.hpp', |
| 49 | 'src/hei_user_interface.hpp', |
| 50 | subdir : 'libhei' |
| 51 | ) |
Ben Tyner | 032bf9e | 2020-05-06 21:27:54 -0500 | [diff] [blame] | 52 | |
Zane Shelley | 995be6c | 2021-02-24 15:48:55 -0600 | [diff] [blame] | 53 | install_headers( |
| 54 | 'src/util/hei_bit_string.hpp', |
| 55 | 'src/util/hei_flyweight.hpp', |
| 56 | subdir : 'libhei/util' |
| 57 | ) |
| 58 | |
Ben Tyner | 032bf9e | 2020-05-06 21:27:54 -0500 | [diff] [blame] | 59 | pkg_mod = import('pkgconfig') |
| 60 | |
| 61 | pkg_mod.generate(libraries : libhei_static, |
| 62 | version : '0.1', |
| 63 | name : 'libhei', |
| 64 | subdirs: 'libhei', |
| 65 | filebase : 'hei', |
| 66 | description : 'Openpower Hardware Error Isolator') |
| 67 | |
Zane Shelley | ba5dc16 | 2020-11-09 21:47:55 -0600 | [diff] [blame] | 68 | #------------------------------------------------------------------------------- |
| 69 | # Chip Data Files |
| 70 | #------------------------------------------------------------------------------- |
| 71 | |
| 72 | subdir('xml') |
| 73 | |
| 74 | #------------------------------------------------------------------------------- |
| 75 | # Test |
| 76 | #------------------------------------------------------------------------------- |
| 77 | |
Zane Shelley | ad103b9 | 2019-07-31 15:57:54 -0500 | [diff] [blame] | 78 | build_tests = get_option('tests') |
Ben Tyner | 941aaeb | 2019-04-26 17:38:10 -0500 | [diff] [blame] | 79 | |
Zane Shelley | ad103b9 | 2019-07-31 15:57:54 -0500 | [diff] [blame] | 80 | if not build_tests.disabled() |
Zane Shelley | ad103b9 | 2019-07-31 15:57:54 -0500 | [diff] [blame] | 81 | subdir('test') |
Ben Tyner | 941aaeb | 2019-04-26 17:38:10 -0500 | [diff] [blame] | 82 | endif |
Zane Shelley | ba5dc16 | 2020-11-09 21:47:55 -0600 | [diff] [blame] | 83 | |