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
Branches
No related tags found
No related merge requests found
Pipeline #263372 passed
...@@ -9,6 +9,9 @@ public class BuildHooks ...@@ -9,6 +9,9 @@ public class BuildHooks
{ {
private const string LIB_LSL_NAME = "liblsl"; private const string LIB_LSL_NAME = "liblsl";
private const string PLUGIN_DIR = "Plugins"; 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> /// <summary> Called after the build. See also <see cref="PostProcessBuildAttribute"/>. </summary>
/// <param name="target"> The build target. </param> /// <param name="target"> The build target. </param>
...@@ -26,16 +29,16 @@ public class BuildHooks ...@@ -26,16 +29,16 @@ public class BuildHooks
switch (target) switch (target)
{ {
case BuildTarget.StandaloneWindows: 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; break;
case BuildTarget.StandaloneWindows64: 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; break;
case BuildTarget.StandaloneLinux64: 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; break;
case BuildTarget.StandaloneOSX: 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; break;
} }
} }
...@@ -46,16 +49,18 @@ public class BuildHooks ...@@ -46,16 +49,18 @@ public class BuildHooks
/// <param name="srcName"> Name of the source file. </param> /// <param name="srcName"> Name of the source file. </param>
/// <param name="oldName"> Name of the old. </param> /// <param name="oldName"> Name of the old. </param>
/// <param name="extension"> The extension. </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); var oldDir = Path.Combine(pluginDir, subDir);
Debug.Log("[LSL BUILD Hook] Delete obsolete file: " + oldFile); var oldFile = Path.Combine(oldDir, oldName + extension);
File.Delete(oldFile); 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); var srcFile = Path.Combine(oldDir, srcName + extension);
Debug.Log($"[LSL BUILD Hook] Renaming: {srcFile} to {dstFile}"); var dstFile = Path.Combine(pluginDir, LIB_LSL_NAME + extension);
File.Move(srcFile, dstFile); 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