Skip to content

Commit

Permalink
Merge pull request #662 from PlayEveryWare/fix/eos-disable-compilatio…
Browse files Browse the repository at this point in the history
…n-errors

fix: Properly support behavior when `EOS_DISABLE` is defined.
  • Loading branch information
paulhazen committed May 9, 2024
2 parents 93e8ace + ad11313 commit a7bea53
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Assets/Plugins/Windows/Core/WindowsPlatformSpecifics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* SOFTWARE.
*/

#if !EOS_DISABLE
#if UNITY_64 || UNITY_EDITOR_64
#define PLATFORM_64BITS
#elif (UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN)
Expand Down Expand Up @@ -204,4 +205,4 @@ public override void ConfigureSystemPlatformCreateOptions(ref EOSCreateOptions c
}
}
#endif

#endif // !EOS_DISABLE
37 changes: 28 additions & 9 deletions Assets/Plugins/iOS/Editor/IOSBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Expand All @@ -19,25 +19,43 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

#if !EOS_DISABLE
namespace PlayEveryWare.EpicOnlineServices.Build
{
using System.IO;
using UnityEditor.Build.Reporting;
using Utility;

#if UNITY_IOS // This conditional is here so that no compiler errors will happen if the Unity Editor is not configured to build for iOS
// This conditional is here so that no compiler errors will happen if the
// Unity Editor is not configured to build for iOS.
#if UNITY_IOS
using UnityEditor.iOS.Xcode;
#endif

/// <summary>
/// Contains implementation of assorted build tasks that are unique to
/// building the plugin for an iOS project.
/// </summary>
public class IOSBuilder : PlatformSpecificBuilder
{
public IOSBuilder() : base("Plugins/iOS") { }

/// <summary>
/// Perform post build tasks that are unique to the iOS platform.
/// </summary>
/// <param name="report">The build report.</param>
public override void PostBuild(BuildReport report)
{
// Per documentation on base implementation, begin the overriden
// implementation of the PostBuild function by calling first the
// base implementation.
base.PostBuild(report);

#if UNITY_IOS // This conditional is here so that no compiler errors will happen if the Unity Editor is not configured to build for iOS
string projPath = report.summary.outputPath + "/Unity-iPhone.xcodeproj/project.pbxproj";
// This conditional is here so that no compiler errors will happen
// if the Unity Editor is not configured to build for iOS.
#if UNITY_IOS
string projPath = report.summary.outputPath +
"/Unity-iPhone.xcodeproj/project.pbxproj";

PBXProject proj = new();

Expand All @@ -47,13 +65,14 @@ public override void PostBuild(BuildReport report)
string unityTargetGUID = proj.GetUnityFrameworkTargetGuid();

proj.SetBuildProperty(targetGUID, "ENABLE_BITCODE", "false");
proj.SetBuildProperty(unityTargetGUID, "ENABLE_BITCODE", "false");
proj.SetBuildProperty(unityTargetGUID,"ENABLE_BITCODE", "false");

proj.AddFrameworkToProject(targetGUID, "SafariServices.framework", true);
proj.AddFrameworkToProject(targetGUID,"SafariServices.framework", true);
proj.AddFrameworkToProject(targetGUID, "AuthenticationServices.framework", true);

File.WriteAllText(projPath, proj.WriteToString());
#endif
}
}
}
}
#endif // !EOS_DISABLE

0 comments on commit a7bea53

Please sign in to comment.