[PATCH] D57338: gn build: Make cmake sync script work on Windows if git is a bat file

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 28 11:54:20 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL352419: gn build: Make cmake sync script work on Windows if git is a bat file (authored by nico, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D57338?vs=183890&id=183935#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57338/new/

https://reviews.llvm.org/D57338

Files:
  llvm/trunk/utils/gn/build/sync_source_lists_from_cmake.py


Index: llvm/trunk/utils/gn/build/sync_source_lists_from_cmake.py
===================================================================
--- llvm/trunk/utils/gn/build/sync_source_lists_from_cmake.py
+++ llvm/trunk/utils/gn/build/sync_source_lists_from_cmake.py
@@ -18,8 +18,9 @@
 
 
 def sync_source_lists():
-    gn_files = subprocess.check_output(
-            ['git', 'ls-files', '*BUILD.gn']).splitlines()
+    # Use shell=True on Windows in case git is a bat file.
+    gn_files = subprocess.check_output(['git', 'ls-files', '*BUILD.gn'],
+                                       shell=os.name == 'nt').splitlines()
 
     # Matches e.g. |   "foo.cpp",|, captures |foo| in group 1.
     gn_cpp_re = re.compile(r'^\s*"([^"]+\.(?:cpp|h))",$', re.MULTILINE)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57338.183935.patch
Type: text/x-patch
Size: 755 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190128/bda67fca/attachment.bin>


More information about the llvm-commits mailing list