X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;ds=sidebyside;f=tools%2Fccanlint%2Fcompulsory_tests%2Fobjects_build.c;h=2132b17388687dfc2e566b4294c17c44cf46957d;hb=8458811a4126c22635b974718bfbf2876c893c37;hp=91bc12ce9b3965a37afa8c327d864d36145e649d;hpb=104125b2dd0a044fb3d68f9bc3b1b18c9f32ae2b;p=ccan diff --git a/tools/ccanlint/compulsory_tests/objects_build.c b/tools/ccanlint/compulsory_tests/objects_build.c index 91bc12ce..2132b173 100644 --- a/tools/ccanlint/compulsory_tests/objects_build.c +++ b/tools/ccanlint/compulsory_tests/objects_build.c @@ -13,6 +13,7 @@ #include #include #include +#include "build.h" static const char *can_build(struct manifest *m) { @@ -21,9 +22,9 @@ static const char *can_build(struct manifest *m) return NULL; } -static void check_objs_build(struct manifest *m, - bool keep, - unsigned int *timeleft, struct score *score) +void build_objects(struct manifest *m, + 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 @@ static void check_objs_build(struct manifest *m, char *output; char *fullfile = talloc_asprintf(m, "%s/%s", m->dir, i->name); - i->compiled = maybe_temp_file(m, "", keep, fullfile); - if (!compile_object(score, fullfile, ccan_dir, compiler, cflags, - i->compiled, &output)) { - talloc_free(i->compiled); + i->compiled[ctype] = maybe_temp_file(m, "", keep, fullfile); + if (!compile_object(score, fullfile, ccan_dir, compiler, flags, + i->compiled[ctype], &output)) { + talloc_free(i->compiled[ctype]); score_file_error(score, i, 0, "Compiling object files:\n%s", output); @@ -60,6 +61,13 @@ static void check_objs_build(struct manifest *m, } } +static void check_objs_build(struct manifest *m, + bool keep, + unsigned int *timeleft, struct score *score) +{ + build_objects(m, keep, score, cflags, COMPILE_NORMAL); +} + struct ccanlint objects_build = { .key = "objects_build", .name = "Module object files can be built",