]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: introduce src directory
authorPavel Hrdina <phrdina@redhat.com>
Tue, 5 May 2020 08:14:34 +0000 (10:14 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:04 +0000 (09:27 +0200)
WARN_FLAGS are not relevant for meson as all warning flags are set to
the whole project using add_project_arguments().

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
meson.build
src/Makefile.am
src/meson.build [new file with mode: 0644]

index c785b12f6c09e953e3311541e19beb8947cb5c4a..71a465806d0577f2bbff3e76bdfa1b60aeed63c4 100644 (file)
@@ -2220,6 +2220,8 @@ subdir('scripts')
 
 subdir('include')
 
+subdir('src')
+
 
 # generate meson-config.h file
 configure_file(output: 'meson-config.h', configuration: conf)
index c3738c87fef5f720b1a4bf0e465b54effcbfe48c..277f4d1e12623ee869116b65c61c50f9d4f3eaac 100644 (file)
 # No libraries with the exception of LIBXML should be listed
 # here. List them against the individual XXX_la_CFLAGS targets
 # that actually use them.
-AM_CPPFLAGS =  -I$(top_srcdir) \
-               -I../include \
-               -I$(top_srcdir)/include \
+AM_CPPFLAGS = \
                -I$(srcdir)/util \
                -I./util \
-               -DIN_LIBVIRT \
-               -Dabs_top_builddir="\"$(abs_top_builddir)\"" \
-               -Dabs_top_srcdir="\"$(abs_top_srcdir)\"" \
                $(NULL)
 
-AM_CFLAGS =    $(LIBXML_CFLAGS) \
-               $(GLIB_CFLAGS) \
-               $(WARN_CFLAGS) \
-               $(WIN32_EXTRA_CFLAGS) \
-               $(COVERAGE_CFLAGS) \
-               $(NULL)
-AM_LDFLAGS =   $(DRIVER_MODULES_LDFLAGS) \
-               $(COVERAGE_LDFLAGS) \
-               $(RELRO_LDFLAGS) \
-               $(NO_INDIRECT_LDFLAGS) \
-               $(MINGW_EXTRA_LDFLAGS) \
-               $(NULL)
 AM_LDFLAGS_MOD = \
        -module \
        -avoid-version \
diff --git a/src/meson.build b/src/meson.build
new file mode 100644 (file)
index 0000000..9f042c9
--- /dev/null
@@ -0,0 +1,25 @@
+src_inc_dir = include_directories('.')
+
+src_dep = declare_dependency(
+  compile_args: [
+    '-DIN_LIBVIRT',
+    '-Dabs_top_builddir="@0@"'.format(meson.build_root()),
+    '-Dabs_top_srcdir="@0@"'.format(meson.source_root()),
+  ] + coverage_flags + win32_flags,
+  dependencies: [
+    glib_dep,
+    libxml_dep,
+  ],
+  include_directories: [
+    libvirt_inc,
+    src_inc_dir,
+    top_inc_dir,
+  ],
+  link_args: (
+    libvirt_relro
+    + libvirt_no_indirect
+    + coverage_flags
+    + driver_modules_flags
+    + win32_link_flags
+  ),
+)