diff mbox series

[v5,13/17] meson: Add build infrastructure for common-user

Message ID 20211117160412.71563-14-richard.henderson@linaro.org
State New
Headers show
Series linux-user: simplify safe signal handling | expand

Commit Message

Richard Henderson Nov. 17, 2021, 4:04 p.m. UTC
The first objects to be added will be target-independent,
and so built once for the host.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 meson.build             | 16 +++++++++++++++-
 bsd-user/meson.build    |  2 ++
 common-user/meson.build |  1 +
 linux-user/meson.build  |  3 +++
 4 files changed, 21 insertions(+), 1 deletion(-)
 create mode 100644 common-user/meson.build

Comments

Warner Losh Nov. 17, 2021, 5:22 p.m. UTC | #1
On Wed, Nov 17, 2021 at 9:04 AM Richard Henderson <
richard.henderson@linaro.org> wrote:

> The first objects to be added will be target-independent,
> and so built once for the host.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  meson.build             | 16 +++++++++++++++-
>  bsd-user/meson.build    |  2 ++
>  common-user/meson.build |  1 +
>  linux-user/meson.build  |  3 +++
>  4 files changed, 21 insertions(+), 1 deletion(-)
>  create mode 100644 common-user/meson.build
>

Reviewed-by: Warner Losh <imp@bsdimp.com>


> diff --git a/meson.build b/meson.build
> index c58abf0d0d..387f7fe1c9 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -2359,6 +2359,7 @@ block_ss = ss.source_set()
>  bsd_user_ss = ss.source_set()
>  chardev_ss = ss.source_set()
>  common_ss = ss.source_set()
> +common_user_ss = ss.source_set()
>  crypto_ss = ss.source_set()
>  hwcore_ss = ss.source_set()
>  io_ss = ss.source_set()
> @@ -2603,15 +2604,28 @@ subdir('tcg')
>  subdir('fpu')
>  subdir('accel')
>  subdir('plugins')
> +subdir('ebpf')
> +
> +common_user_inc = []
> +
> +subdir('common-user')
>  subdir('bsd-user')
>  subdir('linux-user')
> -subdir('ebpf')
>
>  specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss)
>
>  linux_user_ss.add(files('thunk.c'))
>  specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss)
>
> +common_user_ss = common_user_ss.apply(config_all, strict: false)
> +common_user = static_library('common-user',
> +                             sources: common_user_ss.sources(),
> +                             dependencies: common_user_ss.dependencies(),
> +                             include_directories: common_user_inc)
> +common_user = declare_dependency(link_with: common_user)
> +
> +user_ss.add(common_user)
> +
>  # needed for fuzzing binaries
>  subdir('tests/qtest/libqos')
>  subdir('tests/qtest/fuzz')
> diff --git a/bsd-user/meson.build b/bsd-user/meson.build
> index 87885d91ed..25c3976ead 100644
> --- a/bsd-user/meson.build
> +++ b/bsd-user/meson.build
> @@ -2,6 +2,8 @@ if not have_bsd_user
>     subdir_done()
>  endif
>
> +common_user_inc += include_directories('.')
> +
>  bsd_user_ss.add(files(
>    'bsdload.c',
>    'elfload.c',
> diff --git a/common-user/meson.build b/common-user/meson.build
> new file mode 100644
> index 0000000000..4f5c0f2f88
> --- /dev/null
> +++ b/common-user/meson.build
> @@ -0,0 +1 @@
> +common_user_inc += include_directories('host/' / config_host['ARCH'])
> diff --git a/linux-user/meson.build b/linux-user/meson.build
> index bf62c13e37..d6fa4f4d74 100644
> --- a/linux-user/meson.build
> +++ b/linux-user/meson.build
> @@ -2,6 +2,9 @@ if not have_linux_user
>     subdir_done()
>  endif
>
> +common_user_inc += include_directories('host/' / config_host['ARCH'])
> +common_user_inc += include_directories('.')
> +
>  linux_user_ss.add(files(
>    'elfload.c',
>    'exit.c',
> --
> 2.25.1
>
>
diff mbox series

Patch

diff --git a/meson.build b/meson.build
index c58abf0d0d..387f7fe1c9 100644
--- a/meson.build
+++ b/meson.build
@@ -2359,6 +2359,7 @@  block_ss = ss.source_set()
 bsd_user_ss = ss.source_set()
 chardev_ss = ss.source_set()
 common_ss = ss.source_set()
+common_user_ss = ss.source_set()
 crypto_ss = ss.source_set()
 hwcore_ss = ss.source_set()
 io_ss = ss.source_set()
@@ -2603,15 +2604,28 @@  subdir('tcg')
 subdir('fpu')
 subdir('accel')
 subdir('plugins')
+subdir('ebpf')
+
+common_user_inc = []
+
+subdir('common-user')
 subdir('bsd-user')
 subdir('linux-user')
-subdir('ebpf')
 
 specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss)
 
 linux_user_ss.add(files('thunk.c'))
 specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss)
 
+common_user_ss = common_user_ss.apply(config_all, strict: false)
+common_user = static_library('common-user',
+                             sources: common_user_ss.sources(),
+                             dependencies: common_user_ss.dependencies(),
+                             include_directories: common_user_inc)
+common_user = declare_dependency(link_with: common_user)
+
+user_ss.add(common_user)
+
 # needed for fuzzing binaries
 subdir('tests/qtest/libqos')
 subdir('tests/qtest/fuzz')
diff --git a/bsd-user/meson.build b/bsd-user/meson.build
index 87885d91ed..25c3976ead 100644
--- a/bsd-user/meson.build
+++ b/bsd-user/meson.build
@@ -2,6 +2,8 @@  if not have_bsd_user
    subdir_done()
 endif
 
+common_user_inc += include_directories('.')
+
 bsd_user_ss.add(files(
   'bsdload.c',
   'elfload.c',
diff --git a/common-user/meson.build b/common-user/meson.build
new file mode 100644
index 0000000000..4f5c0f2f88
--- /dev/null
+++ b/common-user/meson.build
@@ -0,0 +1 @@ 
+common_user_inc += include_directories('host/' / config_host['ARCH'])
diff --git a/linux-user/meson.build b/linux-user/meson.build
index bf62c13e37..d6fa4f4d74 100644
--- a/linux-user/meson.build
+++ b/linux-user/meson.build
@@ -2,6 +2,9 @@  if not have_linux_user
    subdir_done()
 endif
 
+common_user_inc += include_directories('host/' / config_host['ARCH'])
+common_user_inc += include_directories('.')
+
 linux_user_ss.add(files(
   'elfload.c',
   'exit.c',