Use $AR instead of ar. Compatibility with -flto(=thin).

This commit is contained in:
DubbleClick
2025-07-27 00:59:32 +07:00
parent 42b4272965
commit b6f673cd68
4 changed files with 16 additions and 7 deletions

View File

@@ -48,6 +48,7 @@ trait ngtcp2
// on macOS, the static library may contain other static libraries?
// ld: archive member 'libssl.a' not a mach-o file in libngtcp2_crypto_ossl.a
shell()->cd(BUILD_LIB_PATH)->exec("ar -t libngtcp2_crypto_ossl.a | grep '\\.a$' | xargs -n1 ar d libngtcp2_crypto_ossl.a");
$AR = getenv('AR') ?: 'ar';
shell()->cd(BUILD_LIB_PATH)->exec("{$AR} -t libngtcp2_crypto_ossl.a | grep '\\.a$' | xargs -n1 ar d libngtcp2_crypto_ossl.a");
}
}