mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-21 16:18:29 -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_group='tests',
|
||||
use_legacy_defines=False,
|
||||
cxxflags=['-Wno-undef'],
|
||||
)
|
||||
|
||||
@conf
|
||||
|
@ -5,6 +5,7 @@
|
||||
gtest is a Waf tool for test builds in Ardupilot
|
||||
"""
|
||||
|
||||
from waflib import Utils
|
||||
from waflib.Configure import conf
|
||||
|
||||
def configure(cfg):
|
||||
@ -25,6 +26,7 @@ def configure(cfg):
|
||||
|
||||
@conf
|
||||
def libgtest(bld, **kw):
|
||||
kw['cxxflags'] = Utils.to_list(kw.get('cxxflags', [])) + ['-Wno-undef']
|
||||
kw.update(
|
||||
source='modules/gtest/src/gtest-all.cc',
|
||||
target='gtest/gtest',
|
||||
|
Loading…
Reference in New Issue
Block a user