From 3d99b0662fc061f7f1af413295d8fefbec356dbd Mon Sep 17 00:00:00 2001 From: Tie Liu Date: Wed, 14 Jun 2023 11:10:09 +0800 Subject: [PATCH] fix tests meson --- tests/meson.build | 12 +++++++++++- tests/test_app/meson.build | 7 +++---- tests/test_ifunc/meson.build | 3 +-- tests/test_simple/meson.build | 3 +-- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/tests/meson.build b/tests/meson.build index ccefede..cc205a2 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 55f4ff5..98f05cb 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 9f03c3d..1041410 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 005a5eb..c0ea00a 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 -- Gitee