fix mbedtls and make it staticly linked to shared object when fetchcontent is enabled

This commit is contained in:
2026-06-18 03:02:51 -05:00
parent 8bdcc4ff1f
commit 5bd2735ad8
5 changed files with 36 additions and 16 deletions

View File

@@ -510,7 +510,7 @@ std::string TF_GetExecutableName() {
if (sysctl(mib, 4, path.data(), &len, NULL, 0) < 0) {
return "";
}
path.resize(len-1);
return path;
#elif defined(__NetBSD__)
auto path = Filesystem::LocalFS->ReadLink(
@@ -523,15 +523,18 @@ std::string TF_GetExecutableName() {
return path.ToString();
#elif TARGET_OS_MAC && !TARGET_OS_IPHONE
std::string path;
path.resize(1024);
path.resize(1025);
uint32_t bufsize = (uint32_t)path.size();
if (_NSGetExecutablePath(path.data(), &bufsize) == 0) {
path.resize(bufsize);
path.resize(bufsize-1);
return path;
} else {
path.resize(bufsize);
if (_NSGetExecutablePath(path.data(), &bufsize) == 0)
{
path.resize(bufsize-1);
return path;
}
}
#endif