[build] Fix filter script for official build
This also adds libraries recursively under the obj dir. Dropping v8_shell from globs since it's not included in the targets. NOTRY=true Bug: v8:5918 Change-Id: Ibfadb60dd7b347cf4a742f07e8b110c70e67cb06 Reviewed-on: https://chromium-review.googlesource.com/544308 Commit-Queue: Michael Achenbach <machenbach@chromium.org> Reviewed-by: Daniel Vogelheim <vogelheim@chromium.org> Cr-Commit-Position: refs/heads/master@{#46161}
This commit is contained in:
parent
e9e2e13328
commit
c535258aab
@ -21,12 +21,11 @@ import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
EXECUTABLES = [
|
||||
EXECUTABLE_FILES = [
|
||||
'd8',
|
||||
'v8_hello_world',
|
||||
'v8_parser_shell',
|
||||
'v8_sample_process',
|
||||
'v8_shell',
|
||||
]
|
||||
|
||||
SUPPLEMENTARY_FILES = [
|
||||
@ -36,10 +35,10 @@ SUPPLEMENTARY_FILES = [
|
||||
'v8_build_config.json',
|
||||
]
|
||||
|
||||
LIBS = {
|
||||
'linux': ['*.a', '*.so', 'obj/*.a', 'obj/*.so'],
|
||||
'mac': ['*.a', '*.so', 'obj/*.a', 'obj/*.so'],
|
||||
'win': ['*.lib', '*.dll', 'obj\\*.a', 'obj\\*.so'],
|
||||
LIBRARY_FILES = {
|
||||
'linux': ['*.a', '*.so'],
|
||||
'mac': ['*.a', '*.so'],
|
||||
'win': ['*.lib', '*.dll'],
|
||||
}
|
||||
|
||||
|
||||
@ -60,17 +59,28 @@ def main(argv):
|
||||
|
||||
args.dir = os.path.abspath(args.dir)
|
||||
|
||||
extended_executables = [
|
||||
f + '.exe' if args.platform == 'win' else f
|
||||
for f in EXECUTABLES]
|
||||
list_of_files = []
|
||||
def add_files_from_globs(globs):
|
||||
list_of_files.extend(itertools.chain(*map(glob.iglob, globs)))
|
||||
|
||||
all_globs = [
|
||||
os.path.join(args.dir, f)
|
||||
for f in extended_executables + SUPPLEMENTARY_FILES + LIBS[args.platform]
|
||||
]
|
||||
# Add toplevel executables, supplementary files and libraries.
|
||||
extended_executable_files = [
|
||||
f + '.exe' if args.platform == 'win' else f
|
||||
for f in EXECUTABLE_FILES]
|
||||
add_files_from_globs(
|
||||
os.path.join(args.dir, f)
|
||||
for f in extended_executable_files +
|
||||
SUPPLEMENTARY_FILES +
|
||||
LIBRARY_FILES[args.platform]
|
||||
)
|
||||
|
||||
# Add libraries recursively from obj directory.
|
||||
for root, _, __ in os.walk(os.path.join(args.dir, 'obj'), followlinks=True):
|
||||
add_files_from_globs(
|
||||
os.path.join(root, g) for g in LIBRARY_FILES[args.platform])
|
||||
|
||||
with open(args.json_output, 'w') as f:
|
||||
json.dump(list(itertools.chain(*map(glob.iglob, all_globs))), f)
|
||||
json.dump(list_of_files, f)
|
||||
|
||||
return 0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user