Skip to content

Commit

Permalink
Add a build step for the unified headers.
Browse files Browse the repository at this point in the history
Install them to $NDK/sysroot.

Bug: android/ndk#120
Change-Id: I03f989059f1852db9ea69fc9dd9d8556a613320d
  • Loading branch information
DanAlbert committed Nov 3, 2016
1 parent 7717150 commit 71d7547
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
11 changes: 10 additions & 1 deletion build/lib/build_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions build/tools/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
]
Expand Down
7 changes: 7 additions & 0 deletions checkbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
'shader_tools',
'simpleperf',
'stlport',
'sysroot',
'system-stl',
'vulkan',
}
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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),
])
Expand Down

0 comments on commit 71d7547

Please sign in to comment.