blob: 73e30c2019eaed96969bf1ad33d9c84a7021446e [file] [log] [blame]
oe_sdk = get_option('oe-sdk')
if 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('OE_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
examples = [
'get_version',
]
foreach example : examples
executable(example, example + '.cpp',
implicit_include_directories: false,
link_args: dynamic_linker,
build_rpath: oe_sdk.enabled() ? rpath : '')
endforeach