Skip to content

Commit

Permalink
Workaround MacCatalyst .app output path change in cmake 3.25 (#79084)
Browse files Browse the repository at this point in the history
Fixes #78778
  • Loading branch information
akoeplinger authored Dec 1, 2022
1 parent aa8fe36 commit 776a87d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/tasks/AppleAppBuilder/Xcode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,15 @@ public string BuildAppBundle(

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

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

string appPath = Path.Combine(appDirectory, Path.GetFileNameWithoutExtension(xcodePrjPath) + ".app");

if (destination != null)
{
Expand Down

0 comments on commit 776a87d

Please sign in to comment.