Bug 1200311 - Move dependentlibs.list.gtest generation to GENERATED_FILES. r=mshal, a=lizzard
authorChris Manchester <cmanchester@mozilla.com>
Mon, 06 Feb 2017 14:34:06 -0800
changeset 378342 123ae818f185e1d132d9243a60713316a87bb364
parent 378341 7ea61ef9175dca2d2025942c85ecf66df53a2554
child 378343 bc3e9cf39c49e8b454a0f98931af3623bb45cd94
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal, lizzard
bugs1200311
milestone53.0a2
Bug 1200311 - Move dependentlibs.list.gtest generation to GENERATED_FILES. r=mshal, a=lizzard MozReview-Commit-ID: B4cuUg9TjX4
toolkit/library/dependentlibs.py
toolkit/library/gtest/Makefile.in
toolkit/library/moz.build
--- a/toolkit/library/dependentlibs.py
+++ b/toolkit/library/dependentlibs.py
@@ -121,15 +121,21 @@ def gen_list(output, lib):
     else:
         ext = os.path.splitext(lib)[1]
         assert(ext == '.dll')
         func = dependentlibs_dumpbin
 
     deps = dependentlibs(lib, libpaths, func)
     deps[lib] = mozpath.join(libpaths[0], lib)
     output.write('\n'.join(deps.keys()) + '\n')
+
+    with open(output.name + ".gtest", 'w') as gtest_out:
+        libs = deps.keys()
+        libs[-1] = 'gtest/' + libs[-1]
+        gtest_out.write('\n'.join(libs) + '\n')
+
     return set(deps.values())
 
 def main():
     gen_list(sys.stdout, sys.argv[1])
 
 if __name__ == '__main__':
     main()
--- a/toolkit/library/gtest/Makefile.in
+++ b/toolkit/library/gtest/Makefile.in
@@ -18,18 +18,11 @@ else
 include $(topsrcdir)/toolkit/library/libxul.mk
 
 include $(topsrcdir)/config/config.mk
 
 # Wrap linker to print linking status periodically to prevent the linking
 # process from getting killed
 EXPAND_LIBS_EXEC := $(PYTHON) $(topsrcdir)/config/link.py
 
-ifdef COMPILE_ENVIRONMENT
-target:: $(DIST)/bin/dependentlibs.list.gtest
-endif
-
-$(DIST)/bin/dependentlibs.list.gtest: $(DIST)/bin/dependentlibs.list
-	sed -e 's|$(SHARED_LIBRARY)|gtest/$(SHARED_LIBRARY)|' $< > $@
-
 LINK_PDBFILE = xul-gtest.pdb
 
 endif
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -375,22 +375,23 @@ if CONFIG['COMPILE_ENVIRONMENT']:
     if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'):
         full_libname = SHARED_LIBRARY_NAME
     else:
         full_libname = '%s%s%s' % (
             CONFIG['DLL_PREFIX'],
             LIBRARY_NAME,
             CONFIG['DLL_SUFFIX']
         )
-    GENERATED_FILES += ['dependentlibs.list']
-    GENERATED_FILES['dependentlibs.list'].script = 'dependentlibs.py:gen_list'
-    GENERATED_FILES['dependentlibs.list'].inputs = [
+    GENERATED_FILES += [('dependentlibs.list', 'dependentlibs.list.gtest')]
+    dep_libs_list = GENERATED_FILES[('dependentlibs.list', 'dependentlibs.list.gtest')]
+    dep_libs_list.script = 'dependentlibs.py:gen_list'
+    dep_libs_list.inputs = [
         '!%s' % full_libname,
     ]
-    FINAL_TARGET_FILES += ['!dependentlibs.list']
+    FINAL_TARGET_FILES += ['!dependentlibs.list', '!dependentlibs.list.gtest']
 
 # This library needs to be last to make XPCOM module registration work.
 USE_LIBS += ['StaticXULComponentsEnd']
 
 # The above library needs to be last for C++ purposes.  This library,
 # however, is entirely composed of Rust code, and needs to come after
 # all the C++ code so any possible C++ -> Rust calls can be resolved.
 if CONFIG['MOZ_RUST']: