blob: 3f144b915e6be81a2e3b85123daa4fe9ee310b1d [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',
SunnySrivastava1984a0d460e2020-06-03 07:49:26 -050024 'vpd-manager-test/editor_test.cpp'
SunnySrivastava198497f8df02020-05-30 12:05:53 -050025 ]
SunnySrivastava19847ef54422019-12-03 02:47:37 -060026
SunnySrivastava198497f8df02020-05-30 12:05:53 -050027application_src =['../impl.cpp',
28 '../vpdecc/vpdecc.c',
29 '../vpdecc/vpdecc_support.c',
30 '../parser.cpp',
31 '../utils.cpp',
32 '../vpd-manager/reader_impl.cpp',
33 '../keyword_vpd_parser.cpp',
SunnySrivastava1984a0d460e2020-06-03 07:49:26 -050034 '../vpd-manager/editor_impl.cpp'
SunnySrivastava198497f8df02020-05-30 12:05:53 -050035 ]
SunnySrivastava19847ef54422019-12-03 02:47:37 -060036
SunnySrivastava19847ef54422019-12-03 02:47:37 -060037foreach t : vpd_test
38 test(t, executable(t.underscorify(),
39 [t, application_src],
40 build_rpath: get_option('oe-sdk').enabled() ? rpath : '',
SunnySrivastava19847ef54422019-12-03 02:47:37 -060041 link_args: dynamic_linker,
SunnySrivastava198497f8df02020-05-30 12:05:53 -050042 cpp_args: ['-DIPZ_PARSER', '-DManagerTest'],
SunnySrivastava19847ef54422019-12-03 02:47:37 -060043 c_args: ['-Wno-unused-parameter',
44 '-Wno-unused-variable'],
SunnySrivastava198497f8df02020-05-30 12:05:53 -050045 dependencies: dependecy_list,
46 include_directories: configuration_inc
SunnySrivastava19847ef54422019-12-03 02:47:37 -060047 ),
48 workdir: meson.current_source_dir())
49endforeach