Skip to content

Commit

Permalink
Workaround MacCatalyst .app output path change in cmake 3.25 (#79097)
Browse files Browse the repository at this point in the history
Since AzDO macOS builders where updated to cmake 3.25 we're seeing failures because the .app doesn't end up in the expected output path anymore.
Apply a workaround to move it back to the old location.

Fixes #78778

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
  • Loading branch information
github-actions[bot] and akoeplinger authored Jan 4, 2023
1 parent 6b15556 commit 67dcebf
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 @@ -524,8 +524,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 67dcebf

Please sign in to comment.