Skip to content

Commit 3b2f358

Browse files
Workaround MacCatalyst .app output path change in cmake 3.25 (#79098)
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 d793f95 commit 3b2f358

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)