Fixes monolithic and non-monolithic installed builds (test project builds against debug/profile non-monolithic and release monolithic)

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-10-27 13:04:10 -07:00
parent b7b79efd69
commit 46fc1a720c
3 changed files with 25 additions and 15 deletions
+1 -2
View File
@@ -107,7 +107,7 @@ ly_add_target(
Gem::Atom_RHI.Reflect
Gem::Atom_RHI_DX12.Reflect
3rdParty::d3dx12
${AFTERMATH_BUILD_DEPENDENCY}
${AFTERMATH_BUILD_DEPENDENCY}
COMPILE_DEFINITIONS
PRIVATE
${USE_NSIGHT_AFTERMATH_DEFINE}
@@ -128,7 +128,6 @@ ly_add_target(
BUILD_DEPENDENCIES
PRIVATE
AZ::AzCore
Gem::Atom_RHI.Reflect
Gem::Atom_RHI.Public
Gem::Atom_RHI_DX12.Reflect
@@ -10,6 +10,7 @@ set(FILES
Include/InAppPurchases/InAppPurchasesBus.h
Include/InAppPurchases/InAppPurchasesInterface.h
Include/InAppPurchases/InAppPurchasesResponseBus.h
Source/InAppPurchasesSystemComponent.h
Source/InAppPurchasesSystemComponent.cpp
Source/InAppPurchasesInterface.cpp
)
+23 -13
View File
@@ -192,16 +192,15 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar
endif()
# Includes need additional processing to add the install root
if(include_directories)
foreach(include ${include_directories})
string(GENEX_STRIP ${include} include_genex_expr)
if(include_genex_expr STREQUAL include) # only for cases where there are no generation expressions
# Make the include path relative to the source dir where the target will be declared
cmake_path(RELATIVE_PATH include BASE_DIRECTORY ${absolute_target_source_dir} OUTPUT_VARIABLE target_include)
string(APPEND INCLUDE_DIRECTORIES_PLACEHOLDER "${PLACEHOLDER_INDENT}${target_include}\n")
endif()
endforeach()
endif()
foreach(include IN LISTS include_directories)
string(GENEX_STRIP ${include} include_genex_expr)
if(include_genex_expr STREQUAL include) # only for cases where there are no generation expressions
# Make the include path relative to the source dir where the target will be declared
cmake_path(RELATIVE_PATH include BASE_DIRECTORY ${absolute_target_source_dir} OUTPUT_VARIABLE target_include)
list(APPEND INCLUDE_DIRECTORIES_PLACEHOLDER "${PLACEHOLDER_INDENT}${target_include}")
endif()
endforeach()
list(JOIN INCLUDE_DIRECTORIES_PLACEHOLDER "\n" INCLUDE_DIRECTORIES_PLACEHOLDER)
string(REPEAT " " 8 PLACEHOLDER_INDENT)
get_target_property(RUNTIME_DEPENDENCIES_PLACEHOLDER ${TARGET_NAME} MANUALLY_ADDED_DEPENDENCIES)
@@ -217,12 +216,23 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar
unset(INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER)
if(inteface_build_dependencies_props)
cmake_parse_arguments(build_deps "" "" "PRIVATE;PUBLIC;INTERFACE" ${inteface_build_dependencies_props})
foreach(build_dependency IN LISTS build_deps_INTERFACE build_deps_PUBLIC)
# Interface and public dependencies should always be exposed
set(build_deps_target ${build_deps_INTERFACE})
if(build_deps_PUBLIC)
set(build_deps_target "${build_deps_target};${build_deps_PUBLIC}")
endif()
# Private dependencies should only be exposed if it is a static library, since in those cases, link
# dependencies are transfered to the downstream dependencies
if("${target_type}" STREQUAL "STATIC_LIBRARY")
set(build_deps_target "${build_deps_target};${build_deps_PRIVATE}")
endif()
foreach(build_dependency IN LISTS build_deps_target)
# Skip wrapping produced when targets are not created in the same directory
list(APPEND INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER "${PLACEHOLDER_INDENT}${build_dependency}")
if(build_dependency)
list(APPEND INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER "${PLACEHOLDER_INDENT}${build_dependency}")
endif()
endforeach()
endif()
list(REMOVE_DUPLICATES INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER)
list(JOIN INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER "\n" INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER)
string(REPEAT " " 8 PLACEHOLDER_INDENT)