From 300cb2fe8721130f9f90cf3941cba8b9c10a71f1 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Fri, 4 Nov 2016 14:52:30 -0700 Subject: [PATCH] Support a "platform-only" version tag. We tried to support this by version name convention (foo_PLATFORM and foo_PRIVATE), but not everything follows those conventions. libm has a LIBC_DEPRECATED, which is a bit to generic to apply this convention to. Support a "platform-only" tag which omits the tagged version in the NDK. Test: nose2 Bug: None Change-Id: Iba34628ea02a813d22c8b32d10e54064f17ac6df --- cc/gen_stub_libs.py | 2 ++ cc/test_gen_stub_libs.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/cc/gen_stub_libs.py b/cc/gen_stub_libs.py index 9b40415d5..2db8312e0 100755 --- a/cc/gen_stub_libs.py +++ b/cc/gen_stub_libs.py @@ -69,6 +69,8 @@ def should_omit_version(name, tags, arch, api): """ if version_is_private(name): return True + if 'platform-only' in tags: + return True if not symbol_in_arch(tags, arch): return True if not symbol_in_api(tags, arch, api): diff --git a/cc/test_gen_stub_libs.py b/cc/test_gen_stub_libs.py index 8436a4804..2c79ded5b 100755 --- a/cc/test_gen_stub_libs.py +++ b/cc/test_gen_stub_libs.py @@ -110,6 +110,9 @@ class OmitVersionTest(unittest.TestCase): self.assertTrue(gsl.should_omit_version('foo_PRIVATE', [], 'arm', 9)) self.assertTrue(gsl.should_omit_version('foo_PLATFORM', [], 'arm', 9)) + self.assertTrue(gsl.should_omit_version( + 'foo', ['platform-only'], 'arm', 9)) + def test_omit_arch(self): self.assertFalse(gsl.should_omit_version('foo', [], 'arm', 9)) self.assertFalse(gsl.should_omit_version('foo', ['arm'], 'arm', 9))