1 # -*- Mode: python; c-basic-offset: 4; 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/.
9 '''Generic template for target binaries. Meant to be used by other
12 if CONFIG['MOZ_LIBSTDCXX_TARGET_VERSION']:
13 USE_LIBS += ['stdc++compat']
15 # Ideally, we'd support not adding this to the LIB_IS_C_ONLY case,
16 # but that variable is actually only set in db/sqlite/src, which
17 # doesn't build a shared library on the relevant platforms anyways.
18 # Eventually, though, we should detect LIB_IS_C_ONLY based on the
19 # associated SOURCES (and there might actually be places where we
20 # haven't set it but should have).
21 if CONFIG['STLPORT_LIBS']:
22 OS_LIBS += [CONFIG['STLPORT_LIBS']]
23 elif CONFIG['OS_TARGET'] == 'Android':
24 USE_LIBS += ['stlport']
29 '''Template for program executables.'''
36 def SimplePrograms(names, ext='.cpp'):
37 '''Template for simple program executables.
39 Those have a single source with the same base name as the executable.
41 SIMPLE_PROGRAMS += names
42 SOURCES += ['%s%s' % (name, ext) for name in names]
48 def CppUnitTests(names, ext='.cpp'):
49 '''Template for C++ unit tests.
51 Those have a single source with the same base name as the executable.
53 CPP_UNIT_TESTS += names
54 SOURCES += ['%s%s' % (name, ext) for name in names]
61 '''Template for libraries.'''
66 def SharedLibrary(name):
67 '''Template for shared libraries.'''
70 FORCE_SHARED_LIB = True
77 '''Template for OSX Frameworks.'''
84 def HostStdCppCompat():
85 '''Template for libstdc++ compatibility for host binaries.'''
87 if CONFIG['MOZ_LIBSTDCXX_HOST_VERSION']:
88 HOST_USE_LIBS += ['host_stdc++compat']
92 def HostProgram(name):
93 '''Template for build tools executables.'''
100 def HostSimplePrograms(names, ext='.cpp'):
101 '''Template for simple build tools executables.
103 Those have a single source with the same base name as the executable.
105 HOST_SIMPLE_PROGRAMS += names
106 HOST_SOURCES += ['%s%s' % (name.replace('host_', ''), ext)
113 def HostLibrary(name):
114 '''Template for build tools libraries.'''
115 HOST_LIBRARY_NAME = name
118 include('gecko_templates.mozbuild')