Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 5764df44 authored by MONSEIGNE Thibaut's avatar MONSEIGNE Thibaut
Browse files

:bug: Quick Fix for Build with new Unity Editor

parent b8234c57
No related branches found
No related tags found
No related merge requests found
Pipeline #263372 passed
......@@ -9,6 +9,9 @@ public class BuildHooks
{
private const string LIB_LSL_NAME = "liblsl";
private const string PLUGIN_DIR = "Plugins";
private const string X86_FOLDER = "x86";
private const string X64_FOLDER = "x86_64";
private const string IOS_FOLDER = "iOS";
/// <summary> Called after the build. See also <see cref="PostProcessBuildAttribute"/>. </summary>
/// <param name="target"> The build target. </param>
......@@ -26,16 +29,16 @@ public class BuildHooks
switch (target)
{
case BuildTarget.StandaloneWindows:
RenameLibFile(pluginDir, LSLEditorIntegration.LIB32_NAME, LSLEditorIntegration.LIB64_NAME, LSLEditorIntegration.DLL_ENDING);
RenameLibFile(pluginDir, X86_FOLDER, LSLEditorIntegration.LIB32_NAME, LSLEditorIntegration.LIB64_NAME, LSLEditorIntegration.DLL_ENDING);
break;
case BuildTarget.StandaloneWindows64:
RenameLibFile(pluginDir, LSLEditorIntegration.LIB64_NAME, LSLEditorIntegration.LIB32_NAME, LSLEditorIntegration.DLL_ENDING);
RenameLibFile(pluginDir, X64_FOLDER, LSLEditorIntegration.LIB64_NAME, LSLEditorIntegration.LIB32_NAME, LSLEditorIntegration.DLL_ENDING);
break;
case BuildTarget.StandaloneLinux64:
RenameLibFile(pluginDir, LSLEditorIntegration.LIB64_NAME, LSLEditorIntegration.LIB32_NAME, LSLEditorIntegration.SO_ENDING);
RenameLibFile(pluginDir, X64_FOLDER, LSLEditorIntegration.LIB64_NAME, LSLEditorIntegration.LIB32_NAME, LSLEditorIntegration.SO_ENDING);
break;
case BuildTarget.StandaloneOSX:
RenameLibFile(pluginDir, LSLEditorIntegration.LIB64_NAME, LSLEditorIntegration.LIB32_NAME, LSLEditorIntegration.BUNDLE_ENDING);
RenameLibFile(pluginDir, IOS_FOLDER, LSLEditorIntegration.LIB64_NAME, LSLEditorIntegration.LIB32_NAME, LSLEditorIntegration.BUNDLE_ENDING);
break;
}
}
......@@ -46,16 +49,18 @@ public class BuildHooks
/// <param name="srcName"> Name of the source file. </param>
/// <param name="oldName"> Name of the old. </param>
/// <param name="extension"> The extension. </param>
private static void RenameLibFile(string pluginDir, string srcName, string oldName, string extension)
private static void RenameLibFile(string pluginDir, string subDir, string srcName, string oldName, string extension)
{
var oldFile = Path.Combine(pluginDir, oldName + extension);
Debug.Log("[LSL BUILD Hook] Delete obsolete file: " + oldFile);
File.Delete(oldFile);
var oldDir = Path.Combine(pluginDir, subDir);
var oldFile = Path.Combine(oldDir, oldName + extension);
Debug.Log("[LSL BUILD Hook] Delete obsolete file: " + oldFile);
File.Delete(oldFile);
var srcFile = Path.Combine(pluginDir, srcName + extension);
var dstFile = Path.Combine(pluginDir, LIB_LSL_NAME + extension);
Debug.Log($"[LSL BUILD Hook] Renaming: {srcFile} to {dstFile}");
File.Move(srcFile, dstFile);
}
var srcFile = Path.Combine(oldDir, srcName + extension);
var dstFile = Path.Combine(pluginDir, LIB_LSL_NAME + extension);
Debug.Log($"[LSL BUILD Hook] Renaming: {srcFile} to {dstFile}");
File.Move(srcFile, dstFile);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment