ardupilot/Tools/ardupilotwaf/gtest.py
Gustavo Jose de Sousa 8655fdfd7f waf: use git_submodule tool through GIT_SUBMODULES variable
With this change, there's no need to verify if the submodule is initialized,
because the submodules in GIT_SUBMODULES are automatically initialized and
updated if necessary before the build tasks are performed.

One downside of this change is that Google Benchmark configuration is now done
only during build. However that is minor, since now there are easy ways to
separately build different targets and program groups, so that a fail in
benchmark build doesn't really affect the other targets.
2016-02-06 10:25:08 -02:00

36 lines
827 B
Python

#!/usr/bin/env python
# encoding: utf-8
"""
gtest is a Waf tool for test builds in Ardupilot
"""
from waflib.Configure import conf
def configure(cfg):
cfg.env.HAS_GTEST = False
if cfg.env.STATIC_LINKING:
# gtest uses a function (getaddrinfo) that is supposed to be linked
# dynamically
cfg.msg(
'Gtest',
'statically linked tests not supported',
color='YELLOW',
)
return
cfg.env.append_value('GIT_SUBMODULES', 'gtest')
cfg.env.HAS_GTEST = True
@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)