Quelle generate_sources_mozbuild.py
Sprache: Python
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import cmakeparser as cp
import copy import datetime import os import re import subprocess
with open(os.path.join(outdir, 'aom_config.h'), 'w') as f:
header = variables['h_file_header_block']
f.write(header)
f.write('\n') for var in cache_variables:
f.write('#define %s %s\n' % (var, variables[var]))
f.write('#endif /* AOM_CONFIG_H_ */\n')
with open(os.path.join(outdir, 'aom_config.asm'), 'w') as f:
header = variables['asm_file_header_block']
f.write(header)
f.write('\n') for var in cache_variables: if var in ['INCLUDE_INSTALL_DIR', 'INLINE', 'LIB_INSTALL_DIR', 'RESTRICT']: continue if arch == 'arm':
f.write('.equ %s, %s\n' % (var, variables[var])) else:
f.write('%s equ %s\n' % (var, variables[var]))
if arch == 'arm':
f.write('.section .note.GNU-stack,"",%progbits')
# We skip compiling test programs that detect these
variables['HAVE_FEXCEPT'] = 1
variables['INLINE'] = 'inline' if cpu == 'x86'and system == 'linux':
variables['CONFIG_PIC'] = 1 if cpu == 'armv7':
variables['CONFIG_PIC'] = 1 if system == 'win':
variables['MSVC'] = 1
# Windows x86_64 needs this -- all other source files are shared # between OSes if cpu == 'x86_64'and system == 'win':
f.write(' \'X64_WIN_SOURCES\': [\n')
f.write(' \'%s\',\n' % variables['AOM_PORTS_ASM_X86'])
f.write(" ],\n")
# Currently, the sources are the same for each supported cpu # regardless of operating system / compiler. If that changes, we'll # have to generate sources for each combination. if generate_sources: # Remove spurious sources and perl files
sources = list(filter(lambda x: x.startswith(AOM_DIR), sources))
sources = list(filter(lambda x: not x.endswith('.pl'), sources))
# Filter out exports
exports = list(filter(lambda x: re.match(os.path.join(AOM_DIR, '(aom|aom_mem|aom_ports|aom_scale)/.*h$'), x), sources))
exports = list(filter(lambda x: not re.search('(internal|src)', x), exports))
exports = list(filter(lambda x: not re.search('(emmintrin_compat.h|mem_.*|msvc.h|aom_once.h)$', x), exports))
sources = list(sources)
for export in exports: if export in sources:
sources.remove(export)
# Remove header and .inc files
sources = sorted(filter(lambda x: not x.endswith('.h'), sources))
sources = sorted(filter(lambda x: not x.endswith('.inc'), sources))
# The build system is unhappy if two files have the same prefix # In libaom, sometimes .asm and .c files share the same prefix for i in range(len(sources) - 1): if sources[i].endswith('.asm'): if os.path.splitext(sources[i])[0] == os.path.splitext(sources[i + 1])[0]:
old = sources[i]
sources[i] = sources[i].replace('.asm', '_asm.asm') ifnot os.path.exists(sources[i]):
os.rename(old, sources[i])
f.write(' \'%s_EXPORTS\': [\n' % arch.upper()) for export in sorted(exports):
f.write(' \'%s\',\n' % export)
f.write(" ],\n")
f.write(' \'%s_SOURCES\': [\n' % arch.upper()) for source in sorted(sources):
f.write(' \'%s\',\n' % source)
f.write(' ],\n')
print('\n')
f.write('}\n')
f.close()
Messung V0.5
¤ Dauer der Verarbeitung: 0.0 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.