From: Daniel P. Berrangé <[email protected]>

The compiler args are so verbose that CI jobs hit the limit on the
log file size GitLab is willing to capture.

Mitigate this a little bit by removing

  -DIN_LIBVIRT
  -Dabs_top_builddir="..dir.."
  -Dabs_top_srcdir="..dir.."

The last two are already present in the meson-config.h file so
were redundant, and the first is easily added to internal.h.

NB, remote_protocol.x needed special treatment since it is an
exception which (intentionally) does NOT include internal.h
before libvirt/libvirt.h

Signed-off-by: Daniel P. Berrangé <[email protected]>
---
 src/internal.h               | 2 ++
 src/meson.build              | 6 +-----
 src/remote/remote_protocol.x | 1 +
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/internal.h b/src/internal.h
index 8200480394..df311551a4 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -29,6 +29,8 @@
 #include <stdlib.h>
 #include "glibcompat.h"
 
+#define IN_LIBVIRT
+
 #if defined __clang_analyzer__ || defined __COVERITY__
 # define STATIC_ANALYSIS 1
 #endif
diff --git a/src/meson.build b/src/meson.build
index 47c978cc1f..16875622f4 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,11 +1,7 @@
 src_inc_dir = include_directories('.')
 
 src_dep = declare_dependency(
-  compile_args: [
-    '-DIN_LIBVIRT',
-    '-Dabs_top_builddir="@0@"'.format(meson.project_build_root()),
-    '-Dabs_top_srcdir="@0@"'.format(meson.project_source_root()),
-  ] + coverage_flags + win32_flags,
+  compile_args: coverage_flags + win32_flags,
   dependencies: [
     glib_dep,
     libxml_dep,
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index 3c93203210..38a83c64ea 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -34,6 +34,7 @@
  * 'REMOTE_'.  This makes names quite long.
  */
 
+%#define IN_LIBVIRT
 %#include <libvirt/libvirt.h>
 %#include "internal.h"
 %#include "virxdrdefs.h"
-- 
2.52.0

Reply via email to