From 47725e72060d07751528409cf73b349a30566bcd Mon Sep 17 00:00:00 2001
From: Weichao Qiu <qiuwch@gmail.com>
Date: Sat, 3 Sep 2016 16:25:08 -0400
Subject: [PATCH] Fix openexr support for linux version.

---
 .../Runtime/ImageWrapper/ImageWrapper.Build.cs       |   2 +-
 .../openexr/Deploy/lib/Linux/StaticRelease/libHalf.a | Bin 0 -> 311628 bytes
 .../openexr/Deploy/lib/Linux/StaticRelease/libIex.a  | Bin 0 -> 916978 bytes
 .../Deploy/lib/Linux/StaticRelease/libIexMath.a      | Bin 0 -> 129762 bytes
 .../Deploy/lib/Linux/StaticRelease/libIlmImf.a       | Bin 0 -> 14067028 bytes
 .../Deploy/lib/Linux/StaticRelease/libIlmThread.a    | Bin 0 -> 350612 bytes
 .../Deploy/lib/Linux/StaticRelease/libImath.a        | Bin 0 -> 1176140 bytes
 Engine/Source/ThirdParty/openexr/UEOpenExr.Build.cs  |   8 ++++++--
 8 files changed, 7 insertions(+), 3 deletions(-)
 create mode 100644 Engine/Source/ThirdParty/openexr/Deploy/lib/Linux/StaticRelease/libHalf.a
 create mode 100644 Engine/Source/ThirdParty/openexr/Deploy/lib/Linux/StaticRelease/libIex.a
 create mode 100644 Engine/Source/ThirdParty/openexr/Deploy/lib/Linux/StaticRelease/libIexMath.a
 create mode 100644 Engine/Source/ThirdParty/openexr/Deploy/lib/Linux/StaticRelease/libIlmImf.a
 create mode 100644 Engine/Source/ThirdParty/openexr/Deploy/lib/Linux/StaticRelease/libIlmThread.a
 create mode 100644 Engine/Source/ThirdParty/openexr/Deploy/lib/Linux/StaticRelease/libImath.a

diff --git a/Engine/Source/Runtime/ImageWrapper/ImageWrapper.Build.cs b/Engine/Source/Runtime/ImageWrapper/ImageWrapper.Build.cs
index f1e83d1..27b7b74 100644
--- a/Engine/Source/Runtime/ImageWrapper/ImageWrapper.Build.cs
+++ b/Engine/Source/Runtime/ImageWrapper/ImageWrapper.Build.cs
@@ -20,7 +20,7 @@ public class ImageWrapper : ModuleRules
 			);
 
         // Add openEXR lib for windows builds.
-        if (Target.Platform == UnrealTargetPlatform.Win64 || Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Mac)
+        if (Target.Platform == UnrealTargetPlatform.Win64 || Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Mac || Target.Platform == UnrealTargetPlatform.Linux)
         {
             Definitions.Add("WITH_UNREALEXR=1");
             AddEngineThirdPartyPrivateStaticDependencies(Target, "UEOpenExr");
diff --git a/Engine/Source/ThirdParty/openexr/Deploy/lib/Linux/StaticRelease/libHalf.a b/Engine/Source/ThirdParty/openexr/Deploy/lib/Linux/StaticRelease/libHalf.a
new file mode 100644
index 0000000000000000000000000000000000000000..a5e71735fefc783b047e23694d3ed6edf386d542
GIT binary patch
diff --git a/Engine/Source/ThirdParty/openexr/Deploy/lib/Linux/StaticRelease/libIex.a b/Engine/Source/ThirdParty/openexr/Deploy/lib/Linux/StaticRelease/libIex.a
new file mode 100644
index 0000000000000000000000000000000000000000..695b50a183daa51d179e70a368387bae4247fcee
GIT binary patch
diff --git a/Engine/Source/ThirdParty/openexr/Deploy/lib/Linux/StaticRelease/libIexMath.a b/Engine/Source/ThirdParty/openexr/Deploy/lib/Linux/StaticRelease/libIexMath.a
new file mode 100644
index 0000000000000000000000000000000000000000..58c44ed951aa0d39a84b8939280219e397eb2e7e
GIT binary patch
diff --git a/Engine/Source/ThirdParty/openexr/Deploy/lib/Linux/StaticRelease/libIlmImf.a b/Engine/Source/ThirdParty/openexr/Deploy/lib/Linux/StaticRelease/libIlmImf.a
new file mode 100644
index 0000000000000000000000000000000000000000..76e9a5904e7570b09de23f6a8afcdcbe12a15d52
GIT binary patch
diff --git a/Engine/Source/ThirdParty/openexr/Deploy/lib/Linux/StaticRelease/libIlmThread.a b/Engine/Source/ThirdParty/openexr/Deploy/lib/Linux/StaticRelease/libIlmThread.a
new file mode 100644
index 0000000000000000000000000000000000000000..0aaed675babcea7361fe179c131067af6d54ceaf
GIT binary patch
diff --git a/Engine/Source/ThirdParty/openexr/Deploy/lib/Linux/StaticRelease/libImath.a b/Engine/Source/ThirdParty/openexr/Deploy/lib/Linux/StaticRelease/libImath.a
new file mode 100644
index 0000000000000000000000000000000000000000..ba4dd6ad712640e17a32c0f644b380adc4d4a688
GIT binary patch
diff --git a/Engine/Source/ThirdParty/openexr/UEOpenExr.Build.cs b/Engine/Source/ThirdParty/openexr/UEOpenExr.Build.cs
index 9d07fca..fc68e53 100644
--- a/Engine/Source/ThirdParty/openexr/UEOpenExr.Build.cs
+++ b/Engine/Source/ThirdParty/openexr/UEOpenExr.Build.cs
@@ -7,7 +7,7 @@ public class UEOpenExr : ModuleRules
     public UEOpenExr(TargetInfo Target)
     {
         Type = ModuleType.External;
-        if (Target.Platform == UnrealTargetPlatform.Win64 || Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Mac)
+        if (Target.Platform == UnrealTargetPlatform.Win64 || Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Mac || Target.Platform == UnrealTargetPlatform.Linux)
         {
             bool bDebug = (Target.Configuration == UnrealTargetConfiguration.Debug && BuildConfiguration.bDebugBuildsActuallyUseDebugCRT);
             string LibDir = UEBuildConfiguration.UEThirdPartySourceDirectory + "openexr/Deploy/lib/";
@@ -26,6 +26,10 @@ public class UEOpenExr : ModuleRules
                     Platform = "Mac";
                     bDebug = false;
                     break;
+                case UnrealTargetPlatform.Linux:
+                    Platform = "Linux";
+                    bDebug = false;
+                    break;
                 default:
                     return;
             }
@@ -45,7 +49,7 @@ public class UEOpenExr : ModuleRules
 					}
 				);
 			}
-			else if (Target.Platform == UnrealTargetPlatform.Mac)
+			else if (Target.Platform == UnrealTargetPlatform.Mac || Target.Platform == UnrealTargetPlatform.Linux)
 			{
 				PublicAdditionalLibraries.AddRange(
 					new string[] {
-- 
1.9.1

