diff --git a/tests/meson.build b/tests/meson.build index ccefede21b9f6efe0da238496d45c8883563d965..cc205a22678ca654c0b44b5bca6ae6d76c02e87d 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -1,3 +1,13 @@ # SPDX-License-Identifier: MulanPSL-2.0 -tests = ['test_app', 'test_simple', 'test_ifunc'] \ No newline at end of file +tests = ['test_app', 'test_simple', 'test_ifunc'] + +foreach test:tests + name = test + sources = [] + includes = [] + cflags = [] + ldflags = [] + + subdir(name) +endforeach \ No newline at end of file diff --git a/tests/test_app/meson.build b/tests/test_app/meson.build index 55f4ff579c2ea7351572dbc81454f527102f7f8f..98f05cbaad6eb9345227ecbea349900120ef351a 100644 --- a/tests/test_app/meson.build +++ b/tests/test_app/meson.build @@ -7,18 +7,18 @@ ldflags += ['-pie', '-ldl'] # Add a target for libutil2.so shared library util1 = shared_library('util1', 'util1.c', - dependencies : ext_deps + dep_objs, + dependencies : ext_deps, c_args : cflags, link_args : lk_args, build_rpath : './') util1_ori = shared_library('util1_ori', 'util1.c', - dependencies : ext_deps + dep_objs, + dependencies : ext_deps, c_args : cflags) # Add a target for libutil2.so shared library util2 = shared_library('util2', 'util2.c', - dependencies : ext_deps + dep_objs, + dependencies : ext_deps, c_args : cflags, link_args : lk_args, build_rpath : './') @@ -29,7 +29,6 @@ test_app_dep = declare_dependency(link_with: [util1, util2]) executable('test_app', sources, c_args: cflags, link_args: ldflags, - link_whole: link_libs, build_rpath : './', dependencies: test_app_dep, include_directories: includes) \ No newline at end of file diff --git a/tests/test_ifunc/meson.build b/tests/test_ifunc/meson.build index 9f03c3dad49410822609bf9c3f1717fae0e5ff49..1041410fcef6816aff51ba1277aa14daeec26f72 100644 --- a/tests/test_ifunc/meson.build +++ b/tests/test_ifunc/meson.build @@ -6,7 +6,6 @@ cflags += ['-fpic', '-pie', '-pthread', '-ldl', '-static-pie', '-Wl,-z,relro,-z, executable('test_ifunc', sources, c_args: cflags, link_args: ldflags + cflags, - link_whole: link_libs, build_rpath : './', - dependencies: ext_deps + dep_objs, + dependencies: ext_deps, include_directories: includes) \ No newline at end of file diff --git a/tests/test_simple/meson.build b/tests/test_simple/meson.build index 005a5eb4e8fa036e92225b8d7a1452e21d6024d6..c0ea00abaa7a864a74e875c38dfd789a033abcc1 100644 --- a/tests/test_simple/meson.build +++ b/tests/test_simple/meson.build @@ -6,7 +6,6 @@ cflags += ['-fpic', '-pie', '-pthread', '-ldl'] executable('simple_app', sources, c_args: cflags, link_args: ldflags, - link_whole: link_libs, build_rpath : './', - dependencies: ext_deps + dep_objs, + dependencies: ext_deps, include_directories: includes) \ No newline at end of file