From 69e79867be5f87132c43c89f8ca081d543498242 Mon Sep 17 00:00:00 2001 From: pappeste Date: Thu, 27 May 2021 20:12:48 -0700 Subject: [PATCH] Making imported targets global, fixing identiation of the enabled_gems.cmake file --- AutomatedTesting/Gem/Code/enabled_gems.cmake | 2 +- cmake/Gems.cmake | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/AutomatedTesting/Gem/Code/enabled_gems.cmake b/AutomatedTesting/Gem/Code/enabled_gems.cmake index 32fdd11415..2ea800bae6 100644 --- a/AutomatedTesting/Gem/Code/enabled_gems.cmake +++ b/AutomatedTesting/Gem/Code/enabled_gems.cmake @@ -54,4 +54,4 @@ set(ENABLED_GEMS AWSCore AWSClientAuth AWSMetrics - ) +) diff --git a/cmake/Gems.cmake b/cmake/Gems.cmake index a90cf09639..d418d5dcd1 100644 --- a/cmake/Gems.cmake +++ b/cmake/Gems.cmake @@ -63,13 +63,17 @@ function(ly_create_alias) "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) + add_library(${ly_create_alias_NAME} INTERFACE IMPORTED GLOBAL) 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") + if(TARGET ${target_name}) + 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() + else() + set(de_aliased_target_name ${target_name}) endif() list(APPEND final_targets ${de_aliased_target_name}) endforeach()