Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: AppleCoreBuildStep disabling bitcode on tvOS #5

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,23 @@ public class AppleCoreBuildStep : AppleBuildStep
#if UNITY_EDITOR_OSX
public override void OnFinalizePostProcess(AppleBuildProfile appleBuildProfile, BuildTarget buildTarget, string pathToBuiltProject)
{
Debug.Log($"AppleBuild: disabling Bitcode for framework and app targets.");
var pbxProject = AppleBuild.GetPbxProject(buildTarget, pathToBuiltProject);
var pbxProjectPath = AppleBuild.GetPbxProjectPath(buildTarget, pathToBuiltProject);

if (pbxProject != null)
if (buildTarget != BuildTarget.tvOS)
{
var targetGuid = (buildTarget == BuildTarget.StandaloneOSX) ? pbxProject.TargetGuidByName(Application.productName) : pbxProject.GetUnityMainTargetGuid();
var frameworkGuid = pbxProject.GetUnityFrameworkTargetGuid();
Debug.Log($"AppleBuild: disabling Bitcode for framework and app targets.");
var pbxProject = AppleBuild.GetPbxProject(buildTarget, pathToBuiltProject);
var pbxProjectPath = AppleBuild.GetPbxProjectPath(buildTarget, pathToBuiltProject);

if (pbxProject != null)
{
var targetGuid = (buildTarget == BuildTarget.StandaloneOSX) ? pbxProject.TargetGuidByName(Application.productName) : pbxProject.GetUnityMainTargetGuid();
var frameworkGuid = pbxProject.GetUnityFrameworkTargetGuid();

pbxProject.AddBuildProperty(frameworkGuid, "ENABLE_BITCODE", "false");
pbxProject.AddBuildProperty(targetGuid, "ENABLE_BITCODE", "false");
pbxProject.AddBuildProperty(frameworkGuid, "ENABLE_BITCODE", "false");
pbxProject.AddBuildProperty(targetGuid, "ENABLE_BITCODE", "false");

Debug.Log($"AppleBuild: Writing bitcode changes to PBXProject {pbxProjectPath}...");
pbxProject.WriteToFile(pbxProjectPath);
Debug.Log($"AppleBuild: Writing bitcode changes to PBXProject {pbxProjectPath}...");
pbxProject.WriteToFile(pbxProjectPath);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Apple.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;

Expand Down Expand Up @@ -53,6 +54,10 @@ public override void OnProcessInfoPlist(AppleBuildProfile _, BuildTarget buildTa
newController.SetString("ProfileName", "MicroGamepad");
supportedControllers.values.Add(newController);
}
else
{
supportedControllers.values.Remove(supportedControllers.values.First(pi => pi["ProfileName"].AsString() == "MicroGamepad"));
}

// ExtendedGamepad...
if (SupportsExtendedGamePad)
Expand All @@ -61,6 +66,10 @@ public override void OnProcessInfoPlist(AppleBuildProfile _, BuildTarget buildTa
newController.SetString("ProfileName", "ExtendedGamepad");
supportedControllers.values.Add(newController);
}
else
{
supportedControllers.values.Remove(supportedControllers.values.First(pi => pi["ProfileName"].AsString() == "ExtendedGamepad"));
}
}

public override void OnProcessFrameworks(AppleBuildProfile _, BuildTarget buildTarget, string pathToBuiltTarget, PBXProject pbxProject)
Expand Down