Chirag Sharma | 5042725 | 2020-08-11 12:11:38 -0500 | [diff] [blame] | 1 | # SPDX-License-Identifier: Apache-2.0 |
| 2 | if get_option('oe-sdk').enabled() |
| 3 | # Setup OE SYSROOT |
| 4 | OECORE_TARGET_SYSROOT = run_command('sh', '-c', 'echo $OECORE_TARGET_SYSROOT').stdout().strip() |
| 5 | if OECORE_TARGET_SYSROOT == '' |
| 6 | error('Unable to get OECORE_TARGET_SYSROOT, check your environment.') |
| 7 | endif |
| 8 | message('OECORE_TARGET_SYSROOT: ' + OECORE_TARGET_SYSROOT) |
| 9 | rpath = ':'.join([OECORE_TARGET_SYSROOT + '/lib', OECORE_TARGET_SYSROOT + '/usr/lib']) |
| 10 | ld_so = run_command('sh', '-c', 'find ' + OECORE_TARGET_SYSROOT + '/lib/ld-*.so | sort -r -n | head -n1').stdout().strip() |
| 11 | dynamic_linker = ['-Wl,-dynamic-linker,' + ld_so] |
| 12 | else |
| 13 | dynamic_linker = [] |
| 14 | endif |
| 15 | |
| 16 | gtest = dependency('gtest', main: true, disabler: true, required: true) |
| 17 | gmock = dependency('gmock', disabler: true, required: true) |
| 18 | |
| 19 | dump = declare_dependency( |
| 20 | sources: [ |
| 21 | '../dump_serialize.cpp' |
| 22 | ]) |
| 23 | |
| 24 | tests = [ |
| 25 | 'debug_inif_test', |
| 26 | ] |
| 27 | |
| 28 | foreach t : tests |
| 29 | test(t, executable(t.underscorify(), t + '.cpp', |
| 30 | include_directories: ['.', '../'], |
| 31 | implicit_include_directories: false, |
| 32 | link_args: dynamic_linker, |
| 33 | build_rpath: get_option('oe-sdk').enabled() ? rpath : '', |
| 34 | dependencies:[ gtest, |
| 35 | gmock, |
| 36 | dump, |
| 37 | phosphor_logging, |
| 38 | cppfs]), |
| 39 | workdir: meson.current_source_dir()) |
| 40 | endforeach |