@@ -25,11 +25,29 @@ function RegisterExtractorPack(id)
25
25
end
26
26
end
27
27
28
+ -- removes unsupported -Xcc flag, e.g, calling strip_unsupported_xcc_arg('-foo', 2) against
29
+ -- swift -Xcc -foo -Xcc -bar main.swift
30
+ -- will only leave 'swift main.swift' removing both -Xcc -foo, and also -Xcc -bar
31
+ -- removes unsupported CLI arg passed to clang via -Xcc together with the following how_many args
32
+ function strip_unsupported_clang_arg (args , arg , how_many )
33
+ local index = indexOf (args , arg )
34
+ if index and index > 0 and args [index - 1 ] == ' -Xcc' then
35
+ index = index - 1 -- start from -Xcc
36
+ how_many = 2 * (how_many + 1 ) -- need to remove initial -Xcc <arg> as well as following -Xcc prefixed flags
37
+ while (how_many > 0 )
38
+ do
39
+ table.remove (args , index )
40
+ how_many = how_many - 1
41
+ end
42
+ end
43
+ end
44
+
28
45
function strip_unsupported_args (args )
29
46
strip_unsupported_arg (args , ' -emit-localized-strings' , 0 )
30
47
strip_unsupported_arg (args , ' -emit-localized-strings-path' , 1 )
31
48
strip_unsupported_arg (args , ' -stack-check' , 0 )
32
49
strip_unsupported_arg (args , ' -experimental-skip-non-inlinable-function-bodies-without-types' , 0 )
50
+ strip_unsupported_clang_arg (args , ' -ivfsstatcache' , 1 )
33
51
end
34
52
35
53
-- xcodebuild does not always specify the -resource-dir in which case the compiler falls back
0 commit comments