1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 BUG_COMPONENT = ('Firefox Build System', 'General')
10 with Files('mozunit/**'):
11 BUG_COMPONENT = ('Testing', 'Python Test')
14 # For sanity's sake, we compile nsinstall without the wrapped system
15 # headers, so that we can use it to set up the wrapped system headers.
18 CONFIGURE_SUBST_FILES += [
19 'tests/src-simple/Makefile',
22 if CONFIG['HOST_OS_ARCH'] != 'WINNT':
27 HostProgram('nsinstall_real')
29 PYTHON_UNITTEST_MANIFESTS += [
33 if CONFIG['CC_TYPE'] in ('clang', 'gcc') and CONFIG['MOZ_OPTIMIZE']:
36 HOST_DEFINES['UNICODE'] = True
37 HOST_DEFINES['_UNICODE'] = True
39 include('stl-headers.mozbuild')
40 if CONFIG['WRAP_STL_INCLUDES']:
42 if CONFIG['OS_TARGET'] == 'WINNT':
48 # Note that the 'stl_wrappers' folder is known to the build system as
49 # containing generated files; if this is changed here then the code in
50 # GeneratedFile.__init__ in python/mozbuild/mozbuild/frontend/data.py
51 # might need to be updated accordingly as well.
52 template_file = SRCDIR + '/%s-stl-wrapper.template.h' % stl_compiler
53 output_dir = '/dist/stl_wrappers'
54 # We have to use a sentinel file as the first file because the
55 # file_generate action will create it for us, but we want to create all
56 # the files in gen_wrappers()
57 outputs = tuple(['stl.sentinel'] + ['%s/%s' % (output_dir, h) for h in stl_headers])
59 *outputs, script='make-stl-wrappers.py', entry_point='gen_wrappers',
60 flags=[TOPOBJDIR + output_dir, stl_compiler, template_file] + stl_headers)
62 # Wrap <windows.h> to make it easier to use correctly
63 # NOTE: If we aren't wrapping STL includes, we're building part of the browser
64 # which won't need this wrapper, such as L10N. Just don't try to generate the
65 # wrapper in that case.
66 if CONFIG['OS_TARGET'] == 'WINNT':
67 GeneratedFile('/dist/stl_wrappers/windows.h',
68 script='make-windows-h-wrapper.py',
69 entry_point='generate',
70 inputs = ['windows-h-constant.decls.h',
71 'windows-h-unicode.decls.h',
72 'windows-h-wrapper.template.h'],
75 if CONFIG['WRAP_SYSTEM_INCLUDES']:
76 include('system-headers.mozbuild')
77 output_dir = '/dist/system_wrappers'
78 outputs = tuple(['system-header.sentinel'] + ['%s/%s' % (output_dir, h) for h in stl_headers + system_headers])
79 GeneratedFile(*outputs, script='make-system-wrappers.py',
80 entry_point='gen_wrappers',
81 flags = [TOPOBJDIR + output_dir] + stl_headers + system_headers)
83 if CONFIG['COMPILE_ENVIRONMENT'] and CONFIG['CBINDGEN']:
85 'cbindgen-metadata.json',
86 script='/build/RunCbindgen.py',
87 entry_point='generate_metadata',
88 inputs=['!/.cargo/config'])