[gnome-builder] makecache: handle non-recursive automake for bin_PROGRAMS



commit cb818ac6f7c955d1bb25413c0289ad77c5e1014d
Author: Christian Hergert <christian hergert me>
Date:   Tue Apr 19 14:37:26 2016 -0700

    makecache: handle non-recursive automake for bin_PROGRAMS
    
    The generated stamps look slightly different, so try to detect that and
    base our changes off the right targets.

 plugins/autotools/ide-makecache.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/plugins/autotools/ide-makecache.c b/plugins/autotools/ide-makecache.c
index 331b0d1..2e24597 100644
--- a/plugins/autotools/ide-makecache.c
+++ b/plugins/autotools/ide-makecache.c
@@ -1184,14 +1184,25 @@ ide_makecache_get_file_targets_worker (GTask        *task,
         {
           IdeMakecacheTarget *target = g_ptr_array_index (ret, i);
           const gchar *name = ide_makecache_target_get_target (target);
+          const gchar *slash = strrchr (name, G_DIR_SEPARATOR);
           const gchar *endptr;
 
+          /* We might be using non-recursive automake, which means that the
+           * source is maybe in a subdirectory, but the target is in the
+           * current subdir (so no directory prefix).
+           */
+          if (slash != NULL)
+            name = slash + 1;
+
           if (NULL != (endptr = strchr (name, '-')))
             {
               GString *str = g_string_new (NULL);
 
               g_string_append_len (str, name, endptr - name);
-              g_string_append (str, ".stamp");
+              if (g_str_has_prefix (name, "lib"))
+                g_string_append (str, ".stamp");
+              else
+                g_string_append (str, "_vala.stamp");
               ide_makecache_target_set_target (target, str->str);
               g_string_free (str, TRUE);
             }


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