Skip to content
Open
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
14 changes: 11 additions & 3 deletions Assets/AppCenter/Editor/AppCenterPostBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,23 @@ public static void FixIl2CppLogging(string pathToBuiltProject)
* combine some files on the compilation so the changes in one file can affect another.
*/
codeLines.Insert(lastIncludeLineIndex + 2, "#undef GetCurrentDirectory");
codeLines.Insert(lastIncludeLineIndex + 3, "#undef ZeroMemory");
codeLines.Insert(lastIncludeLineIndex + 4, "#undef MemoryBarrier");

// Add logging method.
var logMethodLineIndex = SearchForLine(codeLines, "void Debugger::Log");
if (logMethodLineIndex == -1)
{
throw new Exception("Unexpected content of Debugger.cpp");
}

var insertingPosition = GetFirstLineInMethodBody(codeLines, logMethodLineIndex);

#if UNITY_2021_1_OR_NEWER
codeLines.Insert(insertingPosition, "OutputDebugStringW((*message)->chars);");
#else
codeLines.Insert(insertingPosition, "OutputDebugStringW(message->chars);");
#endif

// Enable logging.
var isLoggingMethodLineIndex = SearchForLine(codeLines, "bool Debugger::IsLogging");
Expand Down Expand Up @@ -284,9 +292,9 @@ internal static string GetAttributeValue(XElement element, string attributeName)
return attribute == null ? null : attribute.Value;
}

#endregion
#endregion

#region iOS Methods
#region iOS Methods
private static void OnPostprocessProject(PBXProjectWrapper project)
{
// Need to add SQLite and zlib dependencies.
Expand Down Expand Up @@ -336,5 +344,5 @@ private static void OnPostprocessInfo(PlistDocumentWrapper info, AppCenterSettin
}
}

#endregion
#endregion
}