blob: 805a65341ca7ef2e8ead39b50fc6f5847d39f250 [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
Sunny Srivastava6a1bd392021-06-02 04:39:24 -050014gmock = dependency('gmock', disabler: true, required: build_tests)
15gtest = dependency('gtest', main: true, disabler: true, required: build_tests)
Alpana Kumari735dee92022-03-25 01:24:40 -050016libgpiodcxx = dependency('libgpiodcxx')
Sunny Srivastava6a1bd392021-06-02 04:39:24 -050017dependecy_list = [gtest, gmock, sdbusplus, phosphor_logging, phosphor_dbus_interfaces, libgpiodcxx]
SunnySrivastava19847ef54422019-12-03 02:47:37 -060018
SunnySrivastava1984e12b1812020-05-26 02:23:11 -050019configuration_inc = include_directories('..', '../vpd-manager', 'vpd-manager-test', '../vpd-parser')
SunnySrivastava19847ef54422019-12-03 02:47:37 -060020
SunnySrivastava198497f8df02020-05-30 12:05:53 -050021vpd_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',
SunnySrivastava1984a0d460e2020-06-03 07:49:26 -050025 'vpd-manager-test/editor_test.cpp'
Sunny Srivastava6c71c9d2021-04-15 04:43:54 -050026]
SunnySrivastava19847ef54422019-12-03 02:47:37 -060027
SunnySrivastava198497f8df02020-05-30 12:05:53 -050028application_src =['../impl.cpp',
SunnySrivastava1984e12b1812020-05-26 02:23:11 -050029 '../vpd-parser/ipz_parser.cpp',
Sunny Srivastava6c71c9d2021-04-15 04:43:54 -050030 '../ibm_vpd_utils.cpp',
31 '../common_utility.cpp',
SunnySrivastava198497f8df02020-05-30 12:05:53 -050032 '../vpd-manager/reader_impl.cpp',
SunnySrivastava1984e12b1812020-05-26 02:23:11 -050033 '../vpd-parser/keyword_vpd_parser.cpp',
34 '../vpd-manager/editor_impl.cpp',
35 '../vpd-parser/parser_factory.cpp',
jinuthomas6555e7e2023-02-14 21:48:00 -060036 '../vpd-parser/memory_vpd_parser.cpp',
37 '../vpd-parser/isdimm_vpd_parser.cpp'
SunnySrivastava198497f8df02020-05-30 12:05:53 -050038 ]
SunnySrivastava19847ef54422019-12-03 02:47:37 -060039
SunnySrivastava19847ef54422019-12-03 02:47:37 -060040foreach t : vpd_test
41 test(t, executable(t.underscorify(),
42 [t, application_src],
43 build_rpath: get_option('oe-sdk').enabled() ? rpath : '',
SunnySrivastava19847ef54422019-12-03 02:47:37 -060044 link_args: dynamic_linker,
SunnySrivastava198497f8df02020-05-30 12:05:53 -050045 cpp_args: ['-DIPZ_PARSER', '-DManagerTest'],
SunnySrivastava19847ef54422019-12-03 02:47:37 -060046 c_args: ['-Wno-unused-parameter',
47 '-Wno-unused-variable'],
SunnySrivastava198497f8df02020-05-30 12:05:53 -050048 dependencies: dependecy_list,
Priyanga Ramasamya4a2adf2022-02-03 05:43:41 -060049 include_directories: configuration_inc,
50 link_with : libvpdecc,
SunnySrivastava19847ef54422019-12-03 02:47:37 -060051 ),
52 workdir: meson.current_source_dir())
53endforeach