Allow static building with meson

Added "static-build" option in the meson_options.txt.
Setting it to "true" allows static building.

Signed-off-by: Tero Tervala <tero.tervala@unikie.com>
Message-Id: <20220629163557.932298-1-tero.tervala@unikie.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
Tero Tervala 2022-06-29 19:35:57 +03:00 committed by David Gibson
parent fd9b8c96c7
commit 7ad60734b1
4 changed files with 28 additions and 5 deletions

View file

@ -96,15 +96,20 @@ tests += [
]
dl = cc.find_library('dl', required: false)
if dl.found()
if dl.found() and not static_build
tests += [
'asm_tree_dump',
'value-labels',
]
endif
test_deps = [testutil_dep, util_dep, libfdt_dep]
if not static_build
test_deps += [dl]
endif
foreach t: tests
executable(t, files(t + '.c'), dependencies: [testutil_dep, util_dep, libfdt_dep, dl])
executable(t, files(t + '.c'), dependencies: test_deps, link_args: extra_link_args)
endforeach
run_tests = find_program('run_tests.sh')