From b06583745058ced12c325350552489c91149ae98 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 27 Aug 2021 17:44:08 -0700 Subject: [PATCH] Fix for non-unity file and double declaration of WCHAR (#3657) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Atom/Asset/ImageProcessingAtom/Code/CMakeLists.txt | 2 +- .../Code/Source/Compressors/Compressor.cpp | 1 + .../Code/Source/Compressors/PVRTC.cpp | 10 +--------- .../Code/imageprocessing_files.cmake | 4 ---- .../External/CubeMapGen/CCubeMapProcessor.h | 7 +++---- .../External/CubeMapGen/CImageSurface.h | 5 +++-- 6 files changed, 9 insertions(+), 20 deletions(-) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/CMakeLists.txt b/Gems/Atom/Asset/ImageProcessingAtom/Code/CMakeLists.txt index 6227d74d7e..dfeee011cc 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/CMakeLists.txt +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/CMakeLists.txt @@ -48,7 +48,7 @@ ly_add_target( PLATFORM_INCLUDE_FILES ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake ${common_source_dir}/${PAL_TRAIT_COMPILER_ID}/imageprocessingatom_editor_static_${PAL_TRAIT_COMPILER_ID_LOWERCASE}.cmake - ${platform_tools_files} + ${platform_tools_files} INCLUDE_DIRECTORIES PUBLIC Include diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/Compressor.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/Compressor.cpp index 2cd7ff0e9b..9013bff1db 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/Compressor.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/Compressor.cpp @@ -7,6 +7,7 @@ */ +#include #include #include #include diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/PVRTC.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/PVRTC.cpp index 0002ff4678..7c899e4ad2 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/PVRTC.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/PVRTC.cpp @@ -7,20 +7,12 @@ */ #include +#include #include #include #include #include -#if AZ_TRAIT_IMAGEPROCESSING_PVRTEXLIB_USE_WINDLL_IMPORT -//_WINDLL_IMPORT need to be defined before including PVRTexLib header files to avoid linking error on windows. -#define _WINDLL_IMPORT -// NOMINMAX needs to be defined before including PVRTexLib header files (which include Windows.h) -// so that Windows.h doesn't define min/max. Otherwise, a compile error may arise in Uber builds -#ifndef NOMINMAX -#define NOMINMAX -#endif -#endif #include #include diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/imageprocessing_files.cmake b/Gems/Atom/Asset/ImageProcessingAtom/Code/imageprocessing_files.cmake index 29f7a9ca57..55ccdf1d89 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/imageprocessing_files.cmake +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/imageprocessing_files.cmake @@ -136,7 +136,3 @@ set(FILES Source/Thumbnail/ImageThumbnailSystemComponent.cpp Source/Thumbnail/ImageThumbnailSystemComponent.h ) - -set(SKIP_UNITY_BUILD_INCLUSION_FILES - Source/Compressors/PVRTC.cpp -) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/External/CubeMapGen/CCubeMapProcessor.h b/Gems/Atom/Asset/ImageProcessingAtom/External/CubeMapGen/CCubeMapProcessor.h index 4a29e8621a..c78bfcfec6 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/External/CubeMapGen/CCubeMapProcessor.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/External/CubeMapGen/CCubeMapProcessor.h @@ -14,6 +14,7 @@ #include #include #include +#include #include "VectorMacros.h" #include "CBBoxInt32.h" @@ -22,11 +23,9 @@ //has routines for saving .rgbe files #define CG_RGBE_SUPPORT - -#ifndef WCHAR +#ifndef WCHAR // For non-windows platforms, for Windows-based platforms it will be defined through PlatformIncl.h #define WCHAR wchar_t -#endif //WCHAR - +#endif // WCHAR //used to index cube faces #define CP_FACE_X_POS 0 diff --git a/Gems/Atom/Asset/ImageProcessingAtom/External/CubeMapGen/CImageSurface.h b/Gems/Atom/Asset/ImageProcessingAtom/External/CubeMapGen/CImageSurface.h index 848cbd1dbe..bbc41e756c 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/External/CubeMapGen/CImageSurface.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/External/CubeMapGen/CImageSurface.h @@ -14,10 +14,11 @@ #include "VectorMacros.h" #include +#include -#ifndef WCHAR +#ifndef WCHAR // For non-windows platforms, for Windows-based platforms it will be defined through PlatformIncl.h #define WCHAR wchar_t -#endif //WCHAR +#endif // WCHAR #ifndef SAFE_DELETE #define SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } }