waf: only apply gsoap specific flags to gsoap sources

This commit is contained in:
Siddharth Purohit 2021-06-26 21:17:53 +05:30 committed by Andrew Tridgell
parent 51b86b5acc
commit 51a6d3c16a
2 changed files with 22 additions and 9 deletions

View File

@ -248,6 +248,25 @@ def double_precision_check(tasks):
t.env.CXXFLAGS.append("-DALLOW_DOUBLE_MATH_FUNCTIONS")
def gsoap_library_check(bld, tasks):
'''check for tasks marked as gSOAP library source'''
for t in tasks:
if len(t.inputs) == 1:
gsoap_tasks = []
for s in t.env.AP_LIB_EXTRA_SOURCES["AP_ONVIF"]:
gsoap_tasks.append(bld.bldnode.find_or_declare(os.path.join('libraries', "AP_ONVIF", s)))
if t.inputs[0] in gsoap_tasks:
t.env.CXXFLAGS += [
'-Wno-shadow',
]
if 'clang++' not in t.env.COMPILER_CXX:
t.env.CXXFLAGS += [
'-Wno-suggest-override',
]
@feature('ap_library_object')
@after_method('process_source')
def ap_library_register_for_check(self):
@ -255,6 +274,8 @@ def ap_library_register_for_check(self):
return
double_precision_check(self.compiled_tasks)
if self.env.ENABLE_ONVIF:
gsoap_library_check(self.bld, self.compiled_tasks)
if not self.env.ENABLE_HEADER_CHECKS:
return

View File

@ -81,14 +81,6 @@ class Board:
env.AP_LIBRARIES += [
'AP_ONVIF'
]
env.CXXFLAGS += [
'-Wno-shadow',
'-Wno-undef',
]
if 'clang++' not in cfg.env.COMPILER_CXX:
env.CXXFLAGS += [
'-Wno-suggest-override',
]
else:
env.ENABLE_ONVIF = False
env.DEFINES.update(