Merge commit 'b44ce82435b7f737bca73bcf25e553d6c7b23f27' into amzn-tommy/gitflow_211116_o3de2
This commit is contained in:
@@ -202,18 +202,16 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar
|
||||
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)
|
||||
if(RUNTIME_DEPENDENCIES_PLACEHOLDER) # not found properties return the name of the variable with a "-NOTFOUND" at the end, here we set it to empty if not found
|
||||
set(RUNTIME_DEPENDENCIES_PLACEHOLDER "${PLACEHOLDER_INDENT}${RUNTIME_DEPENDENCIES_PLACEHOLDER}")
|
||||
list(JOIN RUNTIME_DEPENDENCIES_PLACEHOLDER "\n${PLACEHOLDER_INDENT}" RUNTIME_DEPENDENCIES_PLACEHOLDER)
|
||||
else()
|
||||
unset(RUNTIME_DEPENDENCIES_PLACEHOLDER)
|
||||
endif()
|
||||
|
||||
string(REPEAT " " 12 PLACEHOLDER_INDENT)
|
||||
get_property(interface_build_dependencies_props TARGET ${TARGET_NAME} PROPERTY LY_DELAYED_LINK)
|
||||
unset(INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER)
|
||||
# We can have private build dependencies that contains direct or indirect runtime dependencies.
|
||||
# Since imported targets cannot contain build dependencies, we need another way to propagate the runtime dependencies.
|
||||
# We dont want to put such dependencies in the interface because a user can mistakenly use a symbol that is not available
|
||||
# when using the engine from source (and that the author of the target didn't want to set public).
|
||||
# To overcome this, we will actually expose the private build dependencies as runtime dependencies. Our runtime dependency
|
||||
# algorithm will walk recursively also through static libraries and will only copy binaries to the output.
|
||||
unset(RUNTIME_DEPENDENCIES_PLACEHOLDER)
|
||||
if(interface_build_dependencies_props)
|
||||
cmake_parse_arguments(build_deps "" "" "PRIVATE;PUBLIC;INTERFACE" ${interface_build_dependencies_props})
|
||||
# Interface and public dependencies should always be exposed
|
||||
@@ -226,6 +224,8 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar
|
||||
if("${target_type}" STREQUAL "STATIC_LIBRARY")
|
||||
set(build_deps_target "${build_deps_target};${build_deps_PRIVATE}")
|
||||
endif()
|
||||
# But we will also pass the private dependencies as runtime dependencies (note the comment above)
|
||||
set(RUNTIME_DEPENDENCIES_PLACEHOLDER ${build_deps_PRIVATE})
|
||||
foreach(build_dependency IN LISTS build_deps_target)
|
||||
# Skip wrapping produced when targets are not created in the same directory
|
||||
if(build_dependency)
|
||||
@@ -235,6 +235,18 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar
|
||||
endif()
|
||||
list(JOIN INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER "\n" INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER)
|
||||
|
||||
string(REPEAT " " 8 PLACEHOLDER_INDENT)
|
||||
get_target_property(manually_added_dependencies ${TARGET_NAME} MANUALLY_ADDED_DEPENDENCIES)
|
||||
if(manually_added_dependencies) # not found properties return the name of the variable with a "-NOTFOUND" at the end, here we set it to empty if not found
|
||||
list(APPEND RUNTIME_DEPENDENCIES_PLACEHOLDER ${manually_added_dependencies})
|
||||
endif()
|
||||
if(RUNTIME_DEPENDENCIES_PLACEHOLDER)
|
||||
set(RUNTIME_DEPENDENCIES_PLACEHOLDER "${PLACEHOLDER_INDENT}${RUNTIME_DEPENDENCIES_PLACEHOLDER}")
|
||||
list(JOIN RUNTIME_DEPENDENCIES_PLACEHOLDER "\n${PLACEHOLDER_INDENT}" RUNTIME_DEPENDENCIES_PLACEHOLDER)
|
||||
else()
|
||||
unset(RUNTIME_DEPENDENCIES_PLACEHOLDER)
|
||||
endif()
|
||||
|
||||
string(REPEAT " " 8 PLACEHOLDER_INDENT)
|
||||
# If a target has an LY_PROJECT_NAME property, forward that property to new target
|
||||
get_target_property(target_project_association ${TARGET_NAME} LY_PROJECT_NAME)
|
||||
|
||||
Reference in New Issue
Block a user