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']:
41 include('stl-headers.mozbuild')
42 if CONFIG['WRAP_STL_INCLUDES']:
44 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
46 elif CONFIG['CC_TYPE'] == 'clang-cl':
50 # Note that the 'stl_wrappers' folder is known to the build system as
51 # containing generated files; if this is changed here then the code in
52 # GeneratedFile.__init__ in python/mozbuild/mozbuild/frontend/data.py
53 # might need to be updated accordingly as well.
54 template_file = SRCDIR + '/%s-stl-wrapper.template.h' % stl_compiler
55 output_dir = '../dist/stl_wrappers'
56 # We have to use a sentinel file as the first file because the
57 # file_generate action will create it for us, but we want to create all
58 # the files in gen_wrappers()
59 outputs = tuple(['stl.sentinel'] + ['%s/%s' % (output_dir, h) for h in stl_headers])
60 GENERATED_FILES += [outputs]
61 stl = GENERATED_FILES[outputs]
62 stl.script = 'make-stl-wrappers.py:gen_wrappers'
63 stl.flags = [output_dir, stl_compiler, template_file]
64 stl.flags.extend(stl_headers)
66 # Wrap <windows.h> to make it easier to use correctly
67 # NOTE: If we aren't wrapping STL includes, we're building part of the browser
68 # which won't need this wrapper, such as L10N. Just don't try to generate the
69 # wrapper in that case.
70 if CONFIG['OS_ARCH'] == 'WINNT':
71 GENERATED_FILES += ['../dist/stl_wrappers/windows.h']
72 windows_h = GENERATED_FILES['../dist/stl_wrappers/windows.h']
73 windows_h.script = 'make-windows-h-wrapper.py:generate'
74 windows_h.inputs = ['windows-h-constant.decls.h',
75 'windows-h-unicode.decls.h',
76 'windows-h-wrapper.template.h']
77 windows_h.flags = [stl_compiler]
79 if CONFIG['WRAP_SYSTEM_INCLUDES']:
80 include('system-headers.mozbuild')
81 output_dir = '../dist/system_wrappers'
82 outputs = tuple(['system-header.sentinel'] + ['%s/%s' % (output_dir, h) for h in stl_headers + system_headers])
83 GENERATED_FILES += [outputs]
84 system = GENERATED_FILES[outputs]
85 system.script = 'make-system-wrappers.py:gen_wrappers'
86 system.flags = [output_dir]
87 system.flags.extend(stl_headers)
88 system.flags.extend(system_headers)