]> granicus.if.org Git - llvm/commitdiff
gn build: Copy file permissions from input file in configure_file() emulation.
authorPeter Collingbourne <peter@pcc.me.uk>
Wed, 9 Jan 2019 04:39:29 +0000 (04:39 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Wed, 9 Jan 2019 04:39:29 +0000 (04:39 +0000)
Most significantly, this makes bin/llvm-lit executable so that it
can be run in the usual way.

Differential Revision: https://reviews.llvm.org/D56423

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350688 91177308-0d34-0410-b5e6-96231b3b80d8

utils/gn/build/write_cmake_config.py

index 0f476542ef6759f6153848fb3c0dddbe08bcbfe4..f0d0a00bf1c2f2f60fdae74de418372a02c2e42f 100755 (executable)
@@ -101,6 +101,7 @@ def main():
 
     if not os.path.exists(args.output) or open(args.output).read() != output:
         open(args.output, 'w').write(output)
+        os.chmod(args.output, os.stat(args.input).st_mode & 0777)
 
 
 if __name__ == '__main__':