Bug 1078122 part 4 - Make the mSource and mTimeline members of AnimationPlayer protec...
[gecko.git] / build / templates.mozbuild
blobbfc67c80c42895726a9a75d8e35d0749fc0874cb
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/.
7 @template
8 def StdCppCompat():
9     '''Template for libstdc++ compatibility for target binaries.'''
11     if CONFIG['MOZ_LIBSTDCXX_TARGET_VERSION']:
12         USE_LIBS += ['stdc++compat']
15 @template
16 def Program(name):
17     '''Template for program executables.'''
18     PROGRAM = name
20     StdCppCompat()
23 @template
24 def SimplePrograms(names, ext='.cpp'):
25     '''Template for simple program executables.
27     Those have a single source with the same base name as the executable.
28     '''
29     SIMPLE_PROGRAMS += names
30     SOURCES += ['%s%s' % (name, ext) for name in names]
32     StdCppCompat()
35 @template
36 def CppUnitTests(names, ext='.cpp'):
37     '''Template for C++ unit tests.
39     Those have a single source with the same base name as the executable.
40     '''
41     CPP_UNIT_TESTS += names
42     SOURCES += ['%s%s' % (name, ext) for name in names]
44     StdCppCompat()
47 @template
48 def Library(name):
49     '''Template for libraries.'''
50     LIBRARY_NAME = name
53 @template
54 def SharedLibrary(name):
55     '''Template for shared libraries.'''
56     Library(name)
58     FORCE_SHARED_LIB = True
60     StdCppCompat()
63 @template
64 def Framework(name):
65     '''Template for OSX Frameworks.'''
66     SharedLibrary(name)
68     IS_FRAMEWORK = True
71 @template
72 def HostStdCppCompat():
73     '''Template for libstdc++ compatibility for host binaries.'''
75     if CONFIG['MOZ_LIBSTDCXX_HOST_VERSION']:
76         HOST_USE_LIBS += ['host_stdc++compat']
79 @template
80 def HostProgram(name):
81     '''Template for build tools executables.'''
82     HOST_PROGRAM = name
84     HostStdCppCompat()
87 @template
88 def HostSimplePrograms(names, ext='.cpp'):
89     '''Template for simple build tools executables.
91     Those have a single source with the same base name as the executable.
92     '''
93     HOST_SIMPLE_PROGRAMS += names
94     HOST_SOURCES += ['%s%s' % (name.replace('host_', ''), ext)
95         for name in names]
97     HostStdCppCompat()
100 @template
101 def HostLibrary(name):
102     '''Template for build tools libraries.'''
103     HOST_LIBRARY_NAME = name
106 @template
107 def GeckoBinary():
108     '''Template for binaries using Gecko.
110     This template is meant to be used in other templates.
111     '''
112     USE_LIBS += [
113         'mozalloc',
114         'nspr',
115         'xpcomglue_s',
116         'xul',
117     ]
120 @template
121 def XPCOMBinaryComponent(name):
122     '''Template defining an XPCOM binary component for Gecko.
124     name is the name of the component.
125     '''
126     SharedLibrary(name)
128     GeckoBinary()
130     IS_COMPONENT = True