llvm.org GIT mirror llvm / fb44491
Teach llvm-build to avoid touching LibraryDependencies.inc unless the contents change. This saves us from rebuilding llvm-config each time we reconfigure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222308 91177308-0d34-0410-b5e6-96231b3b80d8 Peter Collingbourne 6 years ago
1 changed file(s) with 10 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
0 from __future__ import absolute_import
1 import filecmp
12 import os
23 import sys
34
381382
382383 # Write out the library table.
383384 make_install_dir(os.path.dirname(output_path))
384 f = open(output_path, 'w')
385 f = open(output_path+'.new', 'w')
385386 f.write("""\
386387 //===- llvm-build generated file --------------------------------*- C++ -*-===//
387388 //
418419 for dep in required_names)))
419420 f.write('};\n')
420421 f.close()
422
423 if not os.path.isfile(output_path):
424 os.rename(output_path+'.new', output_path)
425 elif filecmp.cmp(output_path, output_path+'.new'):
426 os.remove(output_path+'.new')
427 else:
428 os.remove(output_path)
429 os.rename(output_path+'.new', output_path)
421430
422431 def get_required_libraries_for_component(self, ci, traverse_groups = False):
423432 """