fixes monolithic vs non-monolithic installation (generates, monolithic doesnt build)

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-10-27 10:17:27 -07:00
parent fec1b2fda2
commit b7b79efd69
4 changed files with 25 additions and 25 deletions
@@ -208,7 +208,7 @@ namespace AZ
return;
}
const uint32_t originalVersion = m_materialTypeVersion;
[[maybe_unused]] const uint32_t originalVersion = m_materialTypeVersion;
bool changesWereApplied = false;
+3 -4
View File
@@ -403,7 +403,7 @@ function(ly_target_link_libraries TARGET)
message(FATAL_ERROR "You must provide a target")
endif()
set_property(GLOBAL APPEND PROPERTY LY_DELAYED_LINK_${TARGET} ${ARGN})
set_property(TARGET ${TARGET} APPEND PROPERTY LY_DELAYED_LINK ${ARGN})
set_property(GLOBAL APPEND PROPERTY LY_DELAYED_LINK_TARGETS ${TARGET}) # to walk them at the end
endfunction()
@@ -430,7 +430,7 @@ function(ly_delayed_target_link_libraries)
get_property(delayed_targets GLOBAL PROPERTY LY_DELAYED_LINK_TARGETS)
foreach(target ${delayed_targets})
get_property(delayed_link GLOBAL PROPERTY LY_DELAYED_LINK_${target})
get_property(delayed_link TARGET ${target} PROPERTY LY_DELAYED_LINK)
if(delayed_link)
cmake_parse_arguments(ly_delayed_target_link_libraries "" "" "${visibilities}" ${delayed_link})
@@ -458,9 +458,8 @@ function(ly_delayed_target_link_libraries)
endforeach()
endforeach()
set_property(GLOBAL PROPERTY LY_DELAYED_LINK_${target})
endif()
endif()
endforeach()
set_property(GLOBAL PROPERTY LY_DELAYED_LINK_TARGETS)
+20 -19
View File
@@ -85,6 +85,16 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar
continue()
endif()
# For some cases (e.g. codegen) we generate headers that end up in the BUILD_DIR. Since the BUILD_DIR
# is per-permutation, we need to install such headers per permutation. For the other cases, we can install
# under the default component since they are shared across permutations/configs.
cmake_path(IS_PREFIX CMAKE_BINARY_DIR ${include_directory} NORMALIZE include_directory_child_of_build)
if(NOT include_directory_child_of_build)
set(include_directory_component ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME})
else()
set(include_directory_component ${LY_INSTALL_PERMUTATION_COMPONENT})
endif()
unset(rel_include_dir)
cmake_path(RELATIVE_PATH include_directory BASE_DIRECTORY ${LY_ROOT_FOLDER} OUTPUT_VARIABLE rel_include_dir)
cmake_path(APPEND rel_include_dir "..")
@@ -92,7 +102,7 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar
ly_install(DIRECTORY ${include_directory}
DESTINATION ${destination_dir}
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
COMPONENT ${include_directory_component}
FILES_MATCHING
PATTERN *.h
PATTERN *.hpp
@@ -203,24 +213,13 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar
endif()
string(REPEAT " " 12 PLACEHOLDER_INDENT)
get_target_property(inteface_build_dependencies_props ${TARGET_NAME} INTERFACE_LINK_LIBRARIES)
get_property(inteface_build_dependencies_props TARGET ${TARGET_NAME} PROPERTY LY_DELAYED_LINK)
unset(INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER)
if(inteface_build_dependencies_props)
foreach(build_dependency ${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)
# Skip wrapping produced when targets are not created in the same directory
if(NOT ${build_dependency} MATCHES "^::@")
list(APPEND INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER "${PLACEHOLDER_INDENT}${build_dependency}")
endif()
endforeach()
endif()
# We also need to pass the private link libraries since we will use that to generate the runtime dependencies
get_target_property(private_build_dependencies_props ${TARGET_NAME} LINK_LIBRARIES)
if(private_build_dependencies_props)
foreach(build_dependency ${private_build_dependencies_props})
# Skip wrapping produced when targets are not created in the same directory
if(NOT ${build_dependency} MATCHES "^::@")
list(APPEND INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER "${PLACEHOLDER_INDENT}${build_dependency}")
endif()
list(APPEND INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER "${PLACEHOLDER_INDENT}${build_dependency}")
endforeach()
endif()
list(REMOVE_DUPLICATES INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER)
@@ -353,7 +352,7 @@ include(Platform/${PAL_PLATFORM_NAME}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cm
file(CONFIGURE OUTPUT "${target_install_source_dir}/Platform/${PAL_PLATFORM_NAME}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake" CONTENT [[
@cmake_copyright_comment@
if(LY_MONOLITHIC_GAME)
include(Platform/${PAL_PLATFORM_NAME}/Monolithic/permutation.cmake)
include(Platform/${PAL_PLATFORM_NAME}/Monolithic/permutation.cmake OPTIONAL)
else()
include(Platform/${PAL_PLATFORM_NAME}/Default/permutation.cmake)
endif()
@@ -394,6 +393,7 @@ function(ly_setup_cmake_install)
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
PATTERN "__pycache__" EXCLUDE
PATTERN "Findo3de.cmake" EXCLUDE
PATTERN "cmake/ConfigurationTypes.cmake" EXCLUDE
REGEX "3rdParty/Platform\/.*\/BuiltInPackages_.*\.cmake" EXCLUDE
)
@@ -739,7 +739,7 @@ function(ly_setup_o3de_install)
# Misc
ly_install(FILES
${LY_ROOT_FOLDER}/ctest_pytest.ini
${LY_ROOT_FOLDER}/pytest.ini
${LY_ROOT_FOLDER}/LICENSE.txt
${LY_ROOT_FOLDER}/README.md
DESTINATION .
@@ -750,7 +750,8 @@ function(ly_setup_o3de_install)
foreach(external_dir ${LY_INSTALL_EXTERNAL_BUILD_DIRS})
ly_install(CODE
"set(LY_CORE_COMPONENT_ALREADY_INCLUDED TRUE)
include(${external_dir}/cmake_install.cmake)"
include(${external_dir}/cmake_install.cmake)
set(LY_CORE_COMPONENT_ALREADY_INCLUDED FALSE)"
ALL_COMPONENTS
)
endforeach()
@@ -8,4 +8,4 @@
include_guard(GLOBAL)
list(APPEND CMAKE_CONFIGURATION_TYPES @CMAKE_INSTALL_CONFIG_NAME@)
list(APPEND CMAKE_CONFIGURATION_TYPES @conf@)