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 |
SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 14 | gmock = dependency('gmock', disabler: true, required: build_tests) |
| 15 | gtest = dependency('gtest', main: true, disabler: true, required: build_tests) |
SunnySrivastava1984 | 97f8df0 | 2020-05-30 12:05:53 -0500 | [diff] [blame^] | 16 | dependecy_list = [gtest, gmock, sdbusplus, phosphor_logging, phosphor_dbus_interfaces] |
SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 17 | |
SunnySrivastava1984 | 97f8df0 | 2020-05-30 12:05:53 -0500 | [diff] [blame^] | 18 | configuration_inc = include_directories('..', '../vpd-manager', 'vpd-manager-test') |
SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 19 | |
SunnySrivastava1984 | 97f8df0 | 2020-05-30 12:05:53 -0500 | [diff] [blame^] | 20 | vpd_test = ['store/store.cpp', |
| 21 | 'ipz_parser/parser.cpp', |
| 22 | 'keyword_vpd_parser_test/kw_vpd_test.cpp', |
| 23 | 'vpd-manager-test/reader_test.cpp', |
| 24 | ] |
SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 25 | |
SunnySrivastava1984 | 97f8df0 | 2020-05-30 12:05:53 -0500 | [diff] [blame^] | 26 | application_src =['../impl.cpp', |
| 27 | '../vpdecc/vpdecc.c', |
| 28 | '../vpdecc/vpdecc_support.c', |
| 29 | '../parser.cpp', |
| 30 | '../utils.cpp', |
| 31 | '../vpd-manager/reader_impl.cpp', |
| 32 | '../keyword_vpd_parser.cpp', |
| 33 | ] |
SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 34 | |
SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 35 | foreach t : vpd_test |
| 36 | test(t, executable(t.underscorify(), |
| 37 | [t, application_src], |
| 38 | build_rpath: get_option('oe-sdk').enabled() ? rpath : '', |
SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 39 | link_args: dynamic_linker, |
SunnySrivastava1984 | 97f8df0 | 2020-05-30 12:05:53 -0500 | [diff] [blame^] | 40 | cpp_args: ['-DIPZ_PARSER', '-DManagerTest'], |
SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 41 | c_args: ['-Wno-unused-parameter', |
| 42 | '-Wno-unused-variable'], |
SunnySrivastava1984 | 97f8df0 | 2020-05-30 12:05:53 -0500 | [diff] [blame^] | 43 | dependencies: dependecy_list, |
| 44 | include_directories: configuration_inc |
SunnySrivastava1984 | 7ef5442 | 2019-12-03 02:47:37 -0600 | [diff] [blame] | 45 | ), |
| 46 | workdir: meson.current_source_dir()) |
| 47 | endforeach |