[gnome-builder] gdb: use static library for gdbwire with alternate cflags



commit f284e555161e206022fbf65d1a7618d1589cdf0e
Author: Christian Hergert <chergert redhat com>
Date:   Mon Sep 25 14:33:17 2017 -0700

    gdb: use static library for gdbwire with alternate cflags
    
    If we build the gdbwire amalgamation as a separate static library then we
    can alter the CFLAGS that are used to compile it. Given that it is an
    amalgamation and is C89-based rather than C11, this allows us to squash
    some warnings that are unhelpful.
    
    We link the library with libgnome-builder-plugins.so so the end effect
    should be identical to what we had before.

 src/plugins/gdb/gbp-gdb-debugger.c |    5 -----
 src/plugins/gdb/gbp-gdb-debugger.h |    3 +++
 src/plugins/gdb/meson.build        |    9 +++++++--
 3 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/src/plugins/gdb/gbp-gdb-debugger.c b/src/plugins/gdb/gbp-gdb-debugger.c
index 6dc6fa6..e03f150 100644
--- a/src/plugins/gdb/gbp-gdb-debugger.c
+++ b/src/plugins/gdb/gbp-gdb-debugger.c
@@ -21,11 +21,6 @@
 #include <dazzle.h>
 #include <string.h>
 
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wredundant-decls"
-#include "gdbwire.h"
-#pragma GCC diagnostic pop
-
 #include "gbp-gdb-debugger.h"
 
 #define READ_BUFFER_LEN 4096
diff --git a/src/plugins/gdb/gbp-gdb-debugger.h b/src/plugins/gdb/gbp-gdb-debugger.h
index a8259a8..8a60b9c 100644
--- a/src/plugins/gdb/gbp-gdb-debugger.h
+++ b/src/plugins/gdb/gbp-gdb-debugger.h
@@ -20,7 +20,10 @@
 
 #include <ide.h>
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wredundant-decls"
 #include "gdbwire.h"
+#pragma GCC diagnostic pop
 
 G_BEGIN_DECLS
 
diff --git a/src/plugins/gdb/meson.build b/src/plugins/gdb/meson.build
index f7d044e..96ecb74 100644
--- a/src/plugins/gdb/meson.build
+++ b/src/plugins/gdb/meson.build
@@ -10,11 +10,16 @@ gdb_sources = [
   'gbp-gdb-debugger.c',
   'gbp-gdb-debugger.h',
   'gbp-gdb-plugin.c',
-  'gdbwire.c',
-  'gdbwire.h',
 ]
 
+gdbwire = static_library('gdbwire', ['gdbwire.c'],
+  c_args: [ '-Wno-redundant-decls',
+            '-Wno-switch-default',
+            '-Wno-declaration-after-statement' ],
+)
+
 gnome_builder_plugins_sources += files(gdb_sources)
 gnome_builder_plugins_sources += gdb_resources[0]
+gnome_builder_plugins_link_with += gdbwire
 
 endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]