#define CCANLINT_BUILD_H
char *build_module(struct manifest *m, bool keep, char **errstr);
char *build_submodule(struct manifest *m);
+void build_objects(struct manifest *m,
+ bool keep, struct score *score, const char *flags);
#endif /* CCANLINT_BUILD_H */
#include <err.h>
#include <string.h>
#include <ctype.h>
+#include "build.h"
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)
{
struct ccan_file *i;
bool errors = false, warnings = false;
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,
+ if (!compile_object(score, fullfile, ccan_dir, compiler, flags,
i->compiled, &output)) {
talloc_free(i->compiled);
score_file_error(score, i, 0,
}
}
+static void check_objs_build(struct manifest *m,
+ bool keep,
+ unsigned int *timeleft, struct score *score)
+{
+ build_objects(m, keep, score, cflags);
+}
+
struct ccanlint objects_build = {
.key = "objects_build",
.name = "Module object files can be built",
--- /dev/null
+#include <tools/ccanlint/ccanlint.h>
+#include <ccan/talloc/talloc.h>
+#include "../compulsory_tests/build.h"
+
+static void check_objs_build_without_features(struct manifest *m,
+ bool keep,
+ unsigned int *timeleft,
+ struct score *score)
+{
+ const char *flags = talloc_asprintf(score, "-I. %s", cflags);
+ build_objects(m, keep, score, flags);
+}
+
+struct ccanlint objects_build_without_features = {
+ .key = "objects_build_without_features",
+ .name = "Module object files can be built (without features)",
+ .check = check_objs_build_without_features,
+ .needs = "reduce_features objects_build"
+};
+REGISTER_TEST(objects_build_without_features);
+