blob: d375acc400b6842f879de032fc9cc0bc28845621 [file] [log] [blame]
# SPDX-License-Identifier: Apache-2.0
if get_option('oe-sdk').enabled()
# Setup OE SYSROOT
OECORE_TARGET_SYSROOT = run_command('sh', '-c', 'echo $OECORE_TARGET_SYSROOT').stdout().strip()
if OECORE_TARGET_SYSROOT == ''
error('Unable to get OECORE_TARGET_SYSROOT, check your environment.')
endif
message('OECORE_TARGET_SYSROOT: ' + OECORE_TARGET_SYSROOT)
rpath = ':'.join([OECORE_TARGET_SYSROOT + '/lib', OECORE_TARGET_SYSROOT + '/usr/lib'])
ld_so = run_command('sh', '-c', 'find ' + OECORE_TARGET_SYSROOT + '/lib/ld-*.so | sort -r -n | head -n1').stdout().strip()
dynamic_linker = ['-Wl,-dynamic-linker,' + ld_so]
else
dynamic_linker = []
endif
gtest = dependency('gtest', main: true, disabler: true, required: true)
gmock = dependency('gmock', disabler: true, required: true)
dump = declare_dependency(
sources: [
'../dump_serialize.cpp'
])
tests = [
'debug_inif_test',
]
foreach t : tests
test(t, executable(t.underscorify(), t + '.cpp',
include_directories: ['.', '../'],
implicit_include_directories: false,
link_args: dynamic_linker,
build_rpath: get_option('oe-sdk').enabled() ? rpath : '',
dependencies:[ gtest,
gmock,
dump,
phosphor_logging,
cppfs]),
workdir: meson.current_source_dir())
endforeach