Skip to content

Commit

Permalink
Workaround MacCatalyst .app output path change in cmake 3.25
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
  • Loading branch information
akoeplinger authored and github-actions committed Dec 1, 2022
1 parent d5edd29 commit 65c48aa
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 @@ -520,8 +520,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 65c48aa

Please sign in to comment.