mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-17 23:57:59 +01:00
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:
parent
cf0ffb8498
commit
ac086af9d8
2 changed files with 6 additions and 1 deletions
|
@ -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 matches a block of sources inside a GN target.
|
||||||
SOURCES_RE = re.compile(
|
SOURCES_RE = re.compile(
|
||||||
r'(sources|common_objc_headers) \+?= \[(?P<sources>.*?)\]',
|
r'(sources|public|common_objc_headers) \+?= \[(?P<sources>.*?)\]',
|
||||||
re.MULTILINE | re.DOTALL)
|
re.MULTILINE | re.DOTALL)
|
||||||
|
|
||||||
SOURCE_FILE_RE = re.compile(r'.*\"(?P<source_file>.*)\"')
|
SOURCE_FILE_RE = re.compile(r'.*\"(?P<source_file>.*)\"')
|
||||||
|
|
|
@ -92,6 +92,10 @@ class GetHeadersInBuildGnFileSourcesTest(unittest.TestCase):
|
||||||
deps = [":bar"]
|
deps = [":bar"]
|
||||||
}
|
}
|
||||||
rtc_static_library("bar") {
|
rtc_static_library("bar") {
|
||||||
|
# Public headers should also be included.
|
||||||
|
public = [
|
||||||
|
"public_foo.h",
|
||||||
|
]
|
||||||
sources = [
|
sources = [
|
||||||
"bar.h",
|
"bar.h",
|
||||||
"bar.cc",
|
"bar.cc",
|
||||||
|
@ -107,6 +111,7 @@ class GetHeadersInBuildGnFileSourcesTest(unittest.TestCase):
|
||||||
set([
|
set([
|
||||||
_GetPath('a', 'b', 'foo.h'),
|
_GetPath('a', 'b', 'foo.h'),
|
||||||
_GetPath('a', 'b', 'bar.h'),
|
_GetPath('a', 'b', 'bar.h'),
|
||||||
|
_GetPath('a', 'b', 'public_foo.h'),
|
||||||
_GetPath('a', 'b', 'baz', 'foo.h'),
|
_GetPath('a', 'b', 'baz', 'foo.h'),
|
||||||
]),
|
]),
|
||||||
check_orphan_headers.GetHeadersInBuildGnFileSources(file_content,
|
check_orphan_headers.GetHeadersInBuildGnFileSources(file_content,
|
||||||
|
|
Loading…
Reference in a new issue