[llvm] r352419 - gn build: Make cmake sync script work on Windows if git is a bat file
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 28 11:53:52 PST 2019
Author: nico
Date: Mon Jan 28 11:53:52 2019
New Revision: 352419
URL: http://llvm.org/viewvc/llvm-project?rev=352419&view=rev
Log:
gn build: Make cmake sync script work on Windows if git is a bat file
Differential Revision: https://reviews.llvm.org/D57338
Modified:
llvm/trunk/utils/gn/build/sync_source_lists_from_cmake.py
Modified: llvm/trunk/utils/gn/build/sync_source_lists_from_cmake.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/build/sync_source_lists_from_cmake.py?rev=352419&r1=352418&r2=352419&view=diff
==============================================================================
--- llvm/trunk/utils/gn/build/sync_source_lists_from_cmake.py (original)
+++ llvm/trunk/utils/gn/build/sync_source_lists_from_cmake.py Mon Jan 28 11:53:52 2019
@@ -18,8 +18,9 @@ import subprocess
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)
More information about the llvm-commits
mailing list