The new gem registration and usage system

Merge from mainline (Rebase)
main
Nicholas Lawson 5 years ago committed by lawsonamzn
parent c93c457356
commit c9d5d7fb77

@ -31,6 +31,26 @@ ly_add_target(
################################################################################
# Gem dependencies
################################################################################
# The GameLauncher uses "Client" gem variants:
ly_enable_gems(PROJECT_NAME AutomatedTesting GEM_FILE enabled_gems.cmake
TARGETS AutomatedTesting.GameLauncher
VARIANTS Clients)
# The Editor uses Tools gem variants:
ly_enable_gems(
PROJECT_NAME AutomatedTesting GEM_FILE enabled_gems.cmake
TARGETS Editor
VARIANTS Tools)
# The pipeline tools use Builders gem variants:
ly_enable_gems(
PROJECT_NAME AutomatedTesting GEM_FILE enabled_gems.cmake
TARGETS AssetBuilder AssetProcessor AssetProcessorBatch
VARIANTS Builders)
# old system (remove when all gems are ported to the new system above)
ly_add_project_dependencies(
PROJECT_NAME
AutomatedTesting

@ -0,0 +1,57 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
set(ENABLED_GEMS
ImGui
ScriptEvents
ExpressionEvaluation
Gestures
CertificateManager
DebugDraw
SceneProcessing
GraphCanvas
InAppPurchases
AutomatedTesting
EditorPythonBindings
PythonAssetBuilder
Metastream
AudioSystem
Camera
EMotionFX
PhysX
CameraFramework
StartingPointMovement
StartingPointCamera
ScriptCanvas
ScriptCanvasPhysics
ScriptCanvasTesting
LyShineExamples
StartingPointInput
PhysXDebug
WhiteBox
FastNoise
SurfaceData
GradientSignal
Vegetation
GraphModel
LandscapeCanvas
NvCloth
Blast
Maestro
TextureAtlas
LmbrCentral
LyShine
HttpRequestor
Atom_AtomBridge
AWSCore
AWSClientAuth
AWSMetrics
)

@ -1,51 +0,0 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the License). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an AS IS BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
# Extracted from Game
set(GEM_DEPENDENCIES
Gem::Maestro
Gem::TextureAtlas
Gem::LmbrCentral
Gem::LyShine
Gem::HttpRequestor
Gem::ScriptEvents
Gem::ExpressionEvaluation
Gem::Gestures
Gem::CertificateManager
Gem::DebugDraw
Gem::AudioSystem
Gem::InAppPurchases
Gem::AutomatedTesting
Gem::Metastream
Gem::Camera
Gem::EMotionFX
Gem::PhysX
Gem::CameraFramework
Gem::StartingPointMovement
Gem::StartingPointCamera
Gem::ScriptCanvas
Gem::ImGui
Gem::LyShineExamples
Gem::StartingPointInput
Gem::ScriptCanvasPhysics
Gem::PhysXDebug
Gem::WhiteBox
Gem::FastNoise
Gem::SurfaceData
Gem::GradientSignal
Gem::Vegetation
Gem::Atom_AtomBridge
Gem::NvCloth
Gem::Blast
Gem::AWSCore
Gem::AWSClientAuth
Gem::AWSMetrics
)

@ -1,63 +0,0 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the License). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an AS IS BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
# Extracted from Editor.xml
set(GEM_DEPENDENCIES
Gem::Maestro.Editor
Gem::TextureAtlas
Gem::LmbrCentral.Editor
Gem::LyShine.Editor
Gem::HttpRequestor
Gem::ScriptEvents.Editor
Gem::ExpressionEvaluation
Gem::Gestures
Gem::CertificateManager
Gem::DebugDraw.Editor
Gem::SceneProcessing.Editor
Gem::GraphCanvas.Editor
Gem::InAppPurchases
Gem::AutomatedTesting
Gem::EditorPythonBindings.Editor
Gem::PythonAssetBuilder.Editor
Gem::Metastream
Gem::AudioSystem.Editor
Gem::Camera.Editor
Gem::EMotionFX.Editor
Gem::PhysX.Editor
Gem::CameraFramework
Gem::StartingPointMovement
Gem::StartingPointCamera
Gem::ScriptCanvas.Editor
Gem::ScriptEvents.Editor
Gem::ImGui.Editor
Gem::LyShineExamples
Gem::StartingPointInput.Editor
Gem::ScriptCanvasPhysics
Gem::ScriptCanvasTesting.Editor
Gem::PhysXDebug.Editor
Gem::WhiteBox.Editor
Gem::FastNoise.Editor
Gem::SurfaceData.Editor
Gem::GradientSignal.Editor
Gem::Vegetation.Editor
Gem::GraphModel.Editor
Gem::LandscapeCanvas.Editor
Gem::EMotionFX.Editor
Gem::ImGui.Editor
Gem::Atom_RHI.Private
Gem::Atom_Feature_Common.Editor
Gem::Atom_AtomBridge.Editor
Gem::NvCloth.Editor
Gem::Blast.Editor
Gem::AWSCore.Editor
Gem::AWSClientAuth
Gem::AWSMetrics
)

@ -67,6 +67,7 @@ include(cmake/Deployment.cmake)
include(cmake/3rdParty.cmake)
include(cmake/LYPython.cmake)
include(cmake/LYWrappers.cmake)
include(cmake/Gems.cmake)
include(cmake/UnitTest.cmake)
include(cmake/LYTestWrappers.cmake)
include(cmake/Monolithic.cmake)
@ -128,24 +129,32 @@ foreach(external_directory ${LY_EXTERNAL_SUBDIRS})
endforeach()
# The following steps have to be done after all targets are registered:
# 1. generate a settings registry .setreg file for all ly_add_project_dependencies() and ly_add_target_dependencies() calls
# 1. Add any dependencies registered via ly_enable_gems
ly_enable_gems_delayed()
# 2. generate a settings registry .setreg file for all ly_add_project_dependencies() and ly_add_target_dependencies() calls
# to provide applications with the filenames of gem modules to load
# This must be done before ly_delayed_target_link_libraries() as that inserts BUILD_DEPENDENCIES as MANUALLY_ADDED_DEPENDENCIES
# if the build dependency is a MODULE_LIBRARY. That would cause a false load dependency to be generated
ly_delayed_generate_settings_registry()
# 2. link targets where the dependency was yet not declared, we need to have the declaration so we do different
# 3. link targets where the dependency was yet not declared, we need to have the declaration so we do different
# linking logic depending on the type of target
ly_delayed_target_link_libraries()
# 3. generate a registry file for unit testing for platforms that support unit testing
# 4. generate a registry file for unit testing for platforms that support unit testing
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
ly_delayed_generate_unit_test_module_registry()
endif()
# 4. inject runtime dependencies to the targets. We need to do this after (1) since we are going to walk through
# 5. inject runtime dependencies to the targets. We need to do this after (1) since we are going to walk through
# the dependencies
include(cmake/RuntimeDependencies.cmake)
# 5. Perform test impact framework post steps once all of the targets have been enumerated
# 6. Perform test impact framework post steps once all of the targets have been enumerated
ly_test_impact_post_step()
# 6. Generate the O3DE find file and setup install locations for scripts, tools, assets etc., required by the engine
# 7. Generate the O3DE find file and setup install locations for scripts, tools, assets etc., required by the engine
if(NOT INSTALLED_ENGINE)
ly_setup_o3de_install()

@ -51,6 +51,10 @@ ly_add_target(
Gem::AWSClientAuth.Static
)
# servers and clients use the above module.
ly_create_alias(NAME AWSClientAuth.Servers NAMESPACE Gem TARGETS Gem::AWSClientAuth)
ly_create_alias(NAME AWSClientAuth.Clients NAMESPACE Gem TARGETS Gem::AWSClientAuth)
################################################################################
# Tests
################################################################################

@ -45,6 +45,10 @@ ly_add_target(
Gem::AWSCore.Static
)
# clients and servers will use the above Gem::AWSCore module.
ly_create_alias(NAME AWSCore.Servers NAMESPACE Gem TARGETS Gem::AWSCore)
ly_create_alias(NAME AWSCore.Clients NAMESPACE Gem TARGETS Gem::AWSCore)
if (PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
NAME AWSCore.Editor.Static STATIC
@ -99,6 +103,11 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS)
Gem::AWSCore.Editor.Static
)
ly_add_dependencies(AWSCore.Editor AWSCore.ResourceMappingTool)
# Builders and Tools (such as the Editor use AWSCore.Editor) use the .Editor module above.
ly_create_alias(NAME AWSCore.Tools NAMESPACE Gem TARGETS Gem::AWSCore.Editor)
ly_create_alias(NAME AWSCore.Builders NAMESPACE Gem TARGETS Gem::AWSCore.Editor)
endif()
################################################################################

@ -44,6 +44,10 @@ ly_add_target(
Gem::AWSMetrics.Static
)
# Servers and Clients use the above metrics module
ly_create_alias(NAME AWSMetrics.Servers NAMESPACE Gem TARGETS Gem::AWSMetrics)
ly_create_alias(NAME AWSMetrics.Clients NAMESPACE Gem TARGETS Gem::AWSMetrics)
################################################################################
# Tests
################################################################################

@ -44,3 +44,6 @@ ly_add_target(
PRIVATE
Gem::Achievements.Static
)
# we'll load the above "Gem::Achievements" module in clients only.
ly_create_alias(NAME Achievements.Clients NAMESPACE Gem TARGETS Gem::Achievements)

@ -43,6 +43,10 @@ ly_add_target(
Gem::ImGui
)
# AssetMemoryAnalyzer is available in clients and servers.
ly_create_alias(NAME AssetMemoryAnalyzer.Clients NAMESPACE Gem TARGETS Gem::AssetMemoryAnalyzer)
ly_create_alias(NAME AssetMemoryAnalyzer.Servers NAMESPACE Gem TARGETS Gem::AssetMemoryAnalyzer)
################################################################################
# Tests
################################################################################
@ -65,3 +69,4 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
NAME Gem::AssetMemoryAnalyzer.Tests
)
endif()

@ -65,3 +65,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
NAME Gem::AssetValidation.Tests
)
endif()
# AssetValidation should be active in all clients plus tools
ly_create_alias(NAME AssetValidation.Clients NAMESPACE Gem TARGETS Gem::AssetValidation)
ly_create_alias(NAME AssetValidation.Tools NAMESPACE Gem TARGETS Gem::AssetValidation)

@ -93,6 +93,9 @@ ly_add_target(
Gem::AudioEngineWwise.Static
)
# we'll load the above "Gem::AudioEngineWwise" module in clients.
ly_create_alias(NAME AudioEngineWwise.Clients NAMESPACE Gem TARGETS Gem::AudioEngineWwise)
################################################################################
# Tests
################################################################################
@ -230,6 +233,10 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS)
Gem::AudioSystem.Editor
)
# by default, we'll load the above "Gem::AudioEngineWwise.Editor" module in builders and tools.
ly_create_alias(NAME AudioEngineWwise.Builders NAMESPACE Gem TARGETS Gem::AudioEngineWwise.Editor)
ly_create_alias(NAME AudioEngineWwise.Tools NAMESPACE Gem TARGETS Gem::AudioEngineWwise.Editor)
if (PAL_TRAIT_BUILD_TESTS_SUPPORTED)
ly_add_target(
NAME AudioEngineWwise.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}

@ -61,22 +61,8 @@ ly_add_target(
Gem::AudioSystem.Static
)
################################################################################
# Server
################################################################################
if (PAL_TRAIT_BUILD_SERVER_SUPPORTED)
# Stub gem for server. Audio system is client only
ly_add_target(
NAME AudioSystem.Server GEM_MODULE
NAMESPACE Gem
FILES_CMAKE
audiosystem_stub_files.cmake
BUILD_DEPENDENCIES
PRIVATE
AZ::AzCore
)
endif ()
# AudioSystem should use the above target on clients.
ly_create_alias(NAME AudioSystem.Clients NAMESPACE Gem TARGETS Gem::AudioSystem)
################################################################################
# Tests
@ -230,6 +216,10 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS)
Gem::AudioSystem.Editor.Static
)
# use the above "Editor" target in tools and builders:
ly_create_alias(NAME AssetMemoryAnalyzer.Tools NAMESPACE Gem TARGETS Gem::AudioSystem.Editor)
ly_create_alias(NAME AssetMemoryAnalyzer.Builders NAMESPACE Gem TARGETS Gem::AudioSystem.Editor)
if (PAL_TRAIT_BUILD_TESTS_SUPPORTED)
ly_add_target(
NAME AudioSystem.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
@ -253,3 +243,6 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS)
)
endif()
endif ()

@ -42,3 +42,7 @@ ly_add_target(
RUNTIME_DEPENDENCIES
Gem::LmbrCentral
)
# servers and clients use the above module.
ly_create_alias(NAME AutomatedLauncherTesting.Servers NAMESPACE Gem TARGETS Gem::AutomatedLauncherTesting)
ly_create_alias(NAME AutomatedLauncherTesting.Clients NAMESPACE Gem TARGETS Gem::AutomatedLauncherTesting)

@ -59,6 +59,11 @@ ly_add_target(
Gem::PhysX
)
# clients and servers use the above Gem module.
ly_create_alias(NAME Blast.Servers NAMESPACE Gem TARGETS Gem::Blast)
ly_create_alias(NAME Blast.Clients NAMESPACE Gem TARGETS Gem::Blast)
if(PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
@ -110,6 +115,9 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
Gem::PhysX.Editor
)
# tools and builders use the above module.
ly_create_alias(NAME Blast.Tools NAMESPACE Gem TARGETS Gem::Blast.Editor)
ly_create_alias(NAME Blast.Builders NAMESPACE Gem TARGETS Gem::Blast.Editor)
endif()
################################################################################

@ -39,6 +39,10 @@ ly_add_target(
Gem::Camera.Static
)
# clients and servers use the above module:
ly_create_alias(NAME Camera.Clients NAMESPACE Gem TARGETS Gem::Camera)
ly_create_alias(NAME Camera.Servers NAMESPACE Gem TARGETS Gem::Camera)
if (PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
@ -62,4 +66,7 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS)
Gem::Camera.Static
)
# tools and builders use the above module.
ly_create_alias(NAME Camera.Tools NAMESPACE Gem TARGETS Gem::Camera.Editor)
ly_create_alias(NAME Camera.Builders NAMESPACE Gem TARGETS Gem::Camera.Editor)
endif()

@ -38,3 +38,9 @@ ly_add_target(
PRIVATE
Gem::CameraFramework.Static
)
# Every kind of application uses the above target module.
ly_create_alias(NAME CameraFramework.Clients NAMESPACE Gem TARGETS Gem::CameraFramework)
ly_create_alias(NAME CameraFramework.Servers NAMESPACE Gem TARGETS Gem::CameraFramework)
ly_create_alias(NAME CameraFramework.Tools NAMESPACE Gem TARGETS Gem::CameraFramework)
ly_create_alias(NAME CameraFramework.Builders NAMESPACE Gem TARGETS Gem::CameraFramework)

@ -41,3 +41,7 @@ ly_add_target(
PRIVATE
Gem::CertificateManager.Static
)
# we'll load the above "Gem::CertificateManager" module in Clients and Servers
ly_create_alias(NAME CertificateManager.Clients NAMESPACE Gem TARGETS Gem::CertificateManager)
ly_create_alias(NAME CertificateManager.Servers NAMESPACE Gem TARGETS Gem::CertificateManager)

@ -33,6 +33,11 @@ ly_add_target(
AZ::CrashHandler
)
# Load the "Gem::CrashReporting" module in Clients and Servers
ly_create_alias(NAME CrashReporting.Clients NAMESPACE Gem TARGETS Gem::CrashReporting)
ly_create_alias(NAME CrashReporting.Servers NAMESPACE Gem TARGETS Gem::CrashReporting)
ly_add_target(
NAME CrashReporting.Uploader APPLICATION
NAMESPACE AZ

@ -22,6 +22,10 @@ ly_add_target(
AZ::AzCore
)
# clients and servers use the above module.
ly_create_alias(NAME CustomAssetExample.Clients NAMESPACE Gem TARGETS CustomAssetExample)
ly_create_alias(NAME CustomAssetExample.Servers NAMESPACE Gem TARGETS CustomAssetExample)
if(PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
NAME CustomAssetExample.Editor GEM_MODULE
@ -37,4 +41,9 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
AZ::AzCore
AZ::AssetBuilderSDK
)
# other tools use the above tools module:
ly_create_alias(NAME CustomAssetExample.Builders NAMESPACE Gem TARGETS CustomAssetExample.Editor)
ly_create_alias(NAME CustomAssetExample.Tools NAMESPACE Gem TARGETS CustomAssetExample.Editor)
endif()

@ -39,6 +39,9 @@ ly_add_target(
Gem::DebugDraw.Static
)
# servers do not need debug draw components, only clients
ly_create_alias(NAME DebugDraw.Clients NAMESPACE Gem TARGETS DebugDraw)
if(PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
NAME DebugDraw.Editor GEM_MODULE
@ -56,4 +59,9 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
Gem::DebugDraw.Static
AZ::AzToolsFramework
)
# builders and tools use DebugDraw.Editor
ly_create_alias(NAME DebugDraw.Builders NAMESPACE Gem TARGETS DebugDraw.Editor)
ly_create_alias(NAME DebugDraw.Tools NAMESPACE Gem TARGETS DebugDraw.Editor)
endif()

@ -67,6 +67,10 @@ ly_add_target(
Gem::LmbrCentral
)
# Clients and servers use the above EMotionFX module
ly_create_alias(NAME EMotionFX.Clients NAMESPACE Gem TARGETS EMotionFX)
ly_create_alias(NAME EMotionFX.Servers NAMESPACE Gem TARGETS EMotionFX)
if (PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
@ -129,6 +133,11 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS)
RUNTIME_DEPENDENCIES
Gem::LmbrCentral.Editor
)
# builders and tools use the above EMotionFX.Editor module
ly_create_alias(NAME EMotionFX.Builders NAMESPACE Gem TARGETS EMotionFX.Editor)
ly_create_alias(NAME EMotionFX.Tools NAMESPACE Gem TARGETS EMotionFX.Editor)
endif()
################################################################################

@ -64,6 +64,10 @@ ly_add_target(
Gem::EditorPythonBindings.Static
)
# builders and tools use EditorPythonBindings.Editor
ly_create_alias(NAME EditorPythonBindings.Builders NAMESPACE Gem TARGETS EditorPythonBindings.Editor)
ly_create_alias(NAME EditorPythonBindings.Tools NAMESPACE Gem TARGETS EditorPythonBindings.Editor)
################################################################################
# Tests
################################################################################

@ -41,6 +41,12 @@ ly_add_target(
Gem::ExpressionEvaluation.Static
)
# all types of applications use the above module
ly_create_alias(NAME ExpressionEvaluation.Clients NAMESPACE Gem TARGETS ExpressionEvaluation)
ly_create_alias(NAME ExpressionEvaluation.Servers NAMESPACE Gem TARGETS ExpressionEvaluation)
ly_create_alias(NAME ExpressionEvaluation.Builders NAMESPACE Gem TARGETS ExpressionEvaluation)
ly_create_alias(NAME ExpressionEvaluation.Tools NAMESPACE Gem TARGETS ExpressionEvaluation)
################################################################################
# Tests
################################################################################

@ -42,6 +42,10 @@ ly_add_target(
Gem::GradientSignal
)
# Clients and Servers use the above module
ly_create_alias(NAME FastNoise.Clients NAMESPACE Gem TARGETS FastNoise)
ly_create_alias(NAME FastNoise.Servers NAMESPACE Gem TARGETS FastNoise)
if(PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
NAME FastNoise.Editor.Static STATIC
@ -81,6 +85,12 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
Gem::LmbrCentral.Editor
Gem::SurfaceData.Editor
)
# builders and tools load the above tool module.
ly_create_alias(NAME FastNoise.Builders NAMESPACE Gem TARGETS FastNoise.Editor)
ly_create_alias(NAME FastNoise.Tools NAMESPACE Gem TARGETS FastNoise.Editor)
endif()
################################################################################

@ -40,6 +40,10 @@ ly_add_target(
Gem::GameState.Static
)
# Clients and Servers use the above module. There is no editor or tools module required.
ly_create_alias(NAME GameState.Clients NAMESPACE Gem TARGETS GameState)
ly_create_alias(NAME GameState.Servers NAMESPACE Gem TARGETS GameState)
################################################################################
# Tests
################################################################################

@ -45,3 +45,7 @@ ly_add_target(
Gem::LmbrCentral
Gem::GameStateSamples.Headers
)
# Clients and Servers use the above module. There is no editor or tools module required.
ly_create_alias(NAME GameStateSamples.Clients NAMESPACE Gem TARGETS GameStateSamples)
ly_create_alias(NAME GameStateSamples.Servers NAMESPACE Gem TARGETS GameStateSamples)

@ -43,6 +43,12 @@ ly_add_target(
Gem::Gestures.Static
)
# All types of applications use the same module.
ly_create_alias(NAME Gestures.Clients NAMESPACE Gem TARGETS Gestures)
ly_create_alias(NAME Gestures.Servers NAMESPACE Gem TARGETS Gestures)
ly_create_alias(NAME Gestures.Builders NAMESPACE Gem TARGETS Gestures)
ly_create_alias(NAME Gestures.Tools NAMESPACE Gem TARGETS Gestures)
################################################################################
# Tests
################################################################################

@ -47,6 +47,10 @@ ly_add_target(
Gem::SurfaceData
)
# Load the "Gem::GradientSignal" module in Clients and Servers
ly_create_alias(NAME GradientSignal.Clients NAMESPACE Gem TARGETS Gem::GradientSignal)
ly_create_alias(NAME GradientSignal.Servers NAMESPACE Gem TARGETS Gem::GradientSignal)
if(PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
@ -92,6 +96,11 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
Gem::SurfaceData.Editor
)
# Load the "Gem::GradientSignal.Editor" module in Builders and Tools
ly_create_alias(NAME GradientSignal.Builders NAMESPACE Gem TARGETS Gem::GradientSignal.Editor)
ly_create_alias(NAME GradientSignal.Tools NAMESPACE Gem TARGETS Gem::GradientSignal.Editor)
endif()
################################################################################

@ -75,4 +75,10 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS)
3rdParty::Qt::Xml
AZ::AzQtComponents
)
# Load the "Gem::GraphCanvas" module in Builders and Tools
ly_create_alias(NAME GraphCanvas.Builders NAMESPACE Gem TARGETS Gem::GraphCanvas.Editor)
ly_create_alias(NAME GraphCanvas.Tools NAMESPACE Gem TARGETS Gem::GraphCanvas.Editor)
endif ()

@ -52,6 +52,11 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
RUNTIME_DEPENDENCIES
Gem::GraphCanvas.Editor
)
# Load the "Gem::GraphModel" module in Builders and Tools
ly_create_alias(NAME GraphModel.Builders NAMESPACE Gem TARGETS Gem::GraphModel.Editor)
ly_create_alias(NAME GraphModel.Tools NAMESPACE Gem TARGETS Gem::GraphModel.Editor)
endif()
################################################################################

@ -48,6 +48,12 @@ ly_add_target(
Gem::HttpRequestor.Static
)
# Load the "Gem::HttpRequestor" module in all types of applicatons.
ly_create_alias(NAME HttpRequestor.Clients NAMESPACE Gem TARGETS Gem::HttpRequestor)
ly_create_alias(NAME HttpRequestor.Servers NAMESPACE Gem TARGETS Gem::HttpRequestor)
ly_create_alias(NAME HttpRequestor.Builders NAMESPACE Gem TARGETS Gem::HttpRequestor)
ly_create_alias(NAME HttpRequestor.Tools NAMESPACE Gem TARGETS Gem::HttpRequestor)
################################################################################
# Tests
################################################################################

@ -90,6 +90,10 @@ ly_add_target(
Gem::LmbrCentral
)
# Load the above "Gem::ImGui" module in Clients and Servers:
ly_create_alias(NAME ImGui.Clients NAMESPACE Gem TARGETS Gem::ImGui)
ly_create_alias(NAME ImGui.Servers NAMESPACE Gem TARGETS Gem::ImGui)
if(PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
NAME ImGui.Editor GEM_MODULE
@ -113,4 +117,9 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
RUNTIME_DEPENDENCIES
Gem::LmbrCentral.Editor
)
# Load the above "Gem::ImGui.Editor" module in only tools and builders.
ly_create_alias(NAME ImGui.Builders NAMESPACE Gem TARGETS Gem::ImGui.Editor)
ly_create_alias(NAME ImGui.Tools NAMESPACE Gem TARGETS Gem::ImGui.Editor)
endif()

@ -43,3 +43,8 @@ ly_add_target(
PRIVATE
Gem::InAppPurchases.Static
)
# Load the above "Gem::InAppPurchases" module in all app types
ly_create_alias(NAME InAppPurchases.Clients NAMESPACE Gem TARGETS Gem::InAppPurchases)
ly_create_alias(NAME InAppPurchases.Servers NAMESPACE Gem TARGETS Gem::InAppPurchases)
ly_create_alias(NAME InAppPurchases.Builders NAMESPACE Gem TARGETS Gem::InAppPurchases)
ly_create_alias(NAME InAppPurchases.Tools NAMESPACE Gem TARGETS Gem::InAppPurchases)

@ -72,6 +72,11 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
Gem::SurfaceData.Editor
Gem::Vegetation.Editor
)
# by default, load the above "Gem::LandscapeCanvas.Editor" module in dev applications
ly_create_alias(NAME LandscapeCanvas.Builders NAMESPACE Gem TARGETS Gem::LandscapeCanvas.Editor)
ly_create_alias(NAME LandscapeCanvas.Tools NAMESPACE Gem TARGETS Gem::LandscapeCanvas.Editor)
endif()
################################################################################

@ -48,6 +48,11 @@ ly_add_target(
Gem::LmbrCentral.Static
)
# by default, load the above "Gem::LmbrCentral" module in Client and Server
ly_create_alias(NAME LmbrCentral.Clients NAMESPACE Gem TARGETS Gem::LmbrCentral)
ly_create_alias(NAME LmbrCentral.Servers NAMESPACE Gem TARGETS Gem::LmbrCentral)
if (PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
NAME LmbrCentral.Editor.Static STATIC
@ -102,6 +107,10 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS)
FILES ${QT_LRELEASE_EXECUTABLE}
)
# by default, load the above "Gem::LmbrCentral.Editor" module in dev tools
ly_create_alias(NAME LmbrCentral.Builders NAMESPACE Gem TARGETS Gem::LmbrCentral.Editor)
ly_create_alias(NAME LmbrCentral.Tools NAMESPACE Gem TARGETS Gem::LmbrCentral.Editor)
endif()
################################################################################

@ -43,6 +43,9 @@ ly_add_target(
Gem::LocalUser.Static
)
# by default, load the above "Gem::LocalUser" module in client applications
ly_create_alias(NAME LocalUser.Clients NAMESPACE Gem TARGETS Gem::LocalUser)
################################################################################
# Tests
################################################################################

@ -56,6 +56,9 @@ ly_add_target(
Gem::TextureAtlas
)
# by default, load the above "Gem::LyShine" module in Client applications:
ly_create_alias(NAME LyShine.Clients NAMESPACE Gem TARGETS Gem::LyShine)
if (PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
NAME LyShine.Editor.Static STATIC
@ -123,6 +126,10 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS)
Gem::LmbrCentral.Editor
Gem::TextureAtlas
)
# by default, load the above "Gem::LyShine.Editor" module in dev tools:
ly_create_alias(NAME LyShine.Builders NAMESPACE Gem TARGETS Gem::LyShine.Editor)
ly_create_alias(NAME LyShine.Tools NAMESPACE Gem TARGETS Gem::LyShine.Editor)
endif()
################################################################################

@ -40,3 +40,10 @@ ly_add_target(
PRIVATE
Gem::LyShineExamples.Static
)
# if enabled, LyShineExamples is used by all kinds of applications
ly_create_alias(NAME LyShineExamples.Builders NAMESPACE Gem TARGETS Gem::LyShineExamples)
ly_create_alias(NAME LyShineExamples.Tools NAMESPACE Gem TARGETS Gem::LyShineExamples)
ly_create_alias(NAME LyShineExamples.Clients NAMESPACE Gem TARGETS Gem::LyShineExamples)
ly_create_alias(NAME LyShineExamples.Servers NAMESPACE Gem TARGETS Gem::LyShineExamples)

@ -44,6 +44,10 @@ ly_add_target(
Gem::LmbrCentral
)
# if enabled, "Maestro" module is used for Clients and Servers:
ly_create_alias(NAME Maestro.Clients NAMESPACE Gem TARGETS Gem::Maestro)
ly_create_alias(NAME Maestro.Servers NAMESPACE Gem TARGETS Gem::Maestro)
if (PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
NAME Maestro.Editor GEM_MODULE
@ -73,6 +77,10 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS)
RUNTIME_DEPENDENCIES
Gem::LmbrCentral.Editor
)
# the .Editor variant is used in dev tools:
ly_create_alias(NAME Maestro.Tools NAMESPACE Gem TARGETS Gem::Maestro.Editor)
ly_create_alias(NAME Maestro.Builders NAMESPACE Gem TARGETS Gem::Maestro.Editor)
endif()
################################################################################

@ -38,3 +38,7 @@ ly_add_target(
PRIVATE
Gem::MessagePopup.Static
)
# MessagePopup is used only in client applications
ly_create_alias(NAME MessagePopup.Clients NAMESPACE Gem TARGETS Gem::MessagePopup)

@ -50,6 +50,11 @@ ly_add_target(
Legacy::CryCommon
)
# The above "Metastream" target is used by all types of applications, including dev tools.
ly_create_alias(NAME Metastream.Clients NAMESPACE Gem TARGETS Gem::Metastream)
ly_create_alias(NAME Metastream.Servers NAMESPACE Gem TARGETS Gem::Metastream)
ly_create_alias(NAME Metastream.Builders NAMESPACE Gem TARGETS Gem::Metastream)
ly_create_alias(NAME Metastream.Tools NAMESPACE Gem TARGETS Gem::Metastream)
################################################################################
# Tests

@ -46,3 +46,7 @@ ly_add_target(
RUNTIME_DEPENDENCIES
Gem::AudioSystem
)
# The above "Microphone" target is used by all interactive applications
ly_create_alias(NAME Microphone.Clients NAMESPACE Gem TARGETS Gem::Microphone)
ly_create_alias(NAME Microphone.Tools NAMESPACE Gem TARGETS Gem::Microphone)

@ -58,6 +58,33 @@ ly_add_target(
Gem::CertificateManager
)
ly_add_target(
NAME Multiplayer.Debug ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
NAMESPACE Gem
FILES_CMAKE
multiplayer_debug_files.cmake
INCLUDE_DIRECTORIES
PRIVATE
Source
.
PUBLIC
Include
BUILD_DEPENDENCIES
PRIVATE
AZ::AzCore
AZ::AtomCore
AZ::AzFramework
AZ::AzNetworking
Gem::Atom_Feature_Common.Static
Gem::Multiplayer.Static
Gem::ImGui.Static
)
# The above "Multiplayer" target is used by clients and servers
# the debug is only used on Clients
ly_create_alias(NAME Multiplayer.Clients NAMESPACE Gem TARGETS Gem::Multiplayer Gem::Multiplayer.Debug)
ly_create_alias(NAME Multiplayer.Servers NAMESPACE Gem TARGETS Gem::Multiplayer)
if (PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
NAME Multiplayer.Tools.Static STATIC
@ -124,6 +151,10 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS)
Gem::Multiplayer.Tools
)
# use the Multiplayer.Editor module in tools and builders. Tools also get the visual debug view
ly_create_alias(NAME Multiplayer.Tools NAMESPACE Gem TARGETS Gem::Multiplayer.Editor Gem::Multiplayer.Debug Gem::Multiplayer.PrefabProcessor)
ly_create_alias(NAME Multiplayer.Builders NAMESPACE Gem TARGETS Gem::Multiplayer.Editor Gem::Multiplayer.PrefabProcessor)
endif()
if (PAL_TRAIT_BUILD_TESTS_SUPPORTED)
@ -173,25 +204,3 @@ if (PAL_TRAIT_BUILD_TESTS_SUPPORTED)
endif()
endif()
ly_add_target(
NAME Multiplayer.Debug ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
NAMESPACE Gem
FILES_CMAKE
multiplayer_debug_files.cmake
INCLUDE_DIRECTORIES
PRIVATE
Source
.
PUBLIC
Include
BUILD_DEPENDENCIES
PRIVATE
AZ::AzCore
AZ::AtomCore
AZ::AzFramework
AZ::AzNetworking
Gem::Atom_Feature_Common.Static
Gem::Multiplayer.Static
Gem::ImGui.Static
)

@ -39,6 +39,11 @@ ly_add_target(
Gem::MultiplayerCompression.Static
)
# use the MultiplayerCompression module everywhere except builders:
ly_create_alias(NAME MultiplayerCompression.Clients NAMESPACE Gem TARGETS Gem::MultiplayerCompression)
ly_create_alias(NAME MultiplayerCompression.Tools NAMESPACE Gem TARGETS Gem::MultiplayerCompression)
ly_create_alias(NAME MultiplayerCompression.Servers NAMESPACE Gem TARGETS Gem::MultiplayerCompression)
################################################################################
# Tests
################################################################################

@ -56,6 +56,10 @@ ly_add_target(
Gem::AtomLyIntegration_CommonFeatures
)
# use the NvCloth module in clients and servers:
ly_create_alias(NAME NvCloth.Clients NAMESPACE Gem TARGETS Gem::NvCloth)
ly_create_alias(NAME NvCloth.Servers NAMESPACE Gem TARGETS Gem::NvCloth)
if(PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
NAME NvCloth.Editor.Static STATIC
@ -97,6 +101,10 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
RUNTIME_DEPENDENCIES
Gem::AtomLyIntegration_CommonFeatures.Editor
)
# use the NvCloth.Editor module in dev tools:
ly_create_alias(NAME NvCloth.Builders NAMESPACE Gem TARGETS Gem::NvCloth.Editor)
ly_create_alias(NAME NvCloth.Tools NAMESPACE Gem TARGETS Gem::NvCloth.Editor)
endif()
################################################################################

@ -70,6 +70,10 @@ ly_add_target(
Gem::LmbrCentral
)
# use the PhysX module in clients and servers:
ly_create_alias(NAME PhysX.Clients NAMESPACE Gem TARGETS Gem::PhysX)
ly_create_alias(NAME PhysX.Servers NAMESPACE Gem TARGETS Gem::PhysX)
if(PAL_TRAIT_BUILD_HOST_TOOLS)
ly_associate_package(PACKAGE_NAME poly2tri-0.3.3-rev2-multiplatform TARGETS poly2tri PACKAGE_HASH 04092d06716f59b936b61906eaf3647db23b685d81d8b66131eb53e0aeaa1a38)
@ -136,6 +140,10 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
Gem::LmbrCentral.Editor
)
# use the PhysX.Editor module in dev tools:
ly_create_alias(NAME PhysX.Builders NAMESPACE Gem TARGETS Gem::PhysX.Editor)
ly_create_alias(NAME PhysX.Tools NAMESPACE Gem TARGETS Gem::PhysX.Editor)
endif()
################################################################################

@ -44,6 +44,9 @@ ly_add_target(
Gem::PhysX
Gem::ImGui
)
# use the PhysXDebug module in Clients and Servers:
ly_create_alias(NAME PhysXDebug.Clients NAMESPACE Gem TARGETS Gem::PhysXDebug)
ly_create_alias(NAME PhysXDebug.Servers NAMESPACE Gem TARGETS Gem::PhysXDebug)
if(PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
@ -73,4 +76,8 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
Gem::PhysX.Editor
Gem::ImGui.Editor
)
# use the PhysXDebug.Editor module in dev tools:
ly_create_alias(NAME PhysXDebug.Builders NAMESPACE Gem TARGETS Gem::PhysXDebug.Editor)
ly_create_alias(NAME PhysXDebug.Tools NAMESPACE Gem TARGETS Gem::PhysXDebug.Editor)
endif()

@ -38,14 +38,16 @@ ly_add_target(
Gem::PrefabBuilder.Static
)
ly_add_target_dependencies(
TARGETS
AssetBuilder
AssetProcessor
AssetProcessorBatch
DEPENDENT_TARGETS
Gem::PrefabBuilder
)
# the prefab builder only needs to be active in builders
# use the PrefabBuilder module in Clients and Servers:
ly_create_alias(NAME PrefabBuilder.Builders NAMESPACE Gem TARGETS Gem::PrefabBuilder)
# we automatically add this gem, if it is present, to all our known set of builder applications:
ly_enable_gems(GEMS PrefabBuilder VARIANTS Builders TARGETS AssetProcessor AssetProcessorBatch AssetBuilder)
# if you have a custom builder application in your project, then use ly_enable_gems() to
# add it to that application for your project, like this to make YOUR_TARGET_NAME load it automatically
# ly_enable_gems(PROJECT (YOUR_PROJECT_NAME) GEMS PrefabBuilder VARIANTS Builders TARGETS (YOUR_TARGET_NAME) )
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
ly_add_target(

@ -44,3 +44,6 @@ ly_add_target(
AZ::AzFramework
Gem::Presence.Headers
)
# we activate the presence gem (if enabled) only on client applications such as the launcher:
ly_create_alias(NAME Presence.Clients NAMESPACE Gem TARGETS Gem::Presence)

@ -69,6 +69,11 @@ ly_add_target(
Gem::EditorPythonBindings.Editor
)
# the above target is used in both builders like AssetProcessor and Tools like the Editor
# but is not used in clients or servers
ly_create_alias(NAME PythonAssetBuilder.Tools NAMESPACE Gem TARGETS Gem::PythonAssetBuilder.Editor)
ly_create_alias(NAME PythonAssetBuilder.Builders NAMESPACE Gem TARGETS Gem::PythonAssetBuilder.Editor)
################################################################################
# Tests
################################################################################

@ -55,3 +55,9 @@ ly_add_target(
RUNTIME_DEPENDENCIES
Gem::EditorPythonBindings.Editor
)
# the above target is used in both builders like AssetProcessor and Tools like the Editor
# but is not used in clients or servers
ly_create_alias(NAME QtForPython.Tools NAMESPACE Gem TARGETS Gem::QtForPython.Editor)
ly_create_alias(NAME QtForPython.Builders NAMESPACE Gem TARGETS Gem::QtForPython.Editor)

@ -42,3 +42,8 @@ ly_add_target(
PRIVATE
Gem::RADTelemetry.Static
)
# the RADTelemetry module above can be used in all kinds of applications, but we don't enable it in asset builders
ly_create_alias(NAME RADTelemetry.Clients NAMESPACE Gem TARGETS Gem::RADTelemetry)
ly_create_alias(NAME RADTelemetry.Tools NAMESPACE Gem TARGETS Gem::RADTelemetry)
ly_create_alias(NAME RADTelemetry.Servers NAMESPACE Gem TARGETS Gem::RADTelemetry)

@ -46,6 +46,9 @@ ly_add_target(
Gem::SaveData.Static
)
# the SaveData module above is only used in Clients by default.
ly_create_alias(NAME SaveData.Clients NAMESPACE Gem TARGETS Gem::SaveData)
################################################################################
# Tests
################################################################################

@ -40,3 +40,7 @@ ly_add_target(
PRIVATE
Gem::SceneLoggingExample.Static
)
# the SceneLoggingExample module above is only used in Builders and Tools by default.
ly_create_alias(NAME SceneLoggingExample.Builders NAMESPACE Gem TARGETS Gem::SceneLoggingExample)
ly_create_alias(NAME SceneLoggingExample.Tools NAMESPACE Gem TARGETS Gem::SceneLoggingExample)

@ -66,6 +66,10 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS)
AZ::SceneCore
AZ::SceneData
)
# the SceneProcessing.Editor module above is only used in Builders and Tools.
ly_create_alias(NAME SceneProcessing.Builders NAMESPACE Gem TARGETS Gem::SceneProcessing.Editor)
ly_create_alias(NAME SceneProcessing.Tools NAMESPACE Gem TARGETS Gem::SceneProcessing.Editor)
endif()
################################################################################

@ -49,6 +49,14 @@ ly_add_target(
Gem::ScriptEvents.Static
)
# the script canvas debugger is an optional gem module
# To Enable it: ly_enable_gems( ... TARGETS xxxyyzzz GEMS ScriptCanvasDebugger ...)
# in any particular target.
ly_create_alias(NAME ScriptCanvasDebugger.Builders NAMESPACE Gem TARGETS Gem::ScriptCanvasDebugger)
ly_create_alias(NAME ScriptCanvasDebugger.Tools NAMESPACE Gem TARGETS Gem::ScriptCanvasDebugger)
ly_create_alias(NAME ScriptCanvasDebugger.Clients NAMESPACE Gem TARGETS Gem::ScriptCanvasDebugger)
ly_create_alias(NAME ScriptCanvasDebugger.Servers NAMESPACE Gem TARGETS Gem::ScriptCanvasDebugger)
ly_add_target(
NAME ScriptCanvas.Static STATIC
NAMESPACE Gem
@ -109,6 +117,10 @@ ly_add_target(
Gem::ExpressionEvaluation
)
# the "ScriptCanvas" target is active in Clients and Servers
ly_create_alias(NAME ScriptCanvas.Clients NAMESPACE Gem TARGETS Gem::ScriptCanvas)
ly_create_alias(NAME ScriptCanvas.Servers NAMESPACE Gem TARGETS Gem::ScriptCanvas)
if(PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
NAME ScriptCanvasEditor STATIC
@ -204,6 +216,12 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
Gem::ScriptEvents.Editor
Gem::ExpressionEvaluation
)
# the "ScriptCanvas.Editor" target is active in all dev tools:
ly_create_alias(NAME ScriptCanvas.Builders NAMESPACE Gem TARGETS Gem::ScriptCanvas.Editor)
ly_create_alias(NAME ScriptCanvas.Tools NAMESPACE Gem TARGETS Gem::ScriptCanvas.Editor)
endif()
################################################################################

@ -54,6 +54,11 @@ ly_add_target(
Gem::ScriptCanvas
)
# By default, the above module is the Client/Server module
ly_create_alias(NAME ScriptCanvasDeveloper.Clients NAMESPACE Gem TARGETS Gem::ScriptCanvasDeveloper)
ly_create_alias(NAME ScriptCanvasDeveloper.Servers NAMESPACE Gem TARGETS Gem::ScriptCanvasDeveloper)
if(PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
NAME ScriptCanvasDeveloper.Editor GEM_MODULE
@ -82,4 +87,8 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
RUNTIME_DEPENDENCIES
Gem::ScriptCanvas.Editor
)
# By Default the above module is the dev tools module
ly_create_alias(NAME ScriptCanvasDeveloper.Builders NAMESPACE Gem TARGETS Gem::ScriptCanvasDeveloper.Editor)
ly_create_alias(NAME ScriptCanvasDeveloper.Tools NAMESPACE Gem TARGETS Gem::ScriptCanvasDeveloper.Editor)
endif()

@ -38,6 +38,12 @@ ly_add_target(
Gem::ScriptCanvasPhysics.Static
)
# By default, the above module is used by all application types
ly_create_alias(NAME ScriptCanvasPhysics.Clients NAMESPACE Gem TARGETS Gem::ScriptCanvasPhysics)
ly_create_alias(NAME ScriptCanvasPhysics.Servers NAMESPACE Gem TARGETS Gem::ScriptCanvasPhysics)
ly_create_alias(NAME ScriptCanvasPhysics.Tools NAMESPACE Gem TARGETS Gem::ScriptCanvasPhysics)
ly_create_alias(NAME ScriptCanvasPhysics.Builders NAMESPACE Gem TARGETS Gem::ScriptCanvasPhysics)
################################################################################
# Tests
################################################################################

@ -73,6 +73,9 @@ ly_add_target(
Gem::ScriptCanvas.Editor
)
# By default, the above module is used only in tools:
ly_create_alias(NAME ScriptCanvasTesting.Tools NAMESPACE Gem TARGETS Gem::ScriptCanvasTesting.Editor)
################################################################################
# Tests
################################################################################

@ -40,6 +40,11 @@ ly_add_target(
Gem::ScriptEvents.Static
)
# the above module is for use in clients and servers
ly_create_alias(NAME ScriptEvents.Clients NAMESPACE Gem TARGETS Gem::ScriptEvents)
ly_create_alias(NAME ScriptEvents.Servers NAMESPACE Gem TARGETS Gem::ScriptEvents)
if(PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
NAME ScriptEvents.Editor GEM_MODULE
@ -61,6 +66,10 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
AZ::AssetBuilderSDK
Gem::ScriptEvents.Static
)
# the above module is for use in dev tools.
ly_create_alias(NAME ScriptEvents.Tools NAMESPACE Gem TARGETS Gem::ScriptEvents.Editor)
ly_create_alias(NAME ScriptEvents.Builders NAMESPACE Gem TARGETS Gem::ScriptEvents.Editor)
endif()
################################################################################

@ -40,3 +40,9 @@ ly_add_target(
AZ::AzCore
Legacy::CryCommon
)
# the above module is for use in all application types:
ly_create_alias(NAME ScriptedEntityTweener.Tools NAMESPACE Gem TARGETS Gem::ScriptedEntityTweener)
ly_create_alias(NAME ScriptedEntityTweener.Clients NAMESPACE Gem TARGETS Gem::ScriptedEntityTweener)
ly_create_alias(NAME ScriptedEntityTweener.Builders NAMESPACE Gem TARGETS Gem::ScriptedEntityTweener)
ly_create_alias(NAME ScriptedEntityTweener.Servers NAMESPACE Gem TARGETS Gem::ScriptedEntityTweener)

@ -51,3 +51,6 @@ ly_add_target(
3rdParty::Qt::Core
Gem::SliceFavorites.Editor.Static
)
# the above module is for use in Tools only (no need to load it in builders)
ly_create_alias(NAME SliceFavorites.Tools NAMESPACE Gem TARGETS Gem::SliceFavorites.Editor)

@ -48,3 +48,9 @@ ly_add_target(
RUNTIME_DEPENDENCIES
Gem::CameraFramework
)
# the above module is for use in all kinds of applications
ly_create_alias(NAME StartingPointCamera.Servers NAMESPACE Gem TARGETS Gem::StartingPointCamera)
ly_create_alias(NAME StartingPointCamera.Clients NAMESPACE Gem TARGETS Gem::StartingPointCamera)
ly_create_alias(NAME StartingPointCamera.Builders NAMESPACE Gem TARGETS Gem::StartingPointCamera)
ly_create_alias(NAME StartingPointCamera.Tools NAMESPACE Gem TARGETS Gem::StartingPointCamera)

@ -56,6 +56,10 @@ ly_add_source_properties(
VALUES ${LY_PAL_TOOLS_DEFINES}
)
# the above module is for use in clients and servers
ly_create_alias(NAME StartingPointInput.Servers NAMESPACE Gem TARGETS Gem::StartingPointInput)
ly_create_alias(NAME StartingPointInput.Clients NAMESPACE Gem TARGETS Gem::StartingPointInput)
if(PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
NAME StartingPointInput.Editor GEM_MODULE
@ -74,6 +78,11 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
AZ::AzFramework
Gem::StartingPointInput.Static
)
# by default, activate the ab ove module in builders and tools:
ly_create_alias(NAME StartingPointInput.Builders NAMESPACE Gem TARGETS Gem::StartingPointInput.Editor)
ly_create_alias(NAME StartingPointInput.Tools NAMESPACE Gem TARGETS Gem::StartingPointInput.Editor)
endif()
################################################################################

@ -40,3 +40,9 @@ ly_add_target(
AZ::AzCore
AZ::AzFramework
)
# the above module is for use in all application types (there is no tool specialization)
ly_create_alias(NAME StartingPointMovement.Servers NAMESPACE Gem TARGETS Gem::StartingPointMovement)
ly_create_alias(NAME StartingPointMovement.Clients NAMESPACE Gem TARGETS Gem::StartingPointMovement)
ly_create_alias(NAME StartingPointMovement.Builders NAMESPACE Gem TARGETS Gem::StartingPointMovement)
ly_create_alias(NAME StartingPointMovement.Tools NAMESPACE Gem TARGETS Gem::StartingPointMovement)

@ -46,6 +46,10 @@ ly_add_target(
Gem::LmbrCentral
)
# the above module is for use in all client/server types
ly_create_alias(NAME SurfaceData.Servers NAMESPACE Gem TARGETS Gem::SurfaceData)
ly_create_alias(NAME SurfaceData.Clients NAMESPACE Gem TARGETS Gem::SurfaceData)
if (PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
@ -70,6 +74,9 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS)
RUNTIME_DEPENDENCIES
Gem::LmbrCentral.Editor
)
# the above module is for use in dev tool situations
ly_create_alias(NAME SurfaceData.Builders NAMESPACE Gem TARGETS Gem::SurfaceData.Editor)
ly_create_alias(NAME SurfaceData.Tools NAMESPACE Gem TARGETS Gem::SurfaceData.Editor)
endif()

@ -40,3 +40,6 @@ ly_add_target(
PRIVATE
Gem::TestAssetBuilder.Static
)
# the above module is for use in builders only
ly_create_alias(NAME TestAssetBuilder.Builders NAMESPACE Gem TARGETS Gem::TestAssetBuilder.Editor)

@ -22,3 +22,9 @@ ly_add_target(
Legacy::CryCommon
AZ::AzFramework
)
# the above module is for use in all application types (there is no tool specialization)
ly_create_alias(NAME TextureAtlas.Servers NAMESPACE Gem TARGETS Gem::TextureAtlas)
ly_create_alias(NAME TextureAtlas.Clients NAMESPACE Gem TARGETS Gem::TextureAtlas)
ly_create_alias(NAME TextureAtlas.Builders NAMESPACE Gem TARGETS Gem::TextureAtlas)
ly_create_alias(NAME TextureAtlas.Tools NAMESPACE Gem TARGETS Gem::TextureAtlas)

@ -38,3 +38,9 @@ ly_add_target(
PRIVATE
Gem::TickBusOrderViewer.Static
)
# the above module is for use in all application types except builders
ly_create_alias(NAME TickBusOrderViewer.Servers NAMESPACE Gem TARGETS Gem::TickBusOrderViewer)
ly_create_alias(NAME TickBusOrderViewer.Clients NAMESPACE Gem TARGETS Gem::TickBusOrderViewer)
ly_create_alias(NAME TickBusOrderViewer.Tools NAMESPACE Gem TARGETS Gem::TickBusOrderViewer)

@ -47,3 +47,9 @@ ly_add_target(
RUNTIME_DEPENDENCIES
Gem::HttpRequestor
)
# the above module is for use in all application types except builders
ly_create_alias(NAME Twitch.Servers NAMESPACE Gem TARGETS Gem::Twitch)
ly_create_alias(NAME Twitch.Clients NAMESPACE Gem TARGETS Gem::Twitch)
ly_create_alias(NAME Twitch.Tools NAMESPACE Gem TARGETS Gem::Twitch)

@ -51,6 +51,10 @@ ly_add_target(
Gem::SurfaceData
)
# the above module is for use in clients and server type applications
ly_create_alias(NAME Vegetation.Servers NAMESPACE Gem TARGETS Gem::Vegetation)
ly_create_alias(NAME Vegetation.Clients NAMESPACE Gem TARGETS Gem::Vegetation)
if(PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
NAME Vegetation.Editor GEM_MODULE
@ -75,6 +79,10 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
Gem::GradientSignal.Editor
Gem::SurfaceData.Editor
)
# the above module is for use in dev tools
ly_create_alias(NAME Vegetation.Builders NAMESPACE Gem TARGETS Gem::Vegetation.Editor)
ly_create_alias(NAME Vegetation.Tools NAMESPACE Gem TARGETS Gem::Vegetation.Editor)
endif()
################################################################################

@ -42,6 +42,11 @@ ly_add_target(
Gem::VideoPlaybackFramework.Static
)
# the video playback framework makes sense in everything but servers:
ly_create_alias(NAME VideoPlaybackFramework.Clients NAMESPACE Gem TARGETS Gem::VideoPlaybackFramework)
ly_create_alias(NAME VideoPlaybackFramework.Tools NAMESPACE Gem TARGETS Gem::VideoPlaybackFramework)
ly_create_alias(NAME VideoPlaybackFramework.Builders NAMESPACE Gem TARGETS Gem::VideoPlaybackFramework)
################################################################################
# Tests
################################################################################

@ -40,3 +40,8 @@ ly_add_target(
PRIVATE
Gem::VirtualGamepad.Static
)
# the virtual gamepad is needed everywhere except servers:
ly_create_alias(NAME VirtualGamepad.Clients NAMESPACE Gem TARGETS Gem::VirtualGamepad)
ly_create_alias(NAME VirtualGamepad.Tools NAMESPACE Gem TARGETS Gem::VirtualGamepad)
ly_create_alias(NAME VirtualGamepad.Builders NAMESPACE Gem TARGETS Gem::VirtualGamepad)

@ -86,6 +86,10 @@ ly_add_target(
Gem::WhiteBox.Static
)
# use the above WhiteBox module in runtimes:
ly_create_alias(NAME WhiteBox.Clients NAMESPACE Gem TARGETS Gem::WhiteBox)
ly_create_alias(NAME WhiteBox.Servers NAMESPACE Gem TARGETS Gem::WhiteBox)
if(PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
NAME WhiteBox.Editor.Static STATIC
@ -129,6 +133,12 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
PRIVATE
Gem::WhiteBox.Editor.Static
)
# use the above WhiteBox.Editor module in dev tools:
ly_create_alias(NAME WhiteBox.Tools NAMESPACE Gem TARGETS Gem::WhiteBox.Editor)
ly_create_alias(NAME WhiteBox.Builders NAMESPACE Gem TARGETS Gem::WhiteBox.Editor)
endif()
################################################################################

@ -0,0 +1,196 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
# This file contains utility wrappers for dealing with the Gems system.
# ly_create_alias
# given an alias to create, and a list of one or more targets,
# this creates an alias that depends on all of the given targets.
function(ly_create_alias)
set(options)
set(oneValueArgs NAME NAMESPACE)
set(multiValueArgs TARGETS)
cmake_parse_arguments(ly_create_alias "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if (NOT ly_create_alias_NAME)
message(FATAL_ERROR "Provide the name of the alias to create using the NAME keyword")
endif()
if (NOT ly_create_alias_NAMESPACE)
message(FATAL_ERROR "Provide the namespace of the alias to create using the NAMESPACE keyword")
endif()
if (NOT ly_create_alias_TARGETS)
message(FATAL_ERROR "Provide the name of the targets the alias be associated with, using the TARGETS keyword")
endif()
if(TARGET ${ly_create_alias_NAMESPACE}::${ly_create_alias_NAME})
message(FATAL_ERROR "Target already exists, cannot create an alias for it: ${ly_create_alias_NAMESPACE}::${ly_create_alias_NAME}\n"
"Make sure the target wasn't copy and pasted here or elsewhere.")
endif()
# easy version - if its juts one target, we can directly get the target, and make both aliases,
# the namespaced and non namespaced one, point at it.
list(LENGTH ly_create_alias_TARGETS number_of_targets)
if (number_of_targets EQUAL 1)
ly_de_alias_target(${ly_create_alias_TARGETS} de_aliased_target_name)
add_library(${ly_create_alias_NAMESPACE}::${ly_create_alias_NAME} ALIAS ${de_aliased_target_name})
if (NOT TARGET ${ly_create_alias_NAME})
add_library(${ly_create_alias_NAME} ALIAS ${de_aliased_target_name})
endif()
return()
endif()
# more complex version - one alias to multiple targets. To actually achieve this
# we have to create an interface library with those dependencies, then we have to create an alias to that target.
# by convention we create one without a namespace then alias the namespaced one.
if(TARGET ${ly_create_alias_NAME})
message(FATAL_ERROR "Internal alias target already exists, cannot create an alias for it: ${ly_create_alias_NAME}\n"
"This could be a copy-paste error, where some part of the ly_create_alias call was changed but the other")
endif()
add_library(${ly_create_alias_NAME} INTERFACE IMPORTED)
set_target_properties(${ly_create_alias_NAME} PROPERTIES GEM_MODULE TRUE)
foreach(target_name ${ly_create_alias_TARGETS})
ly_de_alias_target(${target_name} de_aliased_target_name)
if(NOT de_aliased_target_name)
message(FATAL_ERROR "Target not found in ly_create_alias call: ${target_name} - check your spelling of the target name")
endif()
list(APPEND final_targets ${de_aliased_target_name})
endforeach()
ly_parse_third_party_dependencies("${final_targets}")
ly_add_dependencies(${ly_create_alias_NAME} ${final_targets})
# now add the final alias:
add_library(${ly_create_alias_NAMESPACE}::${ly_create_alias_NAME} ALIAS ${ly_create_alias_NAME})
endfunction()
# ly_enable_gems
# this function makes sure that the given gems, or gems listed in the variable ENABLED_GEMS
# in the GEM_FILE name, are set as runtime dependencies (and thus loaded) for the given targets
# in the context of the given project.
# note that it can't do this immediately, so it saves the data for later processing.
# Note: If you don't supply a project name, it will apply it across the board to all projects.
# this is useful in the case of "ly_add_gems being called for so called 'mandatory gems' inside the engine.
function(ly_enable_gems)
set(options)
set(oneValueArgs PROJECT_NAME GEM_FILE)
set(multiValueArgs GEMS TARGETS VARIANTS)
cmake_parse_arguments(ly_enable_gems "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if (NOT ly_enable_gems_TARGETS)
message(FATAL_ERROR "You must provide the targets to add gems to using the TARGETS keyword")
endif()
if (NOT ly_enable_gems_PROJECT_NAME)
message(VERBOSE "Note: ly_enable_gems called with no PROJECT_NAME name, applying to all projects: \n"
" - VARIANTS ${ly_enable_gems_VARIANTS} \n"
" - GEMS ${ly_enable_gems_GEMS} \n"
" - TARGETS ${ly_enable_gems_TARGETS} \n"
" - GEM_FILE ${ly_enable_gems_GEM_FILE}")
set(ly_enable_gems_PROJECT_NAME "__NOPROJECT__") # so that the token is not blank
endif()
if (NOT ly_enable_gems_VARIANTS)
message(FATAL_ERROR "You must provide at least 1 variant of the gem modules (Editor, Server, Client, Builder) to "
"add to your targets, using the VARIANTS keyword")
endif()
if ((NOT ly_enable_gems_GEMS AND NOT ly_enable_gems_GEM_FILE) OR (ly_enable_gems_GEMS AND ly_enable_gems_GEM_FILE))
message(FATAL_ERROR "Provide exactly one of either GEM_FILE (filename) or GEMS (list of gems) keywords.")
endif()
if (ly_enable_gems_GEM_FILE)
set(store_temp ${ENABLED_GEMS})
include(${ly_enable_gems_GEM_FILE} RESULT_VARIABLE was_able_to_load_the_file)
if(NOT was_able_to_load_the_file)
message(FATAL_ERROR "could not load the GEM_FILE ${ly_enable_gems_GEM_FILE}")
endif()
if(NOT ENABLED_GEMS)
message(FATAL_ERROR "GEM_FILE ${ly_enable_gems_GEM_FILE} did not set the value of ENABLED_GEMS.\n"
"Gem Files should contain set(ENABLED_GEMS ... <list of gem names>)")
endif()
set(ly_enable_gems_GEMS ${ENABLED_GEMS})
set(ENABLED_GEMS ${store_temp}) # restore value of ENABLED_GEMS just in case...
endif()
# all the actual work has to be done later.
foreach(target_name ${ly_enable_gems_TARGETS})
foreach(variant_name ${ly_enable_gems_VARIANTS})
set_property(GLOBAL APPEND PROPERTY LY_DELAYED_ENABLE_GEMS "${ly_enable_gems_PROJECT_NAME},${target_name},${variant_name}")
set_property(GLOBAL APPEND PROPERTY LY_DELAYED_ENABLE_GEMS_"${ly_enable_gems_PROJECT_NAME},${target_name},${variant_name}" ${ly_enable_gems_GEMS})
endforeach()
endforeach()
endfunction()
# call this before runtime dependencies are used to add any relevant targets
# saved by the above function
function(ly_enable_gems_delayed)
get_property(ly_delayed_enable_gems GLOBAL PROPERTY LY_DELAYED_ENABLE_GEMS)
foreach(project_target_variant ${ly_delayed_enable_gems})
# we expect a colon seperated list of
# PROJECT_NAME,target_name,variant_name
string(REPLACE "," ";" project_target_variant_list "${project_target_variant}")
list(LENGTH project_target_variant_list project_target_variant_length)
if(project_target_variant_length EQUAL 0)
continue()
endif()
if(NOT project_target_variant_length EQUAL 3)
message(FATAL_ERROR "Invalid specificaiton of gems, expected 'project','target','variant' and got ${project_target_variant}")
endif()
list(POP_BACK project_target_variant_list variant)
list(POP_BACK project_target_variant_list target)
list(POP_BACK project_target_variant_list project)
get_property(gem_dependencies GLOBAL PROPERTY LY_DELAYED_ENABLE_GEMS_"${project_target_variant}")
if (NOT gem_dependencies)
continue()
endif()
if(${project} STREQUAL "__NOPROJECT__")
# special case, apply to all
unset(PREFIX_CLAUSE)
else()
set(PREFIX_CLAUSE "PREFIX;${project}")
endif()
if (NOT TARGET ${target})
message(FATAL_ERROR "ly_enable_gems specified TARGET '${target}' but no such target was found.")
endif()
# apply the list of gem targets. Adding a gem really just means adding the appropriate dependency.
foreach(gem_name ${gem_dependencies})
if (TARGET Gem::${gem_name}.${variant})
ly_add_target_dependencies(
${PREFIX_CLAUSE}
TARGETS ${target}
DEPENDENT_TARGETS Gem::${gem_name}.${variant}
)
elseif(${variant} STREQUAL "Client" AND TARGET Gem::${gem_name})
# Client can also be 'empty' for backward compatibility
ly_add_target_dependencies(
${PREFIX_CLAUSE}
TARGETS ${target}
DEPENDENT_TARGETS Gem::${gem_name}
)
endif()
endforeach()
endforeach()
endfunction()

@ -719,3 +719,20 @@ function(ly_project_add_subdirectory project_name)
endif()
endif()
endfunction()
# given a target name, returns the "real" name of the target if its an alias.
# this function recursively de-aliases
function(ly_de_alias_target target_name output_variable_name)
# its not okay to call get_target_property on a non-existant target
if (NOT TARGET ${target_name})
message(FATAL_ERROR "ly_de_alias_target called on non-existant target: ${target_name}")
endif()
while(target_name)
set(de_aliased_target_name ${target_name})
get_target_property(target_name ${target_name} ALIASED_TARGET)
endwhile()
set(${output_variable_name} ${de_aliased_target_name} PARENT_SCOPE)
endfunction()

@ -67,6 +67,7 @@ function(ly_get_gem_load_dependencies ly_GEM_LOAD_DEPENDENCIES ly_TARGET)
# Skip wrapping produced when targets are not created in the same directory
if(NOT ${load_dependency} MATCHES "^::@")
get_property(dependency_type TARGET ${load_dependency} PROPERTY TYPE)
get_property(is_gem_target TARGET ${load_dependency} PROPERTY GEM_MODULE SET)
# If the dependency is a "gem module" then add it as a load dependencies
# and recurse into its manually added dependencies
@ -91,12 +92,10 @@ endfunction()
# This can be used for example to determine which list of gems to load with an application
function(ly_delayed_generate_settings_registry)
get_property(ly_delayed_load_targets GLOBAL PROPERTY LY_DELAYED_LOAD_DEPENDENCIES)
foreach(prefix_target ${ly_delayed_load_targets})
string(REPLACE "," ";" prefix_target_list "${prefix_target}")
list(LENGTH prefix_target_list prefix_target_length)
if(prefix_target_length EQUAL 0)
message(SEND_ERROR "Delayed load target is missing target name")
continue()
endif()
@ -116,6 +115,14 @@ function(ly_delayed_generate_settings_registry)
endforeach()
list(REMOVE_DUPLICATES all_gem_dependencies)
# de-namespace them
foreach(gem_target ${all_gem_dependencies})
ly_strip_target_namespace(TARGET ${gem_target} OUTPUT_VARIABLE stripped_gem_target)
list(APPEND new_gem_dependencies ${stripped_gem_target})
endforeach()
set(all_gem_dependencies ${new_gem_dependencies})
list(REMOVE_DUPLICATES all_gem_dependencies)
unset(target_gem_dependencies_names)
foreach(gem_target ${all_gem_dependencies})
unset(gem_relative_source_dir)
@ -123,6 +130,14 @@ function(ly_delayed_generate_settings_registry)
if (NOT TARGET ${gem_target})
message(FATAL_ERROR "Dependency ${gem_target} from ${target} does not exist")
endif()
get_target_property(target_type ${gem_target} TYPE)
if (target_type STREQUAL "INTERFACE_LIBRARY")
# don't use interface libraries here, we only want ones which produce actual binaries.
# we have still already recursed into their dependencies - they'll show up later.
continue()
endif()
get_property(gem_relative_source_dir TARGET ${gem_target} PROPERTY SOURCE_DIR)
if(gem_relative_source_dir)
# Most gems CMakeLists.txt files reside in the <GemSourceDir>/Code/ so remove "Code/" from the path

Loading…
Cancel
Save