diff options
author | Jack Lloyd <[email protected]> | 2016-08-12 15:45:19 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-08-12 15:45:19 -0400 |
commit | 2e485c37d1565dff665d06cfaa27b22050f4533b (patch) | |
tree | 840efd65f078bde9153d2675c00289a462f717ba | |
parent | bb846addf84c747f9431da3e47361dd750b6a9a7 (diff) |
Make the header intersect checks a little more succint.
Make an invalid config (conflicting header types) a hard error, and stop the build.
-rwxr-xr-x | configure.py | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/configure.py b/configure.py index 419c733c9..e7e61cab1 100755 --- a/configure.py +++ b/configure.py @@ -658,21 +658,14 @@ class ModuleInfo(object): else: self.warning = None - intersection = set.intersection(set(self.header_public), set(self.header_internal), set(self.header_external)) - if len(intersection) > 0: - logging.warning('Headers %s marked public, internal and external' % (' '.join(intersection))) - else: - intersection = set.intersection(set(self.header_public), set(self.header_internal)) - if len(intersection) > 0: - logging.warning('Headers %s marked both public and internal' % (' '.join(intersection))) - - intersection = set.intersection(set(self.header_public), set(self.header_external)) - if len(intersection) > 0: - logging.warning('Headers %s marked both public and external' % (' '.join(intersection))) - - intersection = set.intersection(set(self.header_external), set(self.header_internal)) - if len(intersection) > 0: - logging.warning('Headers %s marked both external and internal' % (' '.join(intersection))) + def intersect_check(typeA, listA, typeB, listB): + intersection = set.intersection(set(listA), set(listB)) + if len(intersection) > 0: + logging.error('Headers %s marked both %s and %s' % (' '.join(intersection), typeA, typeB)) + + intersect_check('public', self.header_public, 'internal', self.header_internal) + intersect_check('public', self.header_public, 'external', self.header_external) + intersect_check('external', self.header_external, 'internal', self.header_internal) def sources(self): return self.source |