Skip to content

Commit 67dcebf

Browse files
Workaround MacCatalyst .app output path change in cmake 3.25 (#79097)
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 <[email protected]>
1 parent 6b15556 commit 67dcebf

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/tasks/AppleAppBuilder/Xcode.cs

+9-2
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,15 @@ public string BuildAppBundle(
524524

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

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

530537
if (destination != null)
531538
{

0 commit comments

Comments
 (0)