From 2d2a7f4623655d52df98d4a0fc50c915f47f07d9 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 1 Sep 2021 08:19:08 -0700 Subject: [PATCH] XCode doesnt support files per configuration, using the old method (#3789) - some warn fixes - fixed release linking issue Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Editor/IEditorImpl.cpp | 8 --- .../AzFramework/API/ApplicationAPI.h | 3 - Code/Legacy/CryCommon/AppleSpecific.h | 4 -- Code/Legacy/CryCommon/IConsole.h | 4 -- .../AssetProcessingStateDataUnitTests.cpp | 7 +-- .../native/utilities/assetUtils.cpp | 3 - .../Animation/UiAnimViewCurveEditor.cpp | 2 +- .../Editor/Animation/UiAnimViewDialog.cpp | 2 +- .../Animation/UiAnimViewDopeSheetBase.cpp | 2 +- .../Code/Editor/Animation/UiAnimViewNodes.cpp | 2 +- .../Editor/Animation/UiAnimViewSplineCtrl.cpp | 2 +- cmake/LYWrappers.cmake | 58 ++++++++++++------- 12 files changed, 43 insertions(+), 54 deletions(-) diff --git a/Code/Editor/IEditorImpl.cpp b/Code/Editor/IEditorImpl.cpp index 8f4abae9dd..880773966b 100644 --- a/Code/Editor/IEditorImpl.cpp +++ b/Code/Editor/IEditorImpl.cpp @@ -84,12 +84,6 @@ AZ_POP_DISABLE_WARNING #include "IEditorPanelUtils.h" #include "EditorPanelUtils.h" - -// even in Release mode, the editor will return its heap, because there's no Profile build configuration for the editor -#ifdef _RELEASE -#undef _RELEASE -#endif - #include "Core/QtEditorApplication.h" // for Editor::EditorQtApplication static CCryEditDoc * theDocument; @@ -104,8 +98,6 @@ static CCryEditDoc * theDocument; #define VERIFY(EXPRESSION) { auto e = EXPRESSION; assert(e); } #endif -#undef GetCommandLine - const char* CEditorImpl::m_crashLogFileName = "SessionStatus/editor_statuses.json"; CEditorImpl::CEditorImpl() diff --git a/Code/Framework/AzFramework/AzFramework/API/ApplicationAPI.h b/Code/Framework/AzFramework/AzFramework/API/ApplicationAPI.h index 11778b9239..dbbf443656 100644 --- a/Code/Framework/AzFramework/AzFramework/API/ApplicationAPI.h +++ b/Code/Framework/AzFramework/AzFramework/API/ApplicationAPI.h @@ -72,11 +72,8 @@ namespace AzFramework /// Retrieves the app root path for the application. virtual const char* GetAppRoot() const { return nullptr; } -#pragma push_macro("GetCommandLine") -#undef GetCommandLine /// Get the Command Line arguments passed in. virtual const CommandLine* GetCommandLine() { return nullptr; } -#pragma pop_macro("GetCommandLine") /// Get the Command Line arguments passed in. (Avoids collisions with platform specific macros.) virtual const CommandLine* GetApplicationCommandLine() { return nullptr; } diff --git a/Code/Legacy/CryCommon/AppleSpecific.h b/Code/Legacy/CryCommon/AppleSpecific.h index 60ab80ade6..e4c4fadb89 100644 --- a/Code/Legacy/CryCommon/AppleSpecific.h +++ b/Code/Legacy/CryCommon/AppleSpecific.h @@ -13,10 +13,6 @@ #define CRYINCLUDE_CRYCOMMON_APPLESPECIFIC_H #pragma once -#if defined(__clang__) -#pragma diagnostic ignore "-W#pragma-messages" -#endif - ////////////////////////////////////////////////////////////////////////// // Standard includes. ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Legacy/CryCommon/IConsole.h b/Code/Legacy/CryCommon/IConsole.h index dcbb0399aa..f68a82f9dc 100644 --- a/Code/Legacy/CryCommon/IConsole.h +++ b/Code/Legacy/CryCommon/IConsole.h @@ -118,10 +118,6 @@ struct IConsoleVarSink // }; -#if defined(GetCommandLine) -#undef GetCommandLine -#endif - // Interface to the arguments of the console command. struct IConsoleCmdArgs { diff --git a/Code/Tools/AssetProcessor/native/unittests/AssetProcessingStateDataUnitTests.cpp b/Code/Tools/AssetProcessor/native/unittests/AssetProcessingStateDataUnitTests.cpp index 1c9e29c4e8..e19b95a76b 100644 --- a/Code/Tools/AssetProcessor/native/unittests/AssetProcessingStateDataUnitTests.cpp +++ b/Code/Tools/AssetProcessor/native/unittests/AssetProcessingStateDataUnitTests.cpp @@ -715,12 +715,7 @@ void AssetProcessingStateDataUnitTest::DataTest(AssetProcessor::AssetDatabaseCon //try retrieving this source by id UNIT_TEST_EXPECT_TRUE(stateData->GetJobByJobID(job.m_jobID, job)); - if (job.m_jobID == AzToolsFramework::AssetDatabase::InvalidEntryId || - job.m_jobID != job.m_jobID || - job.m_sourcePK != job.m_sourcePK || - job.m_jobKey != job.m_jobKey || - job.m_fingerprint != job.m_fingerprint || - job.m_platform != job.m_platform) + if (job.m_jobID == AzToolsFramework::AssetDatabase::InvalidEntryId) { Q_EMIT UnitTestFailed("AssetProcessingStateDataTest Failed - GetJobByJobID failed"); return; diff --git a/Code/Tools/AssetProcessor/native/utilities/assetUtils.cpp b/Code/Tools/AssetProcessor/native/utilities/assetUtils.cpp index 7292990a72..85801bdf8a 100644 --- a/Code/Tools/AssetProcessor/native/utilities/assetUtils.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/assetUtils.cpp @@ -57,9 +57,6 @@ #include -// windows headers bring in a macro which conflicts GetCommandLine -#undef GetCommandLine - namespace AssetUtilsInternal { static const unsigned int g_RetryWaitInterval = 250; // The amount of time that we are waiting for retry. diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewCurveEditor.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewCurveEditor.cpp index 51209c7f02..d677acea02 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewCurveEditor.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewCurveEditor.cpp @@ -8,7 +8,7 @@ #include "EditorDefs.h" -#include "Resource.h" +#include "Editor/Resource.h" #include "UiEditorAnimationBus.h" #include "UiAnimViewCurveEditor.h" diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewDialog.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewDialog.cpp index a9f76cd443..e6c2dda74c 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewDialog.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewDialog.cpp @@ -15,7 +15,7 @@ // ----- End UI_ANIMATION_REVISIT #include "EditorDefs.h" -#include "Resource.h" +#include "Editor/Resource.h" #include "UiAnimViewDialog.h" diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewDopeSheetBase.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewDopeSheetBase.cpp index 8672f539bf..9f67503b73 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewDopeSheetBase.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewDopeSheetBase.cpp @@ -8,7 +8,7 @@ #include "EditorDefs.h" -#include "Resource.h" +#include "Editor/Resource.h" #include "UiEditorAnimationBus.h" #include "UiAnimViewDopeSheetBase.h" diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewNodes.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewNodes.cpp index 472100b334..a3aa330dca 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewNodes.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewNodes.cpp @@ -8,7 +8,7 @@ #include "EditorDefs.h" -#include "Resource.h" +#include "Editor/Resource.h" #include "UiEditorAnimationBus.h" #include "UiAnimViewNodes.h" #include "UiAnimViewDopeSheetBase.h" diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplineCtrl.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplineCtrl.cpp index e071a3e631..61610e3c8e 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplineCtrl.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplineCtrl.cpp @@ -9,7 +9,7 @@ #include "UiEditorAnimationBus.h" #include "EditorDefs.h" -#include "Resource.h" +#include "Editor/Resource.h" #include "UiAnimViewSequenceManager.h" #include "UiAnimViewSplineCtrl.h" #include "UiAnimViewSequence.h" diff --git a/cmake/LYWrappers.cmake b/cmake/LYWrappers.cmake index 3dfef0bbbf..53895c300f 100644 --- a/cmake/LYWrappers.cmake +++ b/cmake/LYWrappers.cmake @@ -330,28 +330,44 @@ function(ly_add_target) set(runtime_dependencies_list SHARED MODULE EXECUTABLE APPLICATION) if(NOT ly_add_target_IMPORTED AND linking_options IN_LIST runtime_dependencies_list) - # the stamp file will be the one that triggers the execution of the custom rule. At the end - # of running the copy of runtime dependencies, the stamp file is touched so the timestamp is updated. - # Adding a config as part of the name since the stamp file is added to the VS project. - # Note the STAMP_OUTPUT_FILE need to match with the one used in runtime dependencies (e.g. RuntimeDependencies_common.cmake) - set(STAMP_OUTPUT_FILE ${CMAKE_BINARY_DIR}/runtime_dependencies/$/${ly_add_target_NAME}_$.stamp) - add_custom_command( - OUTPUT ${STAMP_OUTPUT_FILE} - DEPENDS "$>" - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/runtime_dependencies/$/${ly_add_target_NAME}.cmake - COMMENT "Copying ${ly_add_target_NAME} runtime dependencies to output..." - VERBATIM - ) + # XCode generator doesnt support different source files per configuration, so we cannot have + # the runtime dependencies using file-tracking, instead, we will have them as a post build step + if(CMAKE_GENERATOR MATCHES Xcode) + + add_custom_command(TARGET ${ly_add_target_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/runtime_dependencies/$/${ly_add_target_NAME}.cmake + COMMENT "Copying ${ly_add_target_NAME} runtime dependencies to output..." + DEPENDS ${CMAKE_BINARY_DIR}/runtime_dependencies/${ly_add_target_NAME}.cmake + COMMENT "Copying runtime dependencies..." + VERBATIM + ) - # Unfortunately the VS generator cannot deal with generation expressions as part of the file name, wrapping the - # stamp file on each configuration so it gets properly excluded by the generator - unset(stamp_files_per_config) - foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES) - set(stamp_file_conf ${CMAKE_BINARY_DIR}/runtime_dependencies/${conf}/${ly_add_target_NAME}_${conf}.stamp) - set_source_files_properties(${stamp_file_conf} PROPERTIES GENERATED TRUE SKIP_AUTOGEN TRUE) - list(APPEND stamp_files_per_config $<$:${stamp_file_conf}>) - endforeach() - target_sources(${ly_add_target_NAME} PRIVATE ${stamp_files_per_config}) + else() + + # the stamp file will be the one that triggers the execution of the custom rule. At the end + # of running the copy of runtime dependencies, the stamp file is touched so the timestamp is updated. + # Adding a config as part of the name since the stamp file is added to the VS project. + # Note the STAMP_OUTPUT_FILE need to match with the one used in runtime dependencies (e.g. RuntimeDependencies_common.cmake) + set(STAMP_OUTPUT_FILE ${CMAKE_BINARY_DIR}/runtime_dependencies/$/${ly_add_target_NAME}_$.stamp) + add_custom_command( + OUTPUT ${STAMP_OUTPUT_FILE} + DEPENDS "$>" + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/runtime_dependencies/$/${ly_add_target_NAME}.cmake + COMMENT "Copying ${ly_add_target_NAME} runtime dependencies to output..." + VERBATIM + ) + + # Unfortunately the VS generator cannot deal with generation expressions as part of the file name, wrapping the + # stamp file on each configuration so it gets properly excluded by the generator + unset(stamp_files_per_config) + foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES) + set(stamp_file_conf ${CMAKE_BINARY_DIR}/runtime_dependencies/${conf}/${ly_add_target_NAME}_${conf}.stamp) + set_source_files_properties(${stamp_file_conf} PROPERTIES GENERATED TRUE SKIP_AUTOGEN TRUE) + list(APPEND stamp_files_per_config $<$:${stamp_file_conf}>) + endforeach() + target_sources(${ly_add_target_NAME} PRIVATE ${stamp_files_per_config}) + + endif() endif()