2016-01-18 12:46:51 -04:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# encoding: utf-8
|
|
|
|
|
|
|
|
"""
|
|
|
|
gtest is a Waf tool for test builds in Ardupilot
|
|
|
|
"""
|
|
|
|
|
2016-02-05 08:59:13 -04:00
|
|
|
from waflib.Configure import conf
|
|
|
|
|
2016-01-18 12:46:51 -04:00
|
|
|
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
|
|
|
|
|
2016-02-05 12:09:21 -04:00
|
|
|
cfg.env.append_value('GIT_SUBMODULES', 'gtest')
|
2016-01-18 12:46:51 -04:00
|
|
|
cfg.env.HAS_GTEST = True
|
|
|
|
|
2016-02-05 08:59:13 -04:00
|
|
|
@conf
|
|
|
|
def libgtest(bld, **kw):
|
|
|
|
kw.update(
|
2016-01-18 12:46:51 -04:00
|
|
|
source='modules/gtest/src/gtest-all.cc',
|
|
|
|
target='gtest/gtest',
|
|
|
|
includes='modules/gtest/ modules/gtest/include',
|
|
|
|
export_includes='modules/gtest/include',
|
|
|
|
name='GTEST',
|
|
|
|
)
|
2016-02-05 08:59:13 -04:00
|
|
|
return bld.stlib(**kw)
|