From 71d754799d31cf03ca37a26fa5067800452e8988 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Wed, 15 Jun 2016 16:52:01 -0700 Subject: [PATCH] Add a build step for the unified headers. Install them to $NDK/sysroot. Bug: https://github.com/android-ndk/ndk/issues/120 Change-Id: I03f989059f1852db9ea69fc9dd9d8556a613320d --- build/lib/build_support.py | 11 ++++++++++- build/tools/package.py | 1 + checkbuild.py | 7 +++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/build/lib/build_support.py b/build/lib/build_support.py index 998709b3..59d2ddd3 100644 --- a/build/lib/build_support.py +++ b/build/lib/build_support.py @@ -269,9 +269,18 @@ def make_package(name, directory, out_dir): os.chdir(os.path.dirname(directory)) basename = os.path.basename(directory) try: + # repo.prop files are excluded because in the event that we have a + # repo.prop in the root of the directory we're packaging, the repo.prop + # file we add later in this function will create a second entry (the + # zip format allows multiple files with the same path). + # + # The one we create here will point back to the tree that was used to + # build the package, and the original repo.prop can be reached from + # there, so no information is lost. subprocess.check_call( ['zip', '-x', '*.pyc', '-x', '*.pyo', '-x', '*.swp', - '-x', '*.git*', '-0qr', path, basename]) + '-x', '*.git*', '-x', os.path.join(basename, 'repo.prop'), '-0qr', + path, basename]) finally: os.chdir(cwd) diff --git a/build/tools/package.py b/build/tools/package.py index 7ffae9e4..dc64fed7 100755 --- a/build/tools/package.py +++ b/build/tools/package.py @@ -102,6 +102,7 @@ def get_all_packages(host, arches): ('shaderc', 'sources/third_party/shaderc'), ('simpleperf', 'simpleperf'), ('stlport', 'sources/cxx-stl/stlport'), + ('sysroot', 'sysroot'), ('system-stl', 'sources/cxx-stl/system'), ('vulkan', 'sources/third_party/vulkan'), ] diff --git a/checkbuild.py b/checkbuild.py index 3a243037..7b1bf91b 100755 --- a/checkbuild.py +++ b/checkbuild.py @@ -61,6 +61,7 @@ 'shader_tools', 'simpleperf', 'stlport', + 'sysroot', 'system-stl', 'vulkan', } @@ -556,6 +557,11 @@ def build_gtest(_, dist_dir, __): build_support.make_package('gtest', path, dist_dir) +def build_sysroot(_out_dir, dist_dir, _args): + path = build_support.android_path('prebuilts/ndk/platform/sysroot') + build_support.make_package('sysroot', path, dist_dir) + + def build_vulkan(out_dir, dist_dir, args): print('Constructing Vulkan validation layer source...') vulkan_root_dir = build_support.android_path( @@ -812,6 +818,7 @@ def main(): ('shader_tools', build_shader_tools), ('simpleperf', build_simpleperf), ('stlport', build_stlport), + ('sysroot', build_sysroot), ('system-stl', build_system_stl), ('vulkan', build_vulkan), ])