зеркало из https://github.com/mozilla/gecko-dev.git
Bug 916257 - part 2 - separate out files-from-this-ipdl logic from writing CPPSRCS; r=gps
This commit is contained in:
Родитель
ca8aa75ab6
Коммит
5f1bce160d
|
@ -559,15 +559,19 @@ class RecursiveMakeBackend(CommonBackend):
|
|||
|
||||
for p in sorted(self._ipdl_sources):
|
||||
mk.add_statement('ALL_IPDLSRCS += %s\n' % p)
|
||||
base = os.path.basename(p)
|
||||
root, ext = os.path.splitext(base)
|
||||
def files_from(ipdl):
|
||||
base = os.path.basename(ipdl)
|
||||
root, ext = os.path.splitext(base)
|
||||
|
||||
# Both .ipdl and .ipdlh become .cpp files
|
||||
mk.add_statement('CPPSRCS += %s.cpp\n' % root)
|
||||
if ext == '.ipdl':
|
||||
# .ipdl also becomes Child/Parent.cpp files
|
||||
mk.add_statement('CPPSRCS += %sChild.cpp\n' % root)
|
||||
mk.add_statement('CPPSRCS += %sParent.cpp\n' % root)
|
||||
# Both .ipdl and .ipdlh become .cpp files
|
||||
files = ['%s.cpp' % root]
|
||||
if ext == '.ipdl':
|
||||
# .ipdl also becomes Child/Parent.cpp files
|
||||
files.extend(['%sChild.cpp' % root,
|
||||
'%sParent.cpp' % root])
|
||||
return files
|
||||
|
||||
mk.add_statement('CPPSRCS += %s\n' % ' '.join(files_from(p)))
|
||||
|
||||
mk.add_statement('IPDLDIRS := %s\n' % ' '.join(sorted(set(os.path.dirname(p)
|
||||
for p in self._ipdl_sources))))
|
||||
|
|
|
@ -468,18 +468,23 @@ class TestRecursiveMakeBackend(BackendTester):
|
|||
|
||||
expected = [
|
||||
"ALL_IPDLSRCS += %s/bar/bar.ipdl" % topsrcdir,
|
||||
"CPPSRCS += bar.cpp",
|
||||
"CPPSRCS += barChild.cpp",
|
||||
"CPPSRCS += barParent.cpp",
|
||||
"",
|
||||
"CPPSRCS += bar.cpp barChild.cpp barParent.cpp",
|
||||
"",
|
||||
"ALL_IPDLSRCS += %s/bar/bar2.ipdlh" % topsrcdir,
|
||||
"",
|
||||
"CPPSRCS += bar2.cpp",
|
||||
"",
|
||||
"ALL_IPDLSRCS += %s/foo/foo.ipdl" % topsrcdir,
|
||||
"CPPSRCS += foo.cpp",
|
||||
"CPPSRCS += fooChild.cpp",
|
||||
"CPPSRCS += fooParent.cpp",
|
||||
"",
|
||||
"CPPSRCS += foo.cpp fooChild.cpp fooParent.cpp",
|
||||
"",
|
||||
"ALL_IPDLSRCS += %s/foo/foo2.ipdlh" % topsrcdir,
|
||||
"",
|
||||
"CPPSRCS += foo2.cpp",
|
||||
"",
|
||||
"IPDLDIRS := %s/bar %s/foo" % (topsrcdir, topsrcdir),
|
||||
"",
|
||||
]
|
||||
self.assertEqual(lines, expected)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче