Make orphan check understand public headers.

Bug: webrtc:8277
Change-Id: Id3450185f1bf9e78e4dac10cf4df217f35e02514
Reviewed-on: https://webrtc-review.googlesource.com/4723
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20061}
This commit is contained in:
Patrik Höglund 2017-09-29 16:07:49 +02:00 committed by Commit Bot
parent cf0ffb8498
commit ac086af9d8
2 changed files with 6 additions and 1 deletions

View file

@ -20,7 +20,7 @@ TARGET_RE = re.compile(r'(?P<indent>\s*)\w+\("(?P<target_name>\w+)"\) {'
# SOURCES_RE matches a block of sources inside a GN target.
SOURCES_RE = re.compile(
r'(sources|common_objc_headers) \+?= \[(?P<sources>.*?)\]',
r'(sources|public|common_objc_headers) \+?= \[(?P<sources>.*?)\]',
re.MULTILINE | re.DOTALL)
SOURCE_FILE_RE = re.compile(r'.*\"(?P<source_file>.*)\"')

View file

@ -92,6 +92,10 @@ class GetHeadersInBuildGnFileSourcesTest(unittest.TestCase):
deps = [":bar"]
}
rtc_static_library("bar") {
# Public headers should also be included.
public = [
"public_foo.h",
]
sources = [
"bar.h",
"bar.cc",
@ -107,6 +111,7 @@ class GetHeadersInBuildGnFileSourcesTest(unittest.TestCase):
set([
_GetPath('a', 'b', 'foo.h'),
_GetPath('a', 'b', 'bar.h'),
_GetPath('a', 'b', 'public_foo.h'),
_GetPath('a', 'b', 'baz', 'foo.h'),
]),
check_orphan_headers.GetHeadersInBuildGnFileSources(file_content,