UnrealImGui/Source/ImGui/ImGui.Build.cs
kkawachi 5e4b7084de Fixed build errors when the plugin is placed in the engine directory. (#19)
Merged 4 commits fixing build errors when compiling this as an engine plugin:
- Changed include directives to use full paths (ex. <ICursor.h> -> <GenericPlatform/ICursor.h>).
- Added categories to FImGuiKeyInfo properties (required for all blueprint exposed types in engine plugins).
- Added explicit configuration of PCHUsage (without that it is assumed to be UseExplicitOrSharedPCHs in engine plugins and UseSharedPCHs in game ones) - amended to work also in the older engine versions.
2019-07-27 18:45:25 +01:00

101 lines
2.2 KiB
C#

// Distributed under the MIT License (MIT) (see accompanying LICENSE file)
using System.Collections.Generic;
using System.IO;
using UnrealBuildTool;
public class ImGui : ModuleRules
{
#if WITH_FORWARDED_MODULE_RULES_CTOR
public ImGui(ReadOnlyTargetRules Target) : base(Target)
#else
public ImGui(TargetInfo Target)
#endif
{
#if WITH_FORWARDED_MODULE_RULES_CTOR
bool bBuildEditor = Target.bBuildEditor;
#else
bool bBuildEditor = (Target.Type == TargetRules.TargetType.Editor);
#endif
// Developer modules are automatically loaded only in editor builds but can be stripped out from other builds.
// Enable runtime loader, if you want this module to be automatically loaded in runtime builds (monolithic).
bool bEnableRuntimeLoader = true;
PCHUsage = PCHUsageMode.UseSharedPCHs;
#if UE_4_21_OR_LATER
PrivatePCHHeaderFile = "Private/ImGuiPrivatePCH.h";
#endif
PublicIncludePaths.AddRange(
new string[] {
Path.Combine(ModuleDirectory, "../ThirdParty/ImGuiLibrary/Include"),
Path.Combine(ModuleDirectory, "../ThirdParty/ImGuiLibrary/Include/misc/stl")
// ... add public include paths required here ...
}
);
PrivateIncludePaths.AddRange(
new string[] {
"ImGui/Private",
"ThirdParty/ImGuiLibrary/Private"
// ... add other private include paths required here ...
}
);
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
"Projects"
// ... add other public dependencies that you statically link with here ...
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"CoreUObject",
"Engine",
"InputCore",
"Slate",
"SlateCore"
// ... add private dependencies that you statically link with here ...
}
);
if (bBuildEditor)
{
PrivateDependencyModuleNames.AddRange(
new string[]
{
"EditorStyle",
"Settings",
"UnrealEd",
}
);
}
DynamicallyLoadedModuleNames.AddRange(
new string[]
{
// ... add any modules that your module loads dynamically here ...
}
);
#if !UE_4_19_OR_LATER
List<string> PrivateDefinitions = Definitions;
#endif
PrivateDefinitions.Add(string.Format("RUNTIME_LOADER_ENABLED={0}", bEnableRuntimeLoader ? 1 : 0));
}
}