Skip to content

Commit

Permalink
meson: convert net directory to Meson
Browse files Browse the repository at this point in the history
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
elmarco authored and bonzini committed Aug 21, 2020
1 parent 5516623 commit cdaf072
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 36 deletions.
3 changes: 1 addition & 2 deletions Makefile.objs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ endif # CONFIG_SOFTMMU or CONFIG_TOOLS
# single QEMU executable should support all CPUs and machines.

ifeq ($(CONFIG_SOFTMMU),y)
common-obj-y = net/
common-obj-$(CONFIG_LINUX) += fsdev/
common-obj-$(CONFIG_LINUX) = fsdev/

common-obj-y += accel/

Expand Down
1 change: 1 addition & 0 deletions Makefile.target
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ LIBS := $(LIBS) $(GTK_LIBS) $(VTE_LIBS) $(X11_LIBS) $(CURSES_LIBS) $(ICONV_LIBS)
endif
LIBS := $(LIBS) $(BRLAPI_LIBS) $(SDL_LIBS) $(SPICE_LIBS) $(OPENGL_LIBS) $(SECCOMP_LIBS)
LIBS := $(LIBS) $(COREAUDIO_LIBS) $(DSOUND_LIBS)
LIBS := $(LIBS) $(VDE_LIBS) $(SLIRP_LIBS)

# Hardware support
ifeq ($(TARGET_NAME), sparc64)
Expand Down
10 changes: 10 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,15 @@ if 'CONFIG_XKBCOMMON' in config_host
xkbcommon = declare_dependency(compile_args: config_host['XKBCOMMON_CFLAGS'].split(),
link_args: config_host['XKBCOMMON_LIBS'].split())
endif
slirp = not_found
if config_host.has_key('CONFIG_SLIRP')
slirp = declare_dependency(compile_args: config_host['SLIRP_CFLAGS'].split(),
link_args: config_host['SLIRP_LIBS'].split())
endif
vde = not_found
if config_host.has_key('CONFIG_VDE')
vde = declare_dependency(link_args: config_host['VDE_LIBS'].split())
endif
pulse = not_found
if 'CONFIG_LIBPULSE' in config_host
pulse = declare_dependency(compile_args: config_host['PULSE_CFLAGS'].split(),
Expand Down Expand Up @@ -661,6 +670,7 @@ common_ss.add(files('cpus-common.c'))
subdir('softmmu')
subdir('migration')
subdir('monitor')
subdir('net')
subdir('replay')

# needed for fuzzing binaries
Expand Down
32 changes: 0 additions & 32 deletions net/Makefile.objs

This file was deleted.

2 changes: 0 additions & 2 deletions net/can/Makefile.objs

This file was deleted.

5 changes: 5 additions & 0 deletions net/can/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
can_ss = ss.source_set()
can_ss.add(files('can_core.c', 'can_host.c'))
can_ss.add(when: 'CONFIG_LINUX', if_true: files('can_socketcan.c'))

softmmu_ss.add_all(when: 'CONFIG_CAN_BUS', if_true: can_ss)
40 changes: 40 additions & 0 deletions net/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
softmmu_ss.add(files(
'announce.c',
'checksum.c',
'colo-compare.c',
'colo.c',
'dump.c',
'eth.c',
'filter-buffer.c',
'filter-mirror.c',
'filter-replay.c',
'filter-rewriter.c',
'filter.c',
'hub.c',
'net.c',
'queue.c',
'socket.c',
'util.c',
))

softmmu_ss.add(when: 'CONFIG_L2TPV3', if_true: files('l2tpv3.c'))
softmmu_ss.add(when: ['CONFIG_SLIRP', slirp], if_true: files('slirp.c'))
softmmu_ss.add(when: ['CONFIG_VDE', vde], if_true: files('vde.c'))
softmmu_ss.add(when: 'CONFIG_NETMAP', if_true: files('netmap.c'))
vhost_user_ss = ss.source_set()
vhost_user_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('vhost-user.c'), if_false: files('vhost-user-stub.c'))
softmmu_ss.add_all(when: 'CONFIG_VHOST_NET_USER', if_true: vhost_user_ss)
softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('vhost-user-stub.c'))

softmmu_ss.add(when: 'CONFIG_LINUX', if_true: files('tap-linux.c'))
softmmu_ss.add(when: 'CONFIG_BSD', if_true: files('tap-bsd.c'))
softmmu_ss.add(when: 'CONFIG_SOLARIS', if_true: files('tap-solaris.c'))
tap_posix = ['tap.c']
if not config_host.has_key('CONFIG_LINUX') and not config_host.has_key('CONFIG_BSD') and not config_host.has_key('CONFIG_SOLARIS')
tap_posix += 'tap-stub.c'
endif
softmmu_ss.add(when: 'CONFIG_POSIX', if_true: files(tap_posix))
softmmu_ss.add(when: 'CONFIG_WIN32', if_true: files('tap-win32.c'))
softmmu_ss.add(when: 'CONFIG_VHOST_NET_VDPA', if_true: files('vhost-vdpa.c'))

subdir('can')

0 comments on commit cdaf072

Please sign in to comment.