mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 23:02:20 +00:00
Bug 1059129 - Move the addition of stdc++compat to templates. r=mshal
This commit is contained in:
parent
4b99580194
commit
af78326e62
@ -4,11 +4,21 @@
|
||||
# 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/.
|
||||
|
||||
@template
|
||||
def StdCppCompat():
|
||||
'''Template for libstdc++ compatibility for target binaries.'''
|
||||
|
||||
if CONFIG['MOZ_LIBSTDCXX_TARGET_VERSION']:
|
||||
USE_LIBS += ['stdc++compat']
|
||||
|
||||
|
||||
@template
|
||||
def Program(name):
|
||||
'''Template for program executables.'''
|
||||
PROGRAM = name
|
||||
|
||||
StdCppCompat()
|
||||
|
||||
|
||||
@template
|
||||
def SimplePrograms(names, ext='.cpp'):
|
||||
@ -19,6 +29,8 @@ def SimplePrograms(names, ext='.cpp'):
|
||||
SIMPLE_PROGRAMS += names
|
||||
SOURCES += ['%s%s' % (name, ext) for name in names]
|
||||
|
||||
StdCppCompat()
|
||||
|
||||
|
||||
@template
|
||||
def CppUnitTests(names, ext='.cpp'):
|
||||
@ -29,6 +41,8 @@ def CppUnitTests(names, ext='.cpp'):
|
||||
CPP_UNIT_TESTS += names
|
||||
SOURCES += ['%s%s' % (name, ext) for name in names]
|
||||
|
||||
StdCppCompat()
|
||||
|
||||
|
||||
@template
|
||||
def Library(name):
|
||||
@ -43,20 +57,32 @@ def SharedLibrary(name):
|
||||
|
||||
FORCE_SHARED_LIB = True
|
||||
|
||||
StdCppCompat()
|
||||
|
||||
|
||||
@template
|
||||
def Framework(name):
|
||||
'''Template for OSX Frameworks.'''
|
||||
Library(name)
|
||||
SharedLibrary(name)
|
||||
|
||||
IS_FRAMEWORK = True
|
||||
|
||||
|
||||
@template
|
||||
def HostStdCppCompat():
|
||||
'''Template for libstdc++ compatibility for host binaries.'''
|
||||
|
||||
if CONFIG['MOZ_LIBSTDCXX_HOST_VERSION']:
|
||||
HOST_USE_LIBS += ['host_stdc++compat']
|
||||
|
||||
|
||||
@template
|
||||
def HostProgram(name):
|
||||
'''Template for build tools executables.'''
|
||||
HOST_PROGRAM = name
|
||||
|
||||
HostStdCppCompat()
|
||||
|
||||
|
||||
@template
|
||||
def HostSimplePrograms(names, ext='.cpp'):
|
||||
@ -68,6 +94,8 @@ def HostSimplePrograms(names, ext='.cpp'):
|
||||
HOST_SOURCES += ['%s%s' % (name.replace('host_', ''), ext)
|
||||
for name in names]
|
||||
|
||||
HostStdCppCompat()
|
||||
|
||||
|
||||
@template
|
||||
def HostLibrary(name):
|
||||
@ -95,7 +123,7 @@ def XPCOMBinaryComponent(name):
|
||||
|
||||
name is the name of the component.
|
||||
'''
|
||||
LIBRARY_NAME = name
|
||||
SharedLibrary(name)
|
||||
|
||||
GeckoBinary()
|
||||
|
||||
|
@ -240,17 +240,7 @@ class TreeMetadataEmitter(LoggingMixin):
|
||||
"""Add linkage declarations to a given object."""
|
||||
assert isinstance(obj, Linkable)
|
||||
|
||||
extra = []
|
||||
# Add stdc++compat library when wanted and needed
|
||||
compat_varname = 'MOZ_LIBSTDCXX_%s_VERSION' % obj.KIND.upper()
|
||||
if context.config.substs.get(compat_varname) \
|
||||
and not isinstance(obj, (StaticLibrary, HostLibrary)):
|
||||
extra.append({
|
||||
'target': 'stdc++compat',
|
||||
'host': 'host_stdc++compat',
|
||||
}[obj.KIND])
|
||||
|
||||
for path in context.get(variable, []) + extra:
|
||||
for path in context.get(variable, []):
|
||||
force_static = path.startswith('static:') and obj.KIND == 'target'
|
||||
if force_static:
|
||||
path = path[7:]
|
||||
|
Loading…
Reference in New Issue
Block a user