blob: eab0c6756d4f2c94f025855bd756364da6a0387c [file] [log] [blame]
SunnySrivastava19847ef54422019-12-03 02:47:37 -06001if 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]
11else
12 dynamic_linker = []
13endif
SunnySrivastava19847ef54422019-12-03 02:47:37 -060014gmock = dependency('gmock', disabler: true, required: build_tests)
15gtest = dependency('gtest', main: true, disabler: true, required: build_tests)
SunnySrivastava198497f8df02020-05-30 12:05:53 -050016dependecy_list = [gtest, gmock, sdbusplus, phosphor_logging, phosphor_dbus_interfaces]
SunnySrivastava19847ef54422019-12-03 02:47:37 -060017
SunnySrivastava198497f8df02020-05-30 12:05:53 -050018configuration_inc = include_directories('..', '../vpd-manager', 'vpd-manager-test')
SunnySrivastava19847ef54422019-12-03 02:47:37 -060019
SunnySrivastava198497f8df02020-05-30 12:05:53 -050020vpd_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 ]
SunnySrivastava19847ef54422019-12-03 02:47:37 -060025
SunnySrivastava198497f8df02020-05-30 12:05:53 -050026application_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 ]
SunnySrivastava19847ef54422019-12-03 02:47:37 -060034
SunnySrivastava19847ef54422019-12-03 02:47:37 -060035foreach t : vpd_test
36 test(t, executable(t.underscorify(),
37 [t, application_src],
38 build_rpath: get_option('oe-sdk').enabled() ? rpath : '',
SunnySrivastava19847ef54422019-12-03 02:47:37 -060039 link_args: dynamic_linker,
SunnySrivastava198497f8df02020-05-30 12:05:53 -050040 cpp_args: ['-DIPZ_PARSER', '-DManagerTest'],
SunnySrivastava19847ef54422019-12-03 02:47:37 -060041 c_args: ['-Wno-unused-parameter',
42 '-Wno-unused-variable'],
SunnySrivastava198497f8df02020-05-30 12:05:53 -050043 dependencies: dependecy_list,
44 include_directories: configuration_inc
SunnySrivastava19847ef54422019-12-03 02:47:37 -060045 ),
46 workdir: meson.current_source_dir())
47endforeach