This commit is contained in:
Paolo Tranquilli 2023-04-27 10:29:55 +02:00 коммит произвёл Alex Denisov
Родитель b9c4adee31
Коммит c945d65b2d
1 изменённых файлов: 18 добавлений и 0 удалений

Просмотреть файл

@ -25,11 +25,29 @@ function RegisterExtractorPack(id)
end
end
-- removes unsupported -Xcc flag, e.g, calling strip_unsupported_xcc_arg('-foo', 2) against
-- swift -Xcc -foo -Xcc -bar main.swift
-- will only leave 'swift main.swift' removing both -Xcc -foo, and also -Xcc -bar
-- removes unsupported CLI arg passed to clang via -Xcc together with the following how_many args
function strip_unsupported_clang_arg(args, arg, how_many)
local index = indexOf(args, arg)
if index and index > 0 and args[index - 1] == '-Xcc' then
index = index - 1 -- start from -Xcc
how_many = 2 * (how_many + 1) -- need to remove initial -Xcc <arg> as well as following -Xcc prefixed flags
while (how_many > 0)
do
table.remove(args, index)
how_many = how_many - 1
end
end
end
function strip_unsupported_args(args)
strip_unsupported_arg(args, '-emit-localized-strings', 0)
strip_unsupported_arg(args, '-emit-localized-strings-path', 1)
strip_unsupported_arg(args, '-stack-check', 0)
strip_unsupported_arg(args, '-experimental-skip-non-inlinable-function-bodies-without-types', 0)
strip_unsupported_clang_arg(args, '-ivfsstatcache', 1)
end
-- xcodebuild does not always specify the -resource-dir in which case the compiler falls back