]> granicus.if.org Git - clang/commitdiff
handle -arch and -isysroot correctly (like ccc-analyszer do).
authorNuno Lopes <nunoplopes@sapo.pt>
Tue, 17 Jun 2008 17:23:14 +0000 (17:23 +0000)
committerNuno Lopes <nunoplopes@sapo.pt>
Tue, 17 Jun 2008 17:23:14 +0000 (17:23 +0000)
Patch by Filipe Cabecinhas

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

utils/ccc

index fd909f91494931bffaf7553d293563242de4b2a4..b58bf616c24cc7c46e7f8df218fc4cac5eae2bb5 100755 (executable)
--- a/utils/ccc
+++ b/utils/ccc
@@ -111,10 +111,26 @@ def main(args):
         if arg[:5] in ['-std=']:
             compile_opts.append(arg)
 
+        # Options with one argument that should pass through to compiler
+        if arg in [ '-include', '-idirafter', '-iprefix',
+                    '-iquote', '-isystem', '-iwithprefix',
+                    '-iwithprefixbefore']:
+            compile_opts.append(arg)
+            compile_opts.append(args[i+1])
+            i += 1
+
         # Options with one argument that should pass through
-        if arg in ['-include', '-isysroot', '-arch']:
+        if arg in ['-framework']:
+            link_opts.append(arg)
+            link_opts.append(args[i+1])
+            i += 1
+
+        # Options with one argument that should pass through to both
+        if arg in ['-isysroot', '-arch']:
             compile_opts.append(arg)
             compile_opts.append(args[i+1])
+            link_opts.append(arg)
+            link_opts.append(args[i+1])
             i += 1
 
         # Prefix matches for the link mode
@@ -123,12 +139,6 @@ def main(args):
             if arg == '-Os': arg = '-O2'
             link_opts.append(arg)
 
-        # Options with one argument that should pass through
-        if arg in ['-framework', '-isysroot', '-arch']:
-            link_opts.append(arg)
-            link_opts.append(args[i+1])
-            i += 1
-
         # Input files
         if arg == '-filelist':
             f = open(args[i+1])