Hello,
I need to change some target files depending on what platform/os I am running. Therefore I am trying to switch on Target.Platform in my ProjectName.build.cs but this doesn’t seem to work.
switch (Target.Platform)
{
// 64-bit Windows
case UnrealTargetPlatform.Win64:
PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "accidental-noise-library", "build", "ANL", "x64", "ANL.lib"));
break;
// 32-bit Windows
case UnrealTargetPlatform.Win32:
PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "accidental-noise-library", "build", "ANL", "x86", "ANL.lib"));
break;
// Mac
case UnrealTargetPlatform.Mac:
PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "accidental-noise-library", "build", "ANL", "Universal", "libANL.a"));
break;
// Linux
case UnrealTargetPlatform.Linux:
PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "accidental-noise-library", "build", "ANL", "x64", "libANL.a"));
break;
default:
break;
}
This returns me an error saying the case-variable (in my case Target.Platform) has to be of the type bool, string, char or anything that can be null.
Does anyone know a fix to this?
Thanks in advance!
Regards,
Stefan