From 5e4b7084def0dbe59d9e9ee013eced797f90d9b3 Mon Sep 17 00:00:00 2001 From: kkawachi Date: Sun, 28 Jul 2019 02:06:29 +0900 Subject: [PATCH] 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. -> ). - 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. --- Source/ImGui/ImGui.Build.cs | 2 ++ Source/ImGui/Private/ImGuiContextProxy.h | 2 +- Source/ImGui/Private/ImGuiImplementation.cpp | 6 +++--- Source/ImGui/Private/ImGuiInputHandler.cpp | 6 +++--- Source/ImGui/Private/ImGuiInteroperability.h | 2 +- Source/ImGui/Private/ImGuiModule.cpp | 2 +- Source/ImGui/Private/ImGuiModuleCommands.h | 2 +- Source/ImGui/Private/ImGuiModuleManager.cpp | 2 +- Source/ImGui/Private/ImGuiModuleSettings.h | 10 +++++----- Source/ImGui/Public/ImGuiModule.h | 2 +- 10 files changed, 19 insertions(+), 17 deletions(-) diff --git a/Source/ImGui/ImGui.Build.cs b/Source/ImGui/ImGui.Build.cs index 550d943..9a565a3 100644 --- a/Source/ImGui/ImGui.Build.cs +++ b/Source/ImGui/ImGui.Build.cs @@ -23,6 +23,8 @@ public class ImGui : ModuleRules // 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 diff --git a/Source/ImGui/Private/ImGuiContextProxy.h b/Source/ImGui/Private/ImGuiContextProxy.h index b03e539..2d3e738 100644 --- a/Source/ImGui/Private/ImGuiContextProxy.h +++ b/Source/ImGui/Private/ImGuiContextProxy.h @@ -6,7 +6,7 @@ #include "ImGuiInputState.h" #include "Utilities/WorldContextIndex.h" -#include +#include #include diff --git a/Source/ImGui/Private/ImGuiImplementation.cpp b/Source/ImGui/Private/ImGuiImplementation.cpp index c8ccb9a..24ba700 100644 --- a/Source/ImGui/Private/ImGuiImplementation.cpp +++ b/Source/ImGui/Private/ImGuiImplementation.cpp @@ -25,7 +25,7 @@ ImGuiContext** GImGuiContextPtrHandle = &GImGuiContextPtr; #endif // WITH_EDITOR #if PLATFORM_WINDOWS -#include +#include #endif // PLATFORM_WINDOWS #include "imgui.cpp" @@ -35,7 +35,7 @@ ImGuiContext** GImGuiContextPtrHandle = &GImGuiContextPtr; #include "misc/stl/imgui_stl.cpp" #if PLATFORM_WINDOWS -#include +#include #endif // PLATFORM_WINDOWS #include "ImGuiInteroperability.h" @@ -54,4 +54,4 @@ namespace ImGuiImplementation GImGuiContextPtrHandle = Handle; } #endif // WITH_EDITOR -} \ No newline at end of file +} diff --git a/Source/ImGui/Private/ImGuiInputHandler.cpp b/Source/ImGui/Private/ImGuiInputHandler.cpp index a57cde1..3a13f1d 100644 --- a/Source/ImGui/Private/ImGuiInputHandler.cpp +++ b/Source/ImGui/Private/ImGuiInputHandler.cpp @@ -13,9 +13,9 @@ #include #if WITH_EDITOR -#include -#include -#include +#include +#include +#include #endif // WITH_EDITOR diff --git a/Source/ImGui/Private/ImGuiInteroperability.h b/Source/ImGui/Private/ImGuiInteroperability.h index c53ee69..c09cf71 100644 --- a/Source/ImGui/Private/ImGuiInteroperability.h +++ b/Source/ImGui/Private/ImGuiInteroperability.h @@ -4,7 +4,7 @@ #include "TextureManager.h" -#include +#include #include diff --git a/Source/ImGui/Private/ImGuiModule.cpp b/Source/ImGui/Private/ImGuiModule.cpp index 92b5d1a..caa0c79 100644 --- a/Source/ImGui/Private/ImGuiModule.cpp +++ b/Source/ImGui/Private/ImGuiModule.cpp @@ -15,7 +15,7 @@ #include "Editor/ImGuiEditor.h" #endif -#include +#include #define IMGUI_REDIRECT_OBSOLETE_DELEGATES 1 diff --git a/Source/ImGui/Private/ImGuiModuleCommands.h b/Source/ImGui/Private/ImGuiModuleCommands.h index 7ecb3e4..0e77d01 100644 --- a/Source/ImGui/Private/ImGuiModuleCommands.h +++ b/Source/ImGui/Private/ImGuiModuleCommands.h @@ -2,7 +2,7 @@ #pragma once -#include +#include struct FImGuiKeyInfo; diff --git a/Source/ImGui/Private/ImGuiModuleManager.cpp b/Source/ImGui/Private/ImGuiModuleManager.cpp index 171dec7..87e234b 100644 --- a/Source/ImGui/Private/ImGuiModuleManager.cpp +++ b/Source/ImGui/Private/ImGuiModuleManager.cpp @@ -7,7 +7,7 @@ #include "ImGuiInteroperability.h" #include "Utilities/WorldContextIndex.h" -#include +#include #include diff --git a/Source/ImGui/Private/ImGuiModuleSettings.h b/Source/ImGui/Private/ImGuiModuleSettings.h index df0d9b4..a58b8a5 100644 --- a/Source/ImGui/Private/ImGuiModuleSettings.h +++ b/Source/ImGui/Private/ImGuiModuleSettings.h @@ -17,19 +17,19 @@ struct FImGuiKeyInfo { GENERATED_BODY() - UPROPERTY(EditAnywhere) + UPROPERTY(EditAnywhere, Category = "Input") FKey Key; - UPROPERTY(EditAnywhere) + UPROPERTY(EditAnywhere, Category = "Input") ECheckBoxState Shift = ECheckBoxState::Undetermined; - UPROPERTY(EditAnywhere) + UPROPERTY(EditAnywhere, Category = "Input") ECheckBoxState Ctrl = ECheckBoxState::Undetermined; - UPROPERTY(EditAnywhere) + UPROPERTY(EditAnywhere, Category = "Input") ECheckBoxState Alt = ECheckBoxState::Undetermined; - UPROPERTY(EditAnywhere) + UPROPERTY(EditAnywhere, Category = "Input") ECheckBoxState Cmd = ECheckBoxState::Undetermined; friend bool operator==(const FImGuiKeyInfo& Lhs, const FImGuiKeyInfo& Rhs) diff --git a/Source/ImGui/Public/ImGuiModule.h b/Source/ImGui/Public/ImGuiModule.h index e8c6f42..1bc2b75 100644 --- a/Source/ImGui/Public/ImGuiModule.h +++ b/Source/ImGui/Public/ImGuiModule.h @@ -6,7 +6,7 @@ #include "ImGuiModuleProperties.h" #include "ImGuiTextureHandle.h" -#include +#include class FImGuiModule : public IModuleInterface