WwiseSoundEngine_Null_OptionalModule.Build.cs 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*******************************************************************************
  2. The content of this file includes portions of the proprietary AUDIOKINETIC Wwise
  3. Technology released in source code form as part of the game integration package.
  4. The content of this file may not be used without valid licenses to the
  5. AUDIOKINETIC Wwise Technology.
  6. Note that the use of the game engine is subject to the Unreal(R) Engine End User
  7. License Agreement at https://www.unrealengine.com/en-US/eula/unreal
  8. License Usage
  9. Licensees holding valid licenses to the AUDIOKINETIC Wwise Technology may use
  10. this file in accordance with the end user license agreement provided with the
  11. software or, alternatively, in accordance with the terms contained
  12. in a written agreement between you and Audiokinetic Inc.
  13. Copyright (c) 2023 Audiokinetic Inc.
  14. *******************************************************************************/
  15. using UnrealBuildTool;
  16. using System.IO;
  17. using System.Linq;
  18. using System.Collections.Generic;
  19. public struct WwiseSoundEngine_Null
  20. {
  21. private static List<string> AkLibs = new List<string>
  22. {
  23. };
  24. public static void Apply(WwiseSoundEngine SE, ReadOnlyTargetRules Target)
  25. {
  26. var VersionNumber = "Null";
  27. var ModuleName = "WwiseSoundEngine_" + VersionNumber;
  28. var ModuleDirectory = Path.Combine(SE.ModuleDirectory, "../" + ModuleName);
  29. SE.AddSoundEngineDirectory("WwiseSoundEngine_" + VersionNumber, true);
  30. // If packaging as an Engine plugin, the UBT expects to already have a precompiled plugin available
  31. // This can be set to true so long as plugin was already precompiled
  32. SE.bUsePrecompiled = false;
  33. SE.bPrecompile = false;
  34. string ThirdPartyFolder = Path.Combine(SE.ModuleDirectory, "../../ThirdParty");
  35. var WwiseUEPlatformInstance = WwiseUEPlatform.GetWwiseUEPlatformInstance(Target, VersionNumber, ThirdPartyFolder);
  36. SE.PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
  37. SE.bAllowConfidentialPlatformDefines = true;
  38. foreach (var Platform in GetAvailablePlatforms(ModuleDirectory))
  39. {
  40. SE.ExternalDependencies.Add(string.Format("{0}/WwiseUEPlatform_{1}.Build.cs", ModuleDirectory, VersionNumber, Platform));
  41. }
  42. if (Target.bBuildEditor)
  43. {
  44. foreach (var Platform in GetAvailablePlatforms(ModuleDirectory))
  45. {
  46. SE.PublicDefinitions.Add("AK_PLATFORM_" + Platform.ToUpper());
  47. }
  48. }
  49. }
  50. private static List<string> GetAvailablePlatforms(string ModuleDir)
  51. {
  52. var FoundPlatforms = new List<string>();
  53. const string StartPattern = "WwiseUEPlatform_";
  54. const string EndPattern = ".Build.cs";
  55. foreach (var BuildCsFile in System.IO.Directory.GetFiles(ModuleDir, "*" + EndPattern))
  56. {
  57. if (BuildCsFile.Contains(StartPattern) && BuildCsFile.EndsWith(EndPattern))
  58. {
  59. var Platform = BuildCsFile.Remove(BuildCsFile.Length - EndPattern.Length).Split('_').Last();
  60. FoundPlatforms.Add(Platform);
  61. }
  62. }
  63. return FoundPlatforms;
  64. }
  65. }