зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1399870 - make DEFFILE a Path instead of a string; r=gps
All but one of the current uses of DEFFILE use `SRCDIR + '/file.def'` to get a srcdir-relative path anyway, and the other one wants an objdir-relative path, so using Path makes everything clearer. This makes it more straightforward to translate the paths for the WSL build.
This commit is contained in:
Родитель
9d365405a5
Коммит
de99592416
|
@ -8,7 +8,7 @@ GeckoSharedLibrary('IA2Marshal', linkage=None)
|
|||
|
||||
DEFINES['REGISTER_PROXY_DLL'] = True
|
||||
|
||||
DEFFILE = SRCDIR + '/IA2Marshal.def'
|
||||
DEFFILE = 'IA2Marshal.def'
|
||||
|
||||
OS_LIBS += [
|
||||
'uuid',
|
||||
|
|
|
@ -18,7 +18,7 @@ DEFINES['REGISTER_PROXY_DLL'] = True
|
|||
# of AccessibleMarshal.dll.
|
||||
DEFINES['PROXY_CLSID'] = 'IID_ISimpleDOMNode'
|
||||
|
||||
DEFFILE = SRCDIR + '/AccessibleMarshal.def'
|
||||
DEFFILE = 'AccessibleMarshal.def'
|
||||
|
||||
OS_LIBS += [
|
||||
'kernel32',
|
||||
|
|
|
@ -37,7 +37,7 @@ GENERATED_FILES += [
|
|||
'HandlerData_p.c',
|
||||
]
|
||||
|
||||
DEFFILE = SRCDIR + '/AccessibleHandler.def'
|
||||
DEFFILE = 'AccessibleHandler.def'
|
||||
|
||||
USE_LIBS += [
|
||||
'mscom_oop',
|
||||
|
|
|
@ -10,7 +10,7 @@ SOURCES += [
|
|||
|
||||
SharedLibrary('crashinjectdll')
|
||||
|
||||
DEFFILE = SRCDIR + '/crashinjectdll.def'
|
||||
DEFFILE = 'crashinjectdll.def'
|
||||
|
||||
USE_STATIC_LIBS = True
|
||||
NO_PGO = True
|
||||
|
|
|
@ -153,9 +153,6 @@ CODFILE=$(basename $(@F)).cod
|
|||
endif
|
||||
|
||||
endif # !GNU_CC
|
||||
|
||||
EXTRA_DEPS += $(DEFFILE)
|
||||
|
||||
endif # WINNT
|
||||
|
||||
ifeq (arm-Darwin,$(CPU_ARCH)-$(OS_TARGET))
|
||||
|
|
|
@ -42,7 +42,7 @@ NO_PGO = True
|
|||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
||||
RCFILE = 'nptest.rc'
|
||||
RESFILE = 'nptest.res'
|
||||
DEFFILE = SRCDIR + '/nptest.def'
|
||||
DEFFILE = 'nptest.def'
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa' and '64' in CONFIG['OS_TEST']:
|
||||
OS_LIBS += ['-framework Carbon']
|
||||
|
|
|
@ -153,6 +153,6 @@ OS_LIBS += [
|
|||
# '/WX',
|
||||
#]
|
||||
|
||||
DEFFILE = SRCDIR + '/../../checkout/src/libEGL/libEGL.def'
|
||||
DEFFILE = '../../checkout/src/libEGL/libEGL.def'
|
||||
RCFILE = '../../checkout/src/libEGL/libEGL.rc'
|
||||
GeckoSharedLibrary('libEGL', linkage=None)
|
||||
|
|
|
@ -171,6 +171,6 @@ OS_LIBS += [
|
|||
# '/WX',
|
||||
#]
|
||||
|
||||
DEFFILE = SRCDIR + '/../../checkout/src/libGLESv2/libGLESv2_autogen.def'
|
||||
DEFFILE = '../../checkout/src/libGLESv2/libGLESv2_autogen.def'
|
||||
RCFILE = '../../checkout/src/libGLESv2/libGLESv2.rc'
|
||||
GeckoSharedLibrary('libGLESv2', linkage=None)
|
||||
|
|
|
@ -509,7 +509,7 @@ def export_target(root):
|
|||
total_used_files.add(def_path)
|
||||
|
||||
def_rel_path = list(fixup_paths([def_path]))[0]
|
||||
extras['DEFFILE'] = "SRCDIR + '/{}'".format(def_rel_path)
|
||||
extras['DEFFILE'] = "'{}'".format(def_rel_path)
|
||||
|
||||
os_libs = list(map( lambda x: x[:-len('.lib')], set(accum_desc.get('libs', [])) ))
|
||||
|
||||
|
|
|
@ -562,4 +562,4 @@ AllowCompilerWarnings()
|
|||
GeckoSharedLibrary('pdfium', linkage=None)
|
||||
|
||||
if CONFIG['OS_TARGET'] == 'WINNT':
|
||||
DEFFILE = SRCDIR + '/pdfium.def'
|
||||
DEFFILE = 'pdfium.def'
|
||||
|
|
|
@ -30,7 +30,7 @@ if CONFIG['MOZ_UBSAN']:
|
|||
]
|
||||
|
||||
if CONFIG['OS_TARGET'] == 'WINNT':
|
||||
DEFFILE = 'mozglue.def'
|
||||
DEFFILE = '!mozglue.def'
|
||||
# We'll break the DLL blocklist if we immediately load user32.dll
|
||||
DELAYLOAD_DLLS += [
|
||||
'user32.dll',
|
||||
|
|
|
@ -1614,7 +1614,7 @@ VARIABLES = {
|
|||
This variable can only be used on Windows.
|
||||
"""),
|
||||
|
||||
'DEFFILE': (unicode, unicode,
|
||||
'DEFFILE': (Path, unicode,
|
||||
"""The program .def (module definition) file.
|
||||
|
||||
This variable can only be used on Windows.
|
||||
|
|
|
@ -1036,7 +1036,6 @@ class TreeMetadataEmitter(LoggingMixin):
|
|||
'RCFILE',
|
||||
'RESFILE',
|
||||
'RCINCLUDE',
|
||||
'DEFFILE',
|
||||
'WIN32_EXE_LDFLAGS',
|
||||
'USE_EXTENSION_MANIFEST',
|
||||
'NO_JS_MANIFEST',
|
||||
|
@ -1067,13 +1066,28 @@ class TreeMetadataEmitter(LoggingMixin):
|
|||
if 'LDFLAGS' in context and context['LDFLAGS']:
|
||||
computed_link_flags.resolve_flags('MOZBUILD', context['LDFLAGS'])
|
||||
|
||||
deffile = context['DEFFILE']
|
||||
if deffile and context.config.substs.get('OS_ARCH') == 'WINNT':
|
||||
deffile = context.get('DEFFILE')
|
||||
if deffile and context.config.substs.get('OS_TARGET') == 'WINNT':
|
||||
if isinstance(deffile, SourcePath):
|
||||
if not os.path.exists(deffile.full_path):
|
||||
raise SandboxValidationError(
|
||||
'Path specified in DEFFILE does not exist: %s '
|
||||
'(resolved to %s)' % (deffile,
|
||||
deffile.full_path), context)
|
||||
path = mozpath.relpath(deffile.full_path, context.objdir)
|
||||
else:
|
||||
path = deffile.target_basename
|
||||
|
||||
# We don't have any better way to indicate that the def file
|
||||
# is a dependency to whatever we're building beyond stuffing
|
||||
# it into EXTRA_DEPS.
|
||||
passthru.variables['EXTRA_DEPS'] = [path]
|
||||
|
||||
if context.config.substs.get('GNU_CC'):
|
||||
computed_link_flags.resolve_flags('DEFFILE', [deffile])
|
||||
computed_link_flags.resolve_flags('DEFFILE', [path])
|
||||
else:
|
||||
computed_link_flags.resolve_flags('DEFFILE',
|
||||
['-DEF:' + deffile])
|
||||
['-DEF:' + path])
|
||||
|
||||
dist_install = context['DIST_INSTALL']
|
||||
if dist_install is True:
|
||||
|
|
|
@ -325,8 +325,10 @@ class TestRecursiveMakeBackend(BackendTester):
|
|||
'RCINCLUDE': [
|
||||
'RCINCLUDE := bar.rc',
|
||||
],
|
||||
'DEFFILE': [
|
||||
'DEFFILE := baz.def',
|
||||
'EXTRA_DEPS': [
|
||||
'EXTRA_DEPS += %s' % mozpath.join(mozpath.relpath(env.topsrcdir,
|
||||
env.topobjdir),
|
||||
'baz.def'),
|
||||
],
|
||||
'WIN32_EXE_LDFLAGS': [
|
||||
'WIN32_EXE_LDFLAGS += -subsystem:console',
|
||||
|
|
|
@ -190,7 +190,9 @@ class TestEmitterBasic(unittest.TestCase):
|
|||
'RCFILE': 'foo.rc',
|
||||
'RESFILE': 'bar.res',
|
||||
'RCINCLUDE': 'bar.rc',
|
||||
'DEFFILE': 'baz.def',
|
||||
'EXTRA_DEPS': [mozpath.join(mozpath.relpath(reader.config.topsrcdir,
|
||||
reader.config.topobjdir),
|
||||
'baz.def')],
|
||||
'WIN32_EXE_LDFLAGS': ['-subsystem:console'],
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче