netpyoung / unity.webp

:art: WebP made easy for Unity3d
https://netpyoung.github.io/unity.webp/
MIT License
237 stars 28 forks source link

Won't build for Linux platform #36

Closed LaserSaysPew closed 2 years ago

LaserSaysPew commented 2 years ago

Causes "Cannot build player while editor importing or compiling scripts" on pressing the build button for Linux. (works for Win and Mac) Same happens when trying to build the example project.

netpyoung commented 2 years ago

Thank you for reporting that I will check this

heeen commented 2 years ago
diff --git a/Assets/unity.webp/Runtime/NativeWrapper/Dec/Decode.cs b/Assets/unity.webp/Runtime/NativeWrapper/Dec/Decode.cs
index cb463333..07b13bf3 100755
--- a/Assets/unity.webp/Runtime/NativeWrapper/Dec/Decode.cs
+++ b/Assets/unity.webp/Runtime/NativeWrapper/Dec/Decode.cs
@@ -36,7 +36,7 @@ namespace WebP.NativeWrapper.Dec

 #if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
         const string DLL_NAME = "libwebp";
-#elif UNITY_EDITOR || UNITY_STANDALONE_OSX
+#elif UNITY_EDITOR || UNITY_STANDALONE_OSX || UNITY_STANDALONE_LINUX^M
         const string DLL_NAME = "webp";
 #elif UNITY_ANDROID
                const string DLL_NAME = "webp";
diff --git a/Assets/unity.webp/Runtime/NativeWrapper/Demux/Demux.cs b/Assets/unity.webp/Runtime/NativeWrapper/Demux/Demux.cs
index 0e8d3c8f..46fdeda0 100755
--- a/Assets/unity.webp/Runtime/NativeWrapper/Demux/Demux.cs
+++ b/Assets/unity.webp/Runtime/NativeWrapper/Demux/Demux.cs
@@ -11,7 +11,7 @@ namespace WebP.NativeWrapper.Demux
         public const int WEBP_DEMUX_ABI_VERSION = 0x0107;
 #if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
         const string DLL_NAME = "libwebpdemux";
-#elif UNITY_EDITOR || UNITY_STANDALONE_OSX
+#elif UNITY_EDITOR || UNITY_STANDALONE_OSX || UNITY_STANDALONE_LINUX^M
         const string DLL_NAME = "webpdemux";
 #elif UNITY_ANDROID
                const string DLL_NAME = "webpdemux";

this fixed it for me

heeen commented 2 years ago

I installed from the .unitypackage and the files seem to be organized differently in the git repo

netpyoung commented 2 years ago

Yes, this issue's problem caused by missing define flag what @heeen said.

I commited 218c6d2f3865992c73574dff0f815294d2852a48 then update release to 0.3.2