fix(cli): zig cross to *-apple-darwin target

This commit is contained in:
LongYinan 2022-08-12 16:52:05 +08:00
parent aad4712e0f
commit 14aab065e7
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7

View file

@ -40,10 +40,13 @@ const ZIG_PLATFORM_TARGET_MAP = {
function processZigLinkerArgs(platform: string, args: string[]) { function processZigLinkerArgs(platform: string, args: string[]) {
if (platform.includes('apple')) { if (platform.includes('apple')) {
const newArgs = args.filter( const newArgs = args.filter(
(arg) => (arg, index) =>
!arg.startsWith('-Wl,-exported_symbols_list') && !arg.startsWith('-Wl,-exported_symbols_list') &&
arg !== '-Wl,-dylib' && arg !== '-Wl,-dylib' &&
arg !== '-liconv', arg !== '-liconv' &&
arg !== '-Wl,-dead_strip' &&
!(arg === '-framework' && args[index + 1] === 'CoreFoundation') &&
!(arg === 'CoreFoundation' && args[index - 1] === '-framework'),
) )
newArgs.push('-Wl,"-undefined=dynamic_lookup"', '-dead_strip') newArgs.push('-Wl,"-undefined=dynamic_lookup"', '-dead_strip')
return newArgs return newArgs