]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/compulsory_tests/objects_build.c
ccanlint: keep separate array of compiled versions.
[ccan] / tools / ccanlint / compulsory_tests / objects_build.c
index 46fdbd4592ea5561ad350ac9ca3571de297b44b0..2132b17388687dfc2e566b4294c17c44cf46957d 100644 (file)
@@ -23,7 +23,8 @@ static const char *can_build(struct manifest *m)
 }
 
 void build_objects(struct manifest *m,
-                  bool keep, struct score *score, const char *flags)
+                  bool keep, struct score *score, const char *flags,
+                  enum compile_type ctype)
 {
        struct ccan_file *i;
        bool errors = false, warnings = false;
@@ -37,10 +38,10 @@ void build_objects(struct manifest *m,
                char *output;
                char *fullfile = talloc_asprintf(m, "%s/%s", m->dir, i->name);
 
-               i->compiled = maybe_temp_file(m, "", keep, fullfile);
+               i->compiled[ctype] = maybe_temp_file(m, "", keep, fullfile);
                if (!compile_object(score, fullfile, ccan_dir, compiler, flags,
-                                   i->compiled, &output)) {
-                       talloc_free(i->compiled);
+                                   i->compiled[ctype], &output)) {
+                       talloc_free(i->compiled[ctype]);
                        score_file_error(score, i, 0,
                                         "Compiling object files:\n%s",
                                         output);
@@ -64,7 +65,7 @@ static void check_objs_build(struct manifest *m,
                             bool keep,
                             unsigned int *timeleft, struct score *score)
 {
-       build_objects(m, keep, score, cflags);
+       build_objects(m, keep, score, cflags, COMPILE_NORMAL);
 }
 
 struct ccanlint objects_build = {