SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 1 | if get_option('oe-sdk').enabled() |
| 2 | # Setup OE SYSROOT |
| 3 | OECORE_TARGET_SYSROOT = run_command('sh', '-c', 'echo $OECORE_TARGET_SYSROOT').stdout().strip() |
| 4 | if OECORE_TARGET_SYSROOT == '' |
| 5 | error('Unable to get $OECORE_TARGET_SYSROOT, check your environment.') |
| 6 | endif |
| 7 | message('OE_SYSROOT: ' + OECORE_TARGET_SYSROOT) |
| 8 | rpath = ':'.join([OECORE_TARGET_SYSROOT + '/lib', OECORE_TARGET_SYSROOT + '/usr/lib']) |
| 9 | ld_so = run_command('sh', '-c', 'find ' + OECORE_TARGET_SYSROOT + '/lib/ld-*.so | sort -r -n | head -n1').stdout().strip() |
| 10 | dynamic_linker = ['-Wl,-dynamic-linker,' + ld_so] |
| 11 | else |
| 12 | dynamic_linker = [] |
| 13 | endif |
Sunny Srivastava | 6a1bd39 | 2021-06-02 04:39:24 -0500 | [diff] [blame] | 14 | gmock = dependency('gmock', disabler: true, required: build_tests) |
| 15 | gtest = dependency('gtest', main: true, disabler: true, required: build_tests) |
Alpana Kumari | 735dee9 | 2022-03-25 01:24:40 -0500 | [diff] [blame] | 16 | libgpiodcxx = dependency('libgpiodcxx') |
Sunny Srivastava | 6a1bd39 | 2021-06-02 04:39:24 -0500 | [diff] [blame] | 17 | dependecy_list = [gtest, gmock, sdbusplus, phosphor_logging, phosphor_dbus_interfaces, libgpiodcxx] |
SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 18 | |
SunnySrivastava1984 | e12b181 | 2020-05-26 02:23:11 -0500 | [diff] [blame] | 19 | configuration_inc = include_directories('..', '../vpd-manager', 'vpd-manager-test', '../vpd-parser') |
SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 20 | |
SunnySrivastava1984 | 97f8df0 | 2020-05-30 12:05:53 -0500 | [diff] [blame] | 21 | vpd_test = ['store/store.cpp', |
| 22 | 'ipz_parser/parser.cpp', |
| 23 | 'keyword_vpd_parser_test/kw_vpd_test.cpp', |
| 24 | 'vpd-manager-test/reader_test.cpp', |
SunnySrivastava1984 | a0d460e | 2020-06-03 07:49:26 -0500 | [diff] [blame] | 25 | 'vpd-manager-test/editor_test.cpp' |
Sunny Srivastava | 6c71c9d | 2021-04-15 04:43:54 -0500 | [diff] [blame] | 26 | ] |
SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 27 | |
SunnySrivastava1984 | 97f8df0 | 2020-05-30 12:05:53 -0500 | [diff] [blame] | 28 | application_src =['../impl.cpp', |
SunnySrivastava1984 | e12b181 | 2020-05-26 02:23:11 -0500 | [diff] [blame] | 29 | '../vpd-parser/ipz_parser.cpp', |
Sunny Srivastava | 6c71c9d | 2021-04-15 04:43:54 -0500 | [diff] [blame] | 30 | '../ibm_vpd_utils.cpp', |
| 31 | '../common_utility.cpp', |
SunnySrivastava1984 | 97f8df0 | 2020-05-30 12:05:53 -0500 | [diff] [blame] | 32 | '../vpd-manager/reader_impl.cpp', |
SunnySrivastava1984 | e12b181 | 2020-05-26 02:23:11 -0500 | [diff] [blame] | 33 | '../vpd-parser/keyword_vpd_parser.cpp', |
| 34 | '../vpd-manager/editor_impl.cpp', |
| 35 | '../vpd-parser/parser_factory.cpp', |
jinuthomas | 6555e7e | 2023-02-14 21:48:00 -0600 | [diff] [blame] | 36 | '../vpd-parser/memory_vpd_parser.cpp', |
| 37 | '../vpd-parser/isdimm_vpd_parser.cpp' |
SunnySrivastava1984 | 97f8df0 | 2020-05-30 12:05:53 -0500 | [diff] [blame] | 38 | ] |
SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 39 | |
SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 40 | foreach t : vpd_test |
| 41 | test(t, executable(t.underscorify(), |
| 42 | [t, application_src], |
| 43 | build_rpath: get_option('oe-sdk').enabled() ? rpath : '', |
SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 44 | link_args: dynamic_linker, |
SunnySrivastava1984 | 97f8df0 | 2020-05-30 12:05:53 -0500 | [diff] [blame] | 45 | cpp_args: ['-DIPZ_PARSER', '-DManagerTest'], |
SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 46 | c_args: ['-Wno-unused-parameter', |
| 47 | '-Wno-unused-variable'], |
SunnySrivastava1984 | 97f8df0 | 2020-05-30 12:05:53 -0500 | [diff] [blame] | 48 | dependencies: dependecy_list, |
Priyanga Ramasamy | a4a2adf | 2022-02-03 05:43:41 -0600 | [diff] [blame] | 49 | include_directories: configuration_inc, |
| 50 | link_with : libvpdecc, |
SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 51 | ), |
| 52 | workdir: meson.current_source_dir()) |
| 53 | endforeach |