From 9876d86d5dcc50a2f8ccb1f09acb06d50d7857b9 Mon Sep 17 00:00:00 2001 From: bosnichd Date: Fri, 27 Aug 2021 11:33:28 -0600 Subject: [PATCH] Fix two compilation errors exposed when enabling tools support for any restricted platform. (#3633) * Various fixes and empty boilerplate files required for restricted platforms. Signed-off-by: bosnichd * Add comments to address review feedback. Signed-off-by: bosnichd * Fix two compilation errors exposed when enabling tools support for any restricted platform. - The simple one: remove menu commands that call OnChangeGameSpec (which has since been removed) from CryEdit.cpp - The "I almost threw my computer out the window" one: pull PVRTC.cpp out of unity builds, because it indirectly #includes winnt.h, which typedefs wchar_t WCHAR, which causes a complilation error (Error C2632 'wchar_t' followed by 'wchar_t' is illegal ImageProcessingAtom.Editor.Static C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winnt.h 471) if something else in the unity file has also happened to define WCHAR as wchar_t. Enabling tools support for any restricted platform resulted in this happening due to different compile definitions being set for ImageConvert.cpp and BuilderSettingManager.cpp (see Gems/Atom/Asset/ImageProcessingAtom/Code/CMakeLists.txt), which resulted in those two files being pulled out of unity builds, which resulted in the entirely unrelated PVRTC.cpp file being moved from the first thing included by a unity file to the second last thing included by a different unity file, that just happened to include something else (prior to PVRTC.cpp) which was defining WCHAR as wchar_t. Signed-off-by: bosnichd --- Code/Editor/CryEdit.cpp | 7 ------- .../ImageProcessingAtom/Code/imageprocessing_files.cmake | 4 ++++ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Code/Editor/CryEdit.cpp b/Code/Editor/CryEdit.cpp index f0cc5c6264..ca139cc506 100644 --- a/Code/Editor/CryEdit.cpp +++ b/Code/Editor/CryEdit.cpp @@ -447,13 +447,6 @@ void CCryEditApp::RegisterActionHandlers() ON_COMMAND(ID_OPEN_TRACKVIEW, OnOpenTrackView) ON_COMMAND(ID_OPEN_UICANVASEDITOR, OnOpenUICanvasEditor) -#if defined(AZ_TOOLS_EXPAND_FOR_RESTRICTED_PLATFORMS) -#define AZ_RESTRICTED_PLATFORM_EXPANSION(CodeName, CODENAME, codename, PrivateName, PRIVATENAME, privatename, PublicName, PUBLICNAME, publicname, PublicAuxName1, PublicAuxName2, PublicAuxName3)\ - ON_COMMAND_RANGE(ID_GAME_##CODENAME##_ENABLELOWSPEC, ID_GAME_##CODENAME##_ENABLEHIGHSPEC, OnChangeGameSpec) - AZ_TOOLS_EXPAND_FOR_RESTRICTED_PLATFORMS -#undef AZ_RESTRICTED_PLATFORM_EXPANSION -#endif - ON_COMMAND(ID_OPEN_QUICK_ACCESS_BAR, OnOpenQuickAccessBar) ON_COMMAND(ID_FILE_SAVE_LEVEL, OnFileSave) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/imageprocessing_files.cmake b/Gems/Atom/Asset/ImageProcessingAtom/Code/imageprocessing_files.cmake index 55ccdf1d89..29f7a9ca57 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/imageprocessing_files.cmake +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/imageprocessing_files.cmake @@ -136,3 +136,7 @@ set(FILES Source/Thumbnail/ImageThumbnailSystemComponent.cpp Source/Thumbnail/ImageThumbnailSystemComponent.h ) + +set(SKIP_UNITY_BUILD_INCLUSION_FILES + Source/Compressors/PVRTC.cpp +)