diff --git a/CMakeLists.txt b/CMakeLists.txt index 387f536966..6ca9aeacb8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,28 +88,28 @@ if(NOT INSTALLED_ENGINE) # Add external subdirectories listed in the engine.json. LY_EXTERNAL_SUBDIRS is a cache variable so the user can add extra # external subdirectories add_engine_json_external_subdirectories() - get_property(external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS) - list(APPEND LY_EXTERNAL_SUBDIRS ${external_subdirs}) - - # Loop over the additional external subdirectories and invoke add_subdirectory on them - foreach(external_directory ${LY_EXTERNAL_SUBDIRS}) - # Hash the extenal_directory name and append it to the Binary Directory section of add_subdirectory - # This is to deal with potential situations where multiple external directories has the same last directory name - # For example if D:/Company1/RayTracingGem and F:/Company2/Path/RayTracingGem were both added as a subdirectory - file(REAL_PATH ${external_directory} full_directory_path) - string(SHA256 full_directory_hash ${full_directory_path}) - # Truncate the full_directory_hash down to 8 characters to avoid hitting the Windows 260 character path limit - # when the external subdirectory contains relative paths of significant length - string(SUBSTRING ${full_directory_hash} 0 8 full_directory_hash) - # Use the last directory as the suffix path to use for the Binary Directory - get_filename_component(directory_name ${external_directory} NAME) - add_subdirectory(${external_directory} ${CMAKE_BINARY_DIR}/External/${directory_name}-${full_directory_hash}) - endforeach() - else() ly_find_o3de_packages() endif() +get_property(external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS) +list(APPEND LY_EXTERNAL_SUBDIRS ${external_subdirs}) + +# Loop over the additional external subdirectories and invoke add_subdirectory on them +foreach(external_directory ${LY_EXTERNAL_SUBDIRS}) + # Hash the extenal_directory name and append it to the Binary Directory section of add_subdirectory + # This is to deal with potential situations where multiple external directories has the same last directory name + # For example if D:/Company1/RayTracingGem and F:/Company2/Path/RayTracingGem were both added as a subdirectory + file(REAL_PATH ${external_directory} full_directory_path) + string(SHA256 full_directory_hash ${full_directory_path}) + # Truncate the full_directory_hash down to 8 characters to avoid hitting the Windows 260 character path limit + # when the external subdirectory contains relative paths of significant length + string(SUBSTRING ${full_directory_hash} 0 8 full_directory_hash) + # Use the last directory as the suffix path to use for the Binary Directory + get_filename_component(directory_name ${external_directory} NAME) + add_subdirectory(${external_directory} ${CMAKE_BINARY_DIR}/External/${directory_name}-${full_directory_hash}) +endforeach() + ################################################################################ # Post-processing ################################################################################ diff --git a/Code/Framework/AzTest/CMakeLists.txt b/Code/Framework/AzTest/CMakeLists.txt index ff31b32a24..fe5ec2d0ff 100644 --- a/Code/Framework/AzTest/CMakeLists.txt +++ b/Code/Framework/AzTest/CMakeLists.txt @@ -8,29 +8,25 @@ # 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. # + +ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/AzTest/Platform/${PAL_PLATFORM_NAME}) -if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) - - ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/AzTest/Platform/${PAL_PLATFORM_NAME}) - - ly_add_target( - NAME AzTest STATIC - NAMESPACE AZ - FILES_CMAKE - AzTest/aztest_files.cmake - ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake - INCLUDE_DIRECTORIES - PUBLIC - . - ${pal_dir} - BUILD_DEPENDENCIES - PUBLIC - 3rdParty::googletest::GMock - 3rdParty::googletest::GTest - 3rdParty::GoogleBenchmark - AZ::AzCore - PLATFORM_INCLUDE_FILES - ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake - ) - -endif() +ly_add_target( + NAME AzTest STATIC + NAMESPACE AZ + FILES_CMAKE + AzTest/aztest_files.cmake + ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake + INCLUDE_DIRECTORIES + PUBLIC + . + ${pal_dir} + BUILD_DEPENDENCIES + PUBLIC + 3rdParty::googletest::GMock + 3rdParty::googletest::GTest + 3rdParty::GoogleBenchmark + AZ::AzCore + PLATFORM_INCLUDE_FILES + ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake +) diff --git a/Code/LauncherUnified/launcher_generator.cmake b/Code/LauncherUnified/launcher_generator.cmake index c5d60eb29e..2f4c8a8b74 100644 --- a/Code/LauncherUnified/launcher_generator.cmake +++ b/Code/LauncherUnified/launcher_generator.cmake @@ -16,6 +16,7 @@ set_property(GLOBAL PROPERTY LAUNCHER_UNIFIED_BINARY_DIR ${CMAKE_CURRENT_BINARY_ # When using an installed engine, this file will be included by the FindLauncherGenerator.cmake script get_property(LY_PROJECTS_TARGET_NAME GLOBAL PROPERTY LY_PROJECTS_TARGET_NAME) foreach(project_name project_path IN ZIP_LISTS LY_PROJECTS_TARGET_NAME LY_PROJECTS) + # Computes the realpath to the project # If the project_path is relative, it is evaluated relative to the ${LY_ROOT_FOLDER} # Otherwise the the absolute project_path is returned with symlinks resolved @@ -35,6 +36,28 @@ foreach(project_name project_path IN ZIP_LISTS LY_PROJECTS_TARGET_NAME LY_PROJEC "to the LY_PROJECTS_TARGET_NAME global property. Other configuration errors might occur") endif() endif() + + ################################################################################ + # Assets + ################################################################################ + if(PAL_TRAIT_BUILD_HOST_TOOLS) + add_custom_target(${project_name}.Assets + COMMENT "Processing ${project_name} assets..." + COMMAND "${CMAKE_COMMAND}" + -DLY_LOCK_FILE=$/project_assets.lock + -P ${LY_ROOT_FOLDER}/cmake/CommandExecution.cmake + EXEC_COMMAND $ + --zeroAnalysisMode + --project-path=${project_real_path} + --platforms=${LY_ASSET_DEPLOY_ASSET_TYPE} + ) + set_target_properties(${project_name}.Assets + PROPERTIES + EXCLUDE_FROM_ALL TRUE + FOLDER ${project_name} + ) + endif() + ################################################################################ # Monolithic game ################################################################################ diff --git a/Code/Tools/AzTestRunner/CMakeLists.txt b/Code/Tools/AzTestRunner/CMakeLists.txt index d3598c397e..e6dd09e15b 100644 --- a/Code/Tools/AzTestRunner/CMakeLists.txt +++ b/Code/Tools/AzTestRunner/CMakeLists.txt @@ -9,12 +9,12 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) +ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) - ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) - - include(${pal_dir}/platform_traits_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) +include(${pal_dir}/platform_traits_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) +if(PAL_TRAIT_AZTESTRUNNER_SUPPORTED) + ly_add_target( NAME AzTestRunner ${PAL_TRAIT_AZTESTRUNNER_LAUNCHER_TYPE} NAMESPACE AZ @@ -32,19 +32,23 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) AZ::AzTest AZ::AzFramework ) + + if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) + + ly_add_target( + NAME AzTestRunner.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} + NAMESPACE AZ + FILES_CMAKE + aztestrunner_test_files.cmake + BUILD_DEPENDENCIES + PRIVATE + AZ::AzTest + ) - ly_add_target( - NAME AzTestRunner.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} - NAMESPACE AZ - FILES_CMAKE - aztestrunner_test_files.cmake - BUILD_DEPENDENCIES - PRIVATE - AZ::AzTest - ) + ly_add_googletest( + NAME AZ::AzTestRunner.Tests + ) - ly_add_googletest( - NAME AZ::AzTestRunner.Tests - ) + endif() endif() diff --git a/Code/Tools/AzTestRunner/Platform/Android/platform_traits_android.cmake b/Code/Tools/AzTestRunner/Platform/Android/platform_traits_android.cmake index 40de4bd3eb..77d7b868d4 100644 --- a/Code/Tools/AzTestRunner/Platform/Android/platform_traits_android.cmake +++ b/Code/Tools/AzTestRunner/Platform/Android/platform_traits_android.cmake @@ -9,5 +9,5 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +set(PAL_TRAIT_AZTESTRUNNER_SUPPORTED TRUE) set(PAL_TRAIT_AZTESTRUNNER_LAUNCHER_TYPE MODULE) - diff --git a/Code/Tools/AzTestRunner/Platform/Linux/platform_traits_linux.cmake b/Code/Tools/AzTestRunner/Platform/Linux/platform_traits_linux.cmake index 59922965bb..4c623c1f7b 100644 --- a/Code/Tools/AzTestRunner/Platform/Linux/platform_traits_linux.cmake +++ b/Code/Tools/AzTestRunner/Platform/Linux/platform_traits_linux.cmake @@ -9,5 +9,5 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +set(PAL_TRAIT_AZTESTRUNNER_SUPPORTED TRUE) set(PAL_TRAIT_AZTESTRUNNER_LAUNCHER_TYPE EXECUTABLE) - diff --git a/Code/Tools/AzTestRunner/Platform/Mac/platform_traits_mac.cmake b/Code/Tools/AzTestRunner/Platform/Mac/platform_traits_mac.cmake index 59922965bb..4c623c1f7b 100644 --- a/Code/Tools/AzTestRunner/Platform/Mac/platform_traits_mac.cmake +++ b/Code/Tools/AzTestRunner/Platform/Mac/platform_traits_mac.cmake @@ -9,5 +9,5 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +set(PAL_TRAIT_AZTESTRUNNER_SUPPORTED TRUE) set(PAL_TRAIT_AZTESTRUNNER_LAUNCHER_TYPE EXECUTABLE) - diff --git a/Code/Tools/AzTestRunner/Platform/Windows/platform_traits_windows.cmake b/Code/Tools/AzTestRunner/Platform/Windows/platform_traits_windows.cmake index 59922965bb..4c623c1f7b 100644 --- a/Code/Tools/AzTestRunner/Platform/Windows/platform_traits_windows.cmake +++ b/Code/Tools/AzTestRunner/Platform/Windows/platform_traits_windows.cmake @@ -9,5 +9,5 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +set(PAL_TRAIT_AZTESTRUNNER_SUPPORTED TRUE) set(PAL_TRAIT_AZTESTRUNNER_LAUNCHER_TYPE EXECUTABLE) - diff --git a/Code/Tools/AzTestRunner/Platform/iOS/platform_traits_ios.cmake b/Code/Tools/AzTestRunner/Platform/iOS/platform_traits_ios.cmake index 59922965bb..4c623c1f7b 100644 --- a/Code/Tools/AzTestRunner/Platform/iOS/platform_traits_ios.cmake +++ b/Code/Tools/AzTestRunner/Platform/iOS/platform_traits_ios.cmake @@ -9,5 +9,5 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +set(PAL_TRAIT_AZTESTRUNNER_SUPPORTED TRUE) set(PAL_TRAIT_AZTESTRUNNER_LAUNCHER_TYPE EXECUTABLE) - diff --git a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCommonMenu.cpp b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCommonMenu.cpp index 5107a02835..c750aea38d 100644 --- a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCommonMenu.cpp +++ b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCommonMenu.cpp @@ -693,7 +693,7 @@ namespace ImGui ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "Left Stick"); ImGui::NextColumn(); ImGui::Bullet(); - ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "Mova Mouse Pointer"); + ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "Move Mouse Pointer"); ImGui::Separator(); ImGui::NextColumn(); diff --git a/cmake/Platform/Common/Install_common.cmake b/cmake/Platform/Common/Install_common.cmake index 4aeaf21e95..a579e3128d 100644 --- a/cmake/Platform/Common/Install_common.cmake +++ b/cmake/Platform/Common/Install_common.cmake @@ -162,7 +162,18 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME) elseif(target_type STREQUAL MODULE_LIBRARY) set(target_location "\${LY_ROOT_FOLDER}/${library_output_directory}/${PAL_PLATFORM_NAME}/$/${target_library_output_subdirectory}/$") elseif(target_type STREQUAL SHARED_LIBRARY) - string(APPEND target_file_contents "set_property(TARGET ${TARGET_NAME} PROPERTY IMPORTED_IMPLIB_$ \"\${LY_ROOT_FOLDER}/${archive_output_directory}/${PAL_PLATFORM_NAME}/$/$\")\n") + string(APPEND target_file_contents +"set_property(TARGET ${TARGET_NAME} + APPEND_STRING PROPERTY IMPORTED_IMPLIB + $<$$:\"\${LY_ROOT_FOLDER}/${archive_output_directory}/${PAL_PLATFORM_NAME}/$/$\"$ +) +") + string(APPEND target_file_contents +"set_property(TARGET ${TARGET_NAME} + PROPERTY IMPORTED_IMPLIB_$> + \"\${LY_ROOT_FOLDER}/${archive_output_directory}/${PAL_PLATFORM_NAME}/$/$\" +) +") set(target_location "\${LY_ROOT_FOLDER}/${library_output_directory}/${PAL_PLATFORM_NAME}/$/${target_library_output_subdirectory}/$") else() # STATIC_LIBRARY, OBJECT_LIBRARY, INTERFACE_LIBRARY set(target_location "\${LY_ROOT_FOLDER}/${archive_output_directory}/${PAL_PLATFORM_NAME}/$/$") diff --git a/cmake/Platform/Common/VisualStudio_common.cmake b/cmake/Platform/Common/VisualStudio_common.cmake index fd38a8c7ce..9a23a26d34 100644 --- a/cmake/Platform/Common/VisualStudio_common.cmake +++ b/cmake/Platform/Common/VisualStudio_common.cmake @@ -10,5 +10,5 @@ # if(CMAKE_GENERATOR MATCHES "Visual Studio 16") - configure_file("${CMAKE_CURRENT_LIST_DIR}/Directory.Build.props" "${CMAKE_CURRENT_BINARY_DIR}/Directory.Build.props" COPYONLY) + configure_file("${CMAKE_CURRENT_LIST_DIR}/Directory.Build.props" "${CMAKE_BINARY_DIR}/Directory.Build.props" COPYONLY) endif() \ No newline at end of file diff --git a/scripts/ctest/CMakeLists.txt b/scripts/ctest/CMakeLists.txt index f9824889e3..575be53cc7 100644 --- a/scripts/ctest/CMakeLists.txt +++ b/scripts/ctest/CMakeLists.txt @@ -16,35 +16,6 @@ if(NOT PAL_TRAIT_BUILD_TESTS_SUPPORTED) return() endif() -################################################################################ -# Asset Processing Target -# i.e. Tests depend on AutomatedTesting.Assets -################################################################################ - -if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) - get_property(LY_PROJECTS_TARGET_NAME GLOBAL PROPERTY LY_PROJECTS_TARGET_NAME) - foreach(project_target_name project_path IN ZIP_LISTS LY_PROJECTS_TARGET_NAME LY_PROJECTS) - file(REAL_PATH ${project_path} project_real_path BASE_DIRECTORY ${LY_ROOT_FOLDER}) - # With the lock file, asset processing jobs are serialized to avoid race conditions - # on files that are created temporarily in source folders during shader processing. - add_custom_target(${project_target_name}.Assets - COMMENT "Processing ${project_target_name} assets..." - COMMAND "${CMAKE_COMMAND}" - -DLY_LOCK_FILE=$/project_assets.lock - -P ${LY_ROOT_FOLDER}/cmake/CommandExecution.cmake - EXEC_COMMAND $ - --zeroAnalysisMode - --project-path=${project_real_path} - --platforms=${LY_ASSET_DEPLOY_ASSET_TYPE} - ) - set_target_properties(${project_target_name}.Assets - PROPERTIES - EXCLUDE_FROM_ALL TRUE - FOLDER ${project_target_name} - ) - endforeach() -endif() - ################################################################################ # Tests ################################################################################