소스 검색

Fixes compile errors and cmake errors for linux release (#17098)

Note that the change to UiBasics was that other things depend on
builders and tools in a non-tool environment.  Since the UiBasics
builders and tools don't contain any actual code or targets, the
dummy aliases are fine to have in any configuration and simplifies
the use of them from other locations.

Signed-off-by: Nicholas Lawson <[email protected]>
Nicholas Lawson 1 년 전
부모
커밋
4a613a0992
2개의 변경된 파일14개의 추가작업 그리고 13개의 파일을 삭제
  1. 12 9
      Code/Framework/AzCore/AzCore/Memory/AllocatorManager.cpp
  2. 2 4
      Gems/UiBasics/CMakeLists.txt

+ 12 - 9
Code/Framework/AzCore/AzCore/Memory/AllocatorManager.cpp

@@ -81,9 +81,9 @@ namespace AZ
             }
         }
 
-        using AllocationString = AZStd::fixed_string<1024>;
-
-        static constexpr const char* MemoryTag = "mem";
+        // Note that AllocationString and MemoryTag may be unused in release builds.
+        using AllocationString [[maybe_unused]] = AZStd::fixed_string<1024>;
+        [[maybe_unused]] static constexpr const char* MemoryTag = "mem";
 
         size_t allocationCount{};
         size_t totalAllocations{};
@@ -251,8 +251,9 @@ namespace AZ
 
     static void DumpAllocationsForAllocatorToFile(const AZ::ConsoleCommandContainer& arguments)
     {
-        using AllocationString = AZStd::fixed_string<1024>;
-        static constexpr const char* MemoryTag = "mem";
+        // Note that AllocationString and MemoryTag may be unused in release builds.
+        using AllocationString [[maybe_unused]] = AZStd::fixed_string<1024>;
+        [[maybe_unused]] static constexpr const char* MemoryTag = "mem";
 
         constexpr size_t DumpToFileMinArgumentCount = 1;
 
@@ -312,8 +313,9 @@ namespace AZ
 
     static void DumpAllocationsForAllocatorToDevWriteStorage(const AZ::ConsoleCommandContainer& arguments)
     {
-        using AllocationString = AZStd::fixed_string<1024>;
-        static constexpr const char* MemoryTag = "mem";
+        // Note that AllocationString and MemoryTag may be unused in release builds.
+        using AllocationString [[maybe_unused]] = AZStd::fixed_string<1024>;
+        [[maybe_unused]] static constexpr const char* MemoryTag = "mem";
 
         // Dump allocation records to <dev-write-storage>/allocation_records/records.<iso8601-timestamp>.<process-id>.log
         // Use a ISO8601 timestamp + the process ID to provide uniqueness to the metrics json files
@@ -354,8 +356,9 @@ namespace AZ
 
     static void DumpAllocationsForAllocatorInRange(const AZ::ConsoleCommandContainer& arguments)
     {
-        using AllocationString = AZStd::fixed_string<1024>;
-        static constexpr const char* MemoryTag = "mem";
+        // Note that AllocationString and MemoryTag may be unused in release builds.
+        using AllocationString [[maybe_unused]] = AZStd::fixed_string<1024>;
+        [[maybe_unused]] static constexpr const char* MemoryTag = "mem";
 
         constexpr size_t rangeArgumentCount = 2;
 

+ 2 - 4
Gems/UiBasics/CMakeLists.txt

@@ -7,7 +7,5 @@
 #
 
 # This will export its "SourcePaths" to the generated "cmake_dependencies.<project>.assetbuilder.setreg"
-if(PAL_TRAIT_BUILD_HOST_TOOLS)
-    ly_create_alias(NAME UiBasics.Builders NAMESPACE Gem)
-    ly_create_alias(NAME UiBasics.Tools NAMESPACE Gem)
-endif()
+ly_create_alias(NAME UiBasics.Builders NAMESPACE Gem)
+ly_create_alias(NAME UiBasics.Tools NAMESPACE Gem)