From 51505a82bb46c4a0beb344f5e2462e60c20a0375 Mon Sep 17 00:00:00 2001 From: Gustavo Jose de Sousa Date: Wed, 27 Jan 2016 11:48:59 +0000 Subject: [PATCH] waf: set variant for all build context classes That way there's no need to manually add a newly defined build context class to the list in the iteration. --- wscript | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wscript b/wscript index 246caf084a..6126048c08 100644 --- a/wscript +++ b/wscript @@ -11,7 +11,8 @@ import ardupilotwaf import boards from waflib import ConfigSet, Utils -from waflib.Build import BuildContext, CleanContext, InstallContext, UninstallContext +from waflib.Build import BuildContext +import waflib.Context # TODO: implement a command 'waf help' that shows the basic tasks a # developer might want to do: e.g. how to configure a board, compile a @@ -34,9 +35,10 @@ def init(ctx): return # define the variant build commands according to the board - for c in (BuildContext, CleanContext, InstallContext, UninstallContext, CheckContext): - class context(c): - variant = env.BOARD + for c in waflib.Context.classes: + if not issubclass(c, BuildContext): + continue + c.variant = env.BOARD def options(opt): opt.load('ardupilotwaf')