diff --git a/Tools/ardupilotwaf/gtest.py b/Tools/ardupilotwaf/gtest.py index f1a1cd3095..bf4b91372a 100644 --- a/Tools/ardupilotwaf/gtest.py +++ b/Tools/ardupilotwaf/gtest.py @@ -5,6 +5,8 @@ gtest is a Waf tool for test builds in Ardupilot """ +from waflib.Configure import conf + def configure(cfg): cfg.env.HAS_GTEST = False @@ -27,11 +29,13 @@ def configure(cfg): cfg.env.HAS_GTEST = True -def build(bld): - bld.stlib( +@conf +def libgtest(bld, **kw): + kw.update( source='modules/gtest/src/gtest-all.cc', target='gtest/gtest', includes='modules/gtest/ modules/gtest/include', export_includes='modules/gtest/include', name='GTEST', ) + return bld.stlib(**kw) diff --git a/wscript b/wscript index c78a0c854e..61c7152b46 100644 --- a/wscript +++ b/wscript @@ -155,6 +155,8 @@ def _build_common_taskgens(bld): use='mavlink', ) + bld.libgtest() + def _build_recursion(bld): common_dirs_patterns = [ # TODO: Currently each vehicle also generate its own copy of the @@ -203,7 +205,6 @@ def build(bld): bld.post_mode = Build.POST_LAZY bld.load('ardupilotwaf') - bld.load('gtest') _build_cmd_tweaks(bld)