Skip to content

Commit 4ab3b70

Browse files
Merge pull request #7713 from adrian-prantl/cherry-pick-stable-20230725-Fix-the-DEVELOPER_DIR-computation-70528
[Cherry-pick into stable/20230725] Fix the DEVELOPER_DIR computation (llvm#70528)
2 parents 6637993 + fa2c0fa commit 4ab3b70

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -461,13 +461,11 @@ static void ParseOSVersion(llvm::VersionTuple &version, NSString *Key) {
461461
// Invoke xcrun with the shlib dir.
462462
if (FileSpec fspec = HostInfo::GetShlibDir()) {
463463
if (FileSystem::Instance().Exists(fspec)) {
464-
std::string contents_dir =
465-
XcodeSDK::FindXcodeContentsDirectoryInPath(fspec.GetPath());
466-
llvm::StringRef shlib_developer_dir =
467-
llvm::sys::path::parent_path(contents_dir);
468-
if (!shlib_developer_dir.empty()) {
469-
auto sdk =
470-
xcrun(sdk_name, show_sdk_path, std::move(shlib_developer_dir));
464+
llvm::SmallString<0> shlib_developer_dir(
465+
XcodeSDK::FindXcodeContentsDirectoryInPath(fspec.GetPath()));
466+
llvm::sys::path::append(shlib_developer_dir, "Developer");
467+
if (FileSystem::Instance().Exists(shlib_developer_dir)) {
468+
auto sdk = xcrun(sdk_name, show_sdk_path, shlib_developer_dir);
471469
if (!sdk)
472470
return sdk.takeError();
473471
if (!sdk->empty())

0 commit comments

Comments
 (0)