mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 00:28:30 -04:00
waf: ignore -Wundef for gtest
The gtest header uses lots of undefined macros, showing lots of warnings if we enable -Wundef. Ideally we could use a #pragma to ignore the warning only from the correct header, but this currently doesn't work with g++ - see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431 So for now we disable the warning completely when compiling gtest or any test that uses its header. Thanks Gustavo Sousa
This commit is contained in:
parent
4ba769d4a3
commit
f0277cecb4
@ -185,6 +185,7 @@ def ap_find_tests(bld, use=[]):
|
|||||||
program_name=f.change_ext('').name,
|
program_name=f.change_ext('').name,
|
||||||
program_group='tests',
|
program_group='tests',
|
||||||
use_legacy_defines=False,
|
use_legacy_defines=False,
|
||||||
|
cxxflags=['-Wno-undef'],
|
||||||
)
|
)
|
||||||
|
|
||||||
@conf
|
@conf
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
gtest is a Waf tool for test builds in Ardupilot
|
gtest is a Waf tool for test builds in Ardupilot
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from waflib import Utils
|
||||||
from waflib.Configure import conf
|
from waflib.Configure import conf
|
||||||
|
|
||||||
def configure(cfg):
|
def configure(cfg):
|
||||||
@ -25,6 +26,7 @@ def configure(cfg):
|
|||||||
|
|
||||||
@conf
|
@conf
|
||||||
def libgtest(bld, **kw):
|
def libgtest(bld, **kw):
|
||||||
|
kw['cxxflags'] = Utils.to_list(kw.get('cxxflags', [])) + ['-Wno-undef']
|
||||||
kw.update(
|
kw.update(
|
||||||
source='modules/gtest/src/gtest-all.cc',
|
source='modules/gtest/src/gtest-all.cc',
|
||||||
target='gtest/gtest',
|
target='gtest/gtest',
|
||||||
|
Loading…
Reference in New Issue
Block a user