Skip to content

Commit 776a87d

Browse files
authored
Workaround MacCatalyst .app output path change in cmake 3.25 (#79084)
Fixes #78778
1 parent aa8fe36 commit 776a87d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/tasks/AppleAppBuilder/Xcode.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,15 @@ public string BuildAppBundle(
528528

529529
Utils.RunProcess(Logger, "xcodebuild", args.ToString(), workingDir: Path.GetDirectoryName(xcodePrjPath));
530530

531-
string appPath = Path.Combine(Path.GetDirectoryName(xcodePrjPath)!, config + "-" + sdk,
532-
Path.GetFileNameWithoutExtension(xcodePrjPath) + ".app");
531+
string appDirectory = Path.Combine(Path.GetDirectoryName(xcodePrjPath)!, config + "-" + sdk);
532+
if (!Directory.Exists(appDirectory))
533+
{
534+
// cmake 3.25.0 seems to have changed the output directory for MacCatalyst, move it back to the old format
535+
string appDirectoryWithoutSdk = Path.Combine(Path.GetDirectoryName(xcodePrjPath)!, config);
536+
Directory.Move(appDirectoryWithoutSdk, appDirectory);
537+
}
538+
539+
string appPath = Path.Combine(appDirectory, Path.GetFileNameWithoutExtension(xcodePrjPath) + ".app");
533540

534541
if (destination != null)
535542
{

0 commit comments

Comments
 (0)