forked from OSchip/llvm-project
Add a check for a running Xcode before modifying its configuration files.
llvm-svn: 95675
This commit is contained in:
parent
cce7e85165
commit
8de7a0efd1
|
@ -6,6 +6,7 @@ import re
|
||||||
import tempfile
|
import tempfile
|
||||||
import shutil
|
import shutil
|
||||||
import stat
|
import stat
|
||||||
|
from AppKit import *
|
||||||
|
|
||||||
def FindClangSpecs(path):
|
def FindClangSpecs(path):
|
||||||
for root, dirs, files in os.walk(path):
|
for root, dirs, files in os.walk(path):
|
||||||
|
@ -50,6 +51,12 @@ def main():
|
||||||
if options.path is None and options.default is None:
|
if options.path is None and options.default is None:
|
||||||
parser.error("You must specify a version of Clang to use for static analysis. Specify '-h' for details")
|
parser.error("You must specify a version of Clang to use for static analysis. Specify '-h' for details")
|
||||||
|
|
||||||
|
# determine if Xcode is running
|
||||||
|
for x in NSWorkspace.sharedWorkspace().runningApplications():
|
||||||
|
if x.localizedName().find("Xcode") >= 0:
|
||||||
|
print "You must quit Xcode first before modifying its configuration files."
|
||||||
|
return
|
||||||
|
|
||||||
if options.path:
|
if options.path:
|
||||||
# Expand tildes.
|
# Expand tildes.
|
||||||
path = os.path.expanduser(options.path)
|
path = os.path.expanduser(options.path)
|
||||||
|
@ -61,8 +68,8 @@ def main():
|
||||||
else:
|
else:
|
||||||
print "Using the Clang bundled with Xcode"
|
print "Using the Clang bundled with Xcode"
|
||||||
path = options.default
|
path = options.default
|
||||||
|
|
||||||
print ""
|
print ""
|
||||||
|
|
||||||
for x in FindClangSpecs('/Developer'):
|
for x in FindClangSpecs('/Developer'):
|
||||||
ModifySpec(x, path)
|
ModifySpec(x, path)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue