Skip to content

Commit ac4efb4

Browse files
akoeplingergithub-actions
authored and
github-actions
committed
Workaround MacCatalyst .app output path change in cmake 3.25
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
1 parent 4f15a5c commit ac4efb4

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)