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.
This commit is contained in:
Gustavo Jose de Sousa 2016-01-27 11:48:59 +00:00 committed by Lucas De Marchi
parent 5699bf04d0
commit 51505a82bb
1 changed files with 6 additions and 4 deletions

10
wscript
View File

@ -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')