Skip to content

Commit d83ac1e

Browse files
Merge pull request swiftlang#7714 from adrian-prantl/cherry-pick-swift-release-5.10-Fix-the-DEVELOPER_DIR-computation-70528
[Cherry-pick into swift/release/5.10] Fix the DEVELOPER_DIR computation (llvm#70528)
2 parents 4728a4b + de06aa3 commit d83ac1e

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
@@ -458,13 +458,11 @@ static void ParseOSVersion(llvm::VersionTuple &version, NSString *Key) {
458458
// Invoke xcrun with the shlib dir.
459459
if (FileSpec fspec = HostInfo::GetShlibDir()) {
460460
if (FileSystem::Instance().Exists(fspec)) {
461-
std::string contents_dir =
462-
XcodeSDK::FindXcodeContentsDirectoryInPath(fspec.GetPath());
463-
llvm::StringRef shlib_developer_dir =
464-
llvm::sys::path::parent_path(contents_dir);
465-
if (!shlib_developer_dir.empty()) {
466-
auto sdk =
467-
xcrun(sdk_name, show_sdk_path, std::move(shlib_developer_dir));
461+
llvm::SmallString<0> shlib_developer_dir(
462+
XcodeSDK::FindXcodeContentsDirectoryInPath(fspec.GetPath()));
463+
llvm::sys::path::append(shlib_developer_dir, "Developer");
464+
if (FileSystem::Instance().Exists(shlib_developer_dir)) {
465+
auto sdk = xcrun(sdk_name, show_sdk_path, shlib_developer_dir);
468466
if (!sdk)
469467
return sdk.takeError();
470468
if (!sdk->empty())

0 commit comments

Comments
 (0)