[gnome-builder] compile-commands: check for -isystem and -include



commit eeacb34705b6df4818a84783f75db71ce65952ee
Author: Christian Hergert <chergert redhat com>
Date:   Tue Oct 17 02:05:44 2017 -0700

    compile-commands: check for -isystem and -include
    
    This adds fallback checks for the -include and -isystem $CC
    command line options.

 src/libide/buildsystem/ide-compile-commands.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/libide/buildsystem/ide-compile-commands.c b/src/libide/buildsystem/ide-compile-commands.c
index e55e6f8..e9224d2 100644
--- a/src/libide/buildsystem/ide-compile-commands.c
+++ b/src/libide/buildsystem/ide-compile-commands.c
@@ -496,8 +496,16 @@ ide_compile_commands_filter_c (IdeCompileCommands   *self,
           break;
 
         default:
-          if (g_str_has_prefix (param, "-std="))
-            g_ptr_array_add (ar, g_strdup (param));
+          if (g_str_has_prefix (param, "-std=") ||
+              g_str_has_prefix (param, "-isystem"))
+            {
+              g_ptr_array_add (ar, g_strdup (param));
+            }
+          else if (next != NULL && ide_str_equal0 (param, "-include"))
+            {
+              g_ptr_array_add (ar, g_strdup (param));
+              g_ptr_array_add (ar, g_strdup (next));
+            }
           break;
         }
     }


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