mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 07:13: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
|
# 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/.
|
# 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
|
@template
|
||||||
def Program(name):
|
def Program(name):
|
||||||
'''Template for program executables.'''
|
'''Template for program executables.'''
|
||||||
PROGRAM = name
|
PROGRAM = name
|
||||||
|
|
||||||
|
StdCppCompat()
|
||||||
|
|
||||||
|
|
||||||
@template
|
@template
|
||||||
def SimplePrograms(names, ext='.cpp'):
|
def SimplePrograms(names, ext='.cpp'):
|
||||||
@ -19,6 +29,8 @@ def SimplePrograms(names, ext='.cpp'):
|
|||||||
SIMPLE_PROGRAMS += names
|
SIMPLE_PROGRAMS += names
|
||||||
SOURCES += ['%s%s' % (name, ext) for name in names]
|
SOURCES += ['%s%s' % (name, ext) for name in names]
|
||||||
|
|
||||||
|
StdCppCompat()
|
||||||
|
|
||||||
|
|
||||||
@template
|
@template
|
||||||
def CppUnitTests(names, ext='.cpp'):
|
def CppUnitTests(names, ext='.cpp'):
|
||||||
@ -29,6 +41,8 @@ def CppUnitTests(names, ext='.cpp'):
|
|||||||
CPP_UNIT_TESTS += names
|
CPP_UNIT_TESTS += names
|
||||||
SOURCES += ['%s%s' % (name, ext) for name in names]
|
SOURCES += ['%s%s' % (name, ext) for name in names]
|
||||||
|
|
||||||
|
StdCppCompat()
|
||||||
|
|
||||||
|
|
||||||
@template
|
@template
|
||||||
def Library(name):
|
def Library(name):
|
||||||
@ -43,20 +57,32 @@ def SharedLibrary(name):
|
|||||||
|
|
||||||
FORCE_SHARED_LIB = True
|
FORCE_SHARED_LIB = True
|
||||||
|
|
||||||
|
StdCppCompat()
|
||||||
|
|
||||||
|
|
||||||
@template
|
@template
|
||||||
def Framework(name):
|
def Framework(name):
|
||||||
'''Template for OSX Frameworks.'''
|
'''Template for OSX Frameworks.'''
|
||||||
Library(name)
|
SharedLibrary(name)
|
||||||
|
|
||||||
IS_FRAMEWORK = True
|
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
|
@template
|
||||||
def HostProgram(name):
|
def HostProgram(name):
|
||||||
'''Template for build tools executables.'''
|
'''Template for build tools executables.'''
|
||||||
HOST_PROGRAM = name
|
HOST_PROGRAM = name
|
||||||
|
|
||||||
|
HostStdCppCompat()
|
||||||
|
|
||||||
|
|
||||||
@template
|
@template
|
||||||
def HostSimplePrograms(names, ext='.cpp'):
|
def HostSimplePrograms(names, ext='.cpp'):
|
||||||
@ -68,6 +94,8 @@ def HostSimplePrograms(names, ext='.cpp'):
|
|||||||
HOST_SOURCES += ['%s%s' % (name.replace('host_', ''), ext)
|
HOST_SOURCES += ['%s%s' % (name.replace('host_', ''), ext)
|
||||||
for name in names]
|
for name in names]
|
||||||
|
|
||||||
|
HostStdCppCompat()
|
||||||
|
|
||||||
|
|
||||||
@template
|
@template
|
||||||
def HostLibrary(name):
|
def HostLibrary(name):
|
||||||
@ -95,7 +123,7 @@ def XPCOMBinaryComponent(name):
|
|||||||
|
|
||||||
name is the name of the component.
|
name is the name of the component.
|
||||||
'''
|
'''
|
||||||
LIBRARY_NAME = name
|
SharedLibrary(name)
|
||||||
|
|
||||||
GeckoBinary()
|
GeckoBinary()
|
||||||
|
|
||||||
|
@ -240,17 +240,7 @@ class TreeMetadataEmitter(LoggingMixin):
|
|||||||
"""Add linkage declarations to a given object."""
|
"""Add linkage declarations to a given object."""
|
||||||
assert isinstance(obj, Linkable)
|
assert isinstance(obj, Linkable)
|
||||||
|
|
||||||
extra = []
|
for path in context.get(variable, []):
|
||||||
# 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:
|
|
||||||
force_static = path.startswith('static:') and obj.KIND == 'target'
|
force_static = path.startswith('static:') and obj.KIND == 'target'
|
||||||
if force_static:
|
if force_static:
|
||||||
path = path[7:]
|
path = path[7:]
|
||||||
|
Loading…
Reference in New Issue
Block a user