Skip to content

Commit 65c48aa

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 d5edd29 commit 65c48aa

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
@@ -520,8 +520,15 @@ public string BuildAppBundle(
520520

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

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

526533
if (destination != null)
527534
{

0 commit comments

Comments
 (0)