Merge remote-tracking branch 'upstream/development' into Atom/santora/UseLibPng

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
This commit is contained in:
santorac
2021-09-09 00:05:29 -07:00
3939 changed files with 471645 additions and 181007 deletions
+9 -15
View File
@@ -122,7 +122,11 @@ function(ly_add_external_target)
set(BASE_PATH "${LY_3RDPARTY_PATH}/${ly_add_external_target_3RDPARTY_DIRECTORY}")
else()
ly_install_external_target(${ly_add_external_target_3RDPARTY_ROOT_DIRECTORY})
# only install external 3rdParty that are within the source tree
cmake_path(IS_PREFIX LY_ROOT_FOLDER ${ly_add_external_target_3RDPARTY_ROOT_DIRECTORY} NORMALIZE is_in_source_tree)
if(is_in_source_tree)
ly_install_external_target(${ly_add_external_target_3RDPARTY_ROOT_DIRECTORY})
endif()
set(BASE_PATH "${ly_add_external_target_3RDPARTY_ROOT_DIRECTORY}")
endif()
@@ -305,21 +309,11 @@ endfunction()
# \arg:3RDPARTY_ROOT_DIRECTORY custom 3rd party directory which needs to be installed
function(ly_install_external_target 3RDPARTY_ROOT_DIRECTORY)
# Install the Find file to our <install_location>/cmake directory
install(FILES ${CMAKE_CURRENT_LIST_FILE}
DESTINATION cmake
# Install the Find file to our <install_location>/cmake/3rdParty directory
ly_install_files(FILES ${CMAKE_CURRENT_LIST_FILE}
DESTINATION cmake/3rdParty
)
# We only want to install external targets that are part of our source tree
# Checking for relative path beginning with "../" also works when the path
# given is on another drive letter on windows(i.e., RELATIVE_PATH returns an absolute path)
file(RELATIVE_PATH rel_path ${CMAKE_SOURCE_DIR} ${3RDPARTY_ROOT_DIRECTORY})
if (NOT ${rel_path} MATCHES "^../")
get_filename_component(rel_path ${rel_path} DIRECTORY)
install(DIRECTORY ${3RDPARTY_ROOT_DIRECTORY}
DESTINATION ${rel_path}
)
endif()
ly_install_directory(DIRECTORIES "${3RDPARTY_ROOT_DIRECTORY}")
endfunction()
+9 -10
View File
@@ -6,14 +6,13 @@
#
#
if(LY_PIX_ENABLED)
file(TO_CMAKE_PATH "${LY_PIX_PATH}" PIX_PATH)
message(STATUS "PIX found: ${PIX_PATH}")
set(LY_PIX_PATH "${LY_3RDPARTY_PATH}/winpixeventruntime" CACHE PATH "Path to the Windows Pix Event Runtime.")
ly_add_external_target(
NAME pix
3RDPARTY_ROOT_DIRECTORY ${LY_PIX_PATH}
VERSION
INCLUDE_DIRECTORIES Include
COMPILE_DEFINITIONS USE_PIX
)
ly_add_external_target(
NAME pix
3RDPARTY_ROOT_DIRECTORY "${PIX_PATH}"
VERSION
INCLUDE_DIRECTORIES include
)
endif()
@@ -11,7 +11,6 @@ ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5
ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-rev1-multiplatform TARGETS RapidJSON PACKAGE_HASH 2f5e26ecf86c3b7a262753e7da69ac59928e78e9534361f3d00c1ad5879e4023)
ly_associate_package(PACKAGE_NAME RapidXML-1.13-multiplatform TARGETS RapidXML PACKAGE_HASH 510b3c12f8872c54b34733e34f2f69dd21837feafa55bfefa445c98318d96ebf)
ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform TARGETS cityhash PACKAGE_HASH 0ace9e6f0b2438c5837510032d2d4109125845c0efd7d807f4561ec905512dd2)
ly_associate_package(PACKAGE_NAME lz4-r128-multiplatform TARGETS lz4 PACKAGE_HASH d7b1d5651191db2c339827ad24f669d9d37754143e9173abc986184532f57c9d)
ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform TARGETS expat PACKAGE_HASH 452256acd1fd699cef24162575b3524fccfb712f5321c83f1df1ce878de5b418)
ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform TARGETS zstd PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665)
ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform TARGETS glad PACKAGE_HASH ff97ee9664e97d0854b52a3734c2289329d9f2b4cd69478df6d0ca1f1c9392ee)
@@ -28,4 +27,6 @@ ly_associate_package(PACKAGE_NAME googlebenchmark-1.5.0-rev2-android TARGETS Goo
ly_associate_package(PACKAGE_NAME libpng-1.6.37-mac TARGETS libpng PACKAGE_HASH 0000000000000000000000000000000000000000000000000000000000000000)
ly_associate_package(PACKAGE_NAME libsamplerate-0.2.1-rev2-android TARGETS libsamplerate PACKAGE_HASH bf13662afe65d02bcfa16258a4caa9b875534978227d6f9f36c9cfa92b3fb12b)
ly_associate_package(PACKAGE_NAME OpenSSL-1.1.1b-rev1-android TARGETS OpenSSL PACKAGE_HASH 4036d4019d722f0e1b7a1621bf60b5a17ca6a65c9c78fd8701cee1131eec8480)
ly_associate_package(PACKAGE_NAME zlib-1.2.11-rev1-android TARGETS zlib PACKAGE_HASH 832b163cae0cccbe4fddc5988f5725fac56ef7dba5bfe95bf8c71281fba2e12c)
ly_associate_package(PACKAGE_NAME zlib-1.2.11-rev2-android TARGETS zlib PACKAGE_HASH 85b730b97176772538cfcacd6b6aaf4655fc2d368d134d6dd55e02f28f183826)
ly_associate_package(PACKAGE_NAME lz4-1.9.3-vcpkg-rev4-android TARGETS lz4 PACKAGE_HASH f5b22642d218dbbb442cae61e469e5b241c4740acd258c3e8678e60dec61ea93)
+5 -6
View File
@@ -9,14 +9,12 @@
# shared by other platforms:
ly_associate_package(PACKAGE_NAME ilmbase-2.3.0-rev4-multiplatform TARGETS ilmbase PACKAGE_HASH 97547fdf1fbc4d81b8ccf382261f8c25514ed3b3c4f8fd493f0a4fa873bba348)
ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev11-multiplatform TARGETS assimplib PACKAGE_HASH 1a9113788b893ef4a2ee63ac01eb71b981a92894a5a51175703fa225f5804dec)
ly_associate_package(PACKAGE_NAME squish-ccr-20150601-rev3-multiplatform TARGETS squish-ccr PACKAGE_HASH c878c6c0c705e78403c397d03f5aa7bc87e5978298710e14d09c9daf951a83b3)
ly_associate_package(PACKAGE_NAME ASTCEncoder-2017_11_14-rev2-multiplatform TARGETS ASTCEncoder PACKAGE_HASH c240ffc12083ee39a5ce9dc241de44d116e513e1e3e4cc1d05305e7aa3bdc326)
ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5 PACKAGE_HASH 29e52ad22c78051551f78a40c2709594f0378762ae03b417adca3f4b700affdf)
ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-rev1-multiplatform TARGETS RapidJSON PACKAGE_HASH 2f5e26ecf86c3b7a262753e7da69ac59928e78e9534361f3d00c1ad5879e4023)
ly_associate_package(PACKAGE_NAME RapidXML-1.13-multiplatform TARGETS RapidXML PACKAGE_HASH 510b3c12f8872c54b34733e34f2f69dd21837feafa55bfefa445c98318d96ebf)
ly_associate_package(PACKAGE_NAME pybind11-2.4.3-rev2-multiplatform TARGETS pybind11 PACKAGE_HASH d8012f907b6c54ac990b899a0788280857e7c93a9595405a28114b48c354eb1b)
ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform TARGETS cityhash PACKAGE_HASH 0ace9e6f0b2438c5837510032d2d4109125845c0efd7d807f4561ec905512dd2)
ly_associate_package(PACKAGE_NAME lz4-r128-multiplatform TARGETS lz4 PACKAGE_HASH d7b1d5651191db2c339827ad24f669d9d37754143e9173abc986184532f57c9d)
ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform TARGETS expat PACKAGE_HASH 452256acd1fd699cef24162575b3524fccfb712f5321c83f1df1ce878de5b418)
ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform TARGETS zstd PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665)
ly_associate_package(PACKAGE_NAME SQLite-3.32.2-rev3-multiplatform TARGETS SQLite PACKAGE_HASH dd4d3de6cbb4ce3d15fc504ba0ae0587e515dc89a25228037035fc0aef4831f4)
@@ -29,7 +27,7 @@ ly_associate_package(PACKAGE_NAME PVRTexTool-4.24.0-rev4-multiplatform
ly_associate_package(PACKAGE_NAME AWSGameLiftServerSDK-3.4.1-rev1-linux TARGETS AWSGameLiftServerSDK PACKAGE_HASH a8149a95bd100384af6ade97e2b21a56173740d921e6c3da8188cd51554d39af)
ly_associate_package(PACKAGE_NAME freetype-2.10.4.14-linux TARGETS freetype PACKAGE_HASH 9ad246873067717962c6b780d28a5ce3cef3321b73c9aea746a039c798f52e93)
ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-linux TARGETS tiff PACKAGE_HASH ae92b4d3b189c42ef644abc5cac865d1fb2eb7cb5622ec17e35642b00d1a0a76)
ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev5-linux TARGETS AWSNativeSDK PACKAGE_HASH 0101a4052d9fce83a6f5515e00f366e97b308ecb8261ad23a6e4eb4365212ab6)
ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev6-linux TARGETS AWSNativeSDK PACKAGE_HASH 490291e4c8057975c3ab86feb971b8a38871c58bac5e5d86abdd1aeb7141eec4)
ly_associate_package(PACKAGE_NAME Lua-5.3.5-rev5-linux TARGETS Lua PACKAGE_HASH 1adc812abe3dd0dbb2ca9756f81d8f0e0ba45779ac85bf1d8455b25c531a38b0)
ly_associate_package(PACKAGE_NAME PhysX-4.1.2.29882248-rev3-linux TARGETS PhysX PACKAGE_HASH a110249cbef4f266b0002c4ee9a71f59f373040cefbe6b82f1e1510c811edde6)
ly_associate_package(PACKAGE_NAME etc2comp-9cd0f9cae0-rev1-linux TARGETS etc2comp PACKAGE_HASH 9283aa5db5bb7fb90a0ddb7a9f3895317c8ebe8044943124bbb3673a41407430)
@@ -45,6 +43,7 @@ ly_associate_package(PACKAGE_NAME OpenSSL-1.1.1b-rev2-linux
ly_associate_package(PACKAGE_NAME DirectXShaderCompilerDxc-1.6.2104-o3de-rev3-linux TARGETS DirectXShaderCompilerDxc PACKAGE_HASH 88c4a359325d749bc34090b9ac466424847f3b71ba0de15045cf355c17c07099)
ly_associate_package(PACKAGE_NAME SPIRVCross-2021.04.29-rev1-linux TARGETS SPIRVCross PACKAGE_HASH 7889ee5460a688e9b910c0168b31445c0079d363affa07b25d4c8aeb608a0b80)
ly_associate_package(PACKAGE_NAME azslc-1.7.23-rev2-linux TARGETS azslc PACKAGE_HASH 1ba84d8321a566d35a1e9aa7400211ba8e6d1c11c08e4be3c93e6e74b8f7aef1)
ly_associate_package(PACKAGE_NAME zlib-1.2.11-rev1-linux TARGETS zlib PACKAGE_HASH 6418e93b9f4e6188f3b62cbd3a7822e1c4398a716e786d1522b809a727d08ba9)
ly_associate_package(PACKAGE_NAME zlib-1.2.11-rev2-linux TARGETS zlib PACKAGE_HASH 16f3b9e11cda525efb62144f354c1cfc30a5def9eff020dbe49cb00ee7d8234f)
ly_associate_package(PACKAGE_NAME squish-ccr-deb557d-rev1-linux TARGETS squish-ccr PACKAGE_HASH 85fecafbddc6a41a27c5f59ed4a5dfb123a94cb4666782cf26e63c0a4724c530)
ly_associate_package(PACKAGE_NAME ISPCTexComp-36b80aa-rev1-linux TARGETS ISPCTexComp PACKAGE_HASH 065fd12abe4247dde247330313763cf816c3375c221da030bdec35024947f259)
ly_associate_package(PACKAGE_NAME lz4-1.9.3-vcpkg-rev4-linux TARGETS lz4 PACKAGE_HASH 5de3dbd3e2a3537c6555d759b3c5bb98e5456cf85c74ff6d046f809b7087290d)
-9
View File
@@ -1,9 +0,0 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
set(SQUISH-CCR_LIBS ${BASE_PATH}/lib/Linux/Release/libsquish-ccr.a)
+6 -4
View File
@@ -9,14 +9,12 @@
# shared by other platforms:
ly_associate_package(PACKAGE_NAME ilmbase-2.3.0-rev4-multiplatform TARGETS ilmbase PACKAGE_HASH 97547fdf1fbc4d81b8ccf382261f8c25514ed3b3c4f8fd493f0a4fa873bba348)
ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev11-multiplatform TARGETS assimplib PACKAGE_HASH 1a9113788b893ef4a2ee63ac01eb71b981a92894a5a51175703fa225f5804dec)
ly_associate_package(PACKAGE_NAME squish-ccr-20150601-rev3-multiplatform TARGETS squish-ccr PACKAGE_HASH c878c6c0c705e78403c397d03f5aa7bc87e5978298710e14d09c9daf951a83b3)
ly_associate_package(PACKAGE_NAME ASTCEncoder-2017_11_14-rev2-multiplatform TARGETS ASTCEncoder PACKAGE_HASH c240ffc12083ee39a5ce9dc241de44d116e513e1e3e4cc1d05305e7aa3bdc326)
ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5 PACKAGE_HASH 29e52ad22c78051551f78a40c2709594f0378762ae03b417adca3f4b700affdf)
ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-rev1-multiplatform TARGETS RapidJSON PACKAGE_HASH 2f5e26ecf86c3b7a262753e7da69ac59928e78e9534361f3d00c1ad5879e4023)
ly_associate_package(PACKAGE_NAME RapidXML-1.13-multiplatform TARGETS RapidXML PACKAGE_HASH 510b3c12f8872c54b34733e34f2f69dd21837feafa55bfefa445c98318d96ebf)
ly_associate_package(PACKAGE_NAME pybind11-2.4.3-rev2-multiplatform TARGETS pybind11 PACKAGE_HASH d8012f907b6c54ac990b899a0788280857e7c93a9595405a28114b48c354eb1b)
ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform TARGETS cityhash PACKAGE_HASH 0ace9e6f0b2438c5837510032d2d4109125845c0efd7d807f4561ec905512dd2)
ly_associate_package(PACKAGE_NAME lz4-r128-multiplatform TARGETS lz4 PACKAGE_HASH d7b1d5651191db2c339827ad24f669d9d37754143e9173abc986184532f57c9d)
ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform TARGETS expat PACKAGE_HASH 452256acd1fd699cef24162575b3524fccfb712f5321c83f1df1ce878de5b418)
ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform TARGETS zstd PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665)
ly_associate_package(PACKAGE_NAME SQLite-3.32.2-rev3-multiplatform TARGETS SQLite PACKAGE_HASH dd4d3de6cbb4ce3d15fc504ba0ae0587e515dc89a25228037035fc0aef4831f4)
@@ -31,7 +29,7 @@ ly_associate_package(PACKAGE_NAME DirectXShaderCompilerDxc-1.6.2104-o3de-rev3-ma
ly_associate_package(PACKAGE_NAME SPIRVCross-2021.04.29-rev1-mac TARGETS SPIRVCross PACKAGE_HASH 78c6376ed2fd195b9b1f5fb2b56e5267a32c3aa21fb399e905308de470eb4515)
ly_associate_package(PACKAGE_NAME freetype-2.10.4.14-mac-ios TARGETS freetype PACKAGE_HASH 67b4f57aed92082d3fd7c16aa244a7d908d90122c296b0a63f73e0a0b8761977)
ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-mac-ios TARGETS tiff PACKAGE_HASH a23ae1f8991a29f8e5df09d6d5b00d7768a740f90752cef465558c1768343709)
ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev4-mac TARGETS AWSNativeSDK PACKAGE_HASH 89e1651cde6b4e6bd80cdb96ed6b624accad9f9688ff38bfca226777f4fcb678)
ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev5-mac TARGETS AWSNativeSDK PACKAGE_HASH ffb890bd9cf23afb429b9214ad9bac1bf04696f07a0ebb93c42058c482ab2f01)
ly_associate_package(PACKAGE_NAME Lua-5.3.5-rev6-mac TARGETS Lua PACKAGE_HASH b9079fd35634774c9269028447562c6b712dbc83b9c64975c095fd423ff04c08)
ly_associate_package(PACKAGE_NAME PhysX-4.1.2.29882248-rev3-mac TARGETS PhysX PACKAGE_HASH 5e092a11d5c0a50c4dd99bb681a04b566a4f6f29aa08443d9bffc8dc12c27c8e)
ly_associate_package(PACKAGE_NAME etc2comp-9cd0f9cae0-rev1-mac TARGETS etc2comp PACKAGE_HASH 1966ab101c89db7ecf30984917e0a48c0d02ee0e4d65b798743842b9469c0818)
@@ -43,4 +41,8 @@ ly_associate_package(PACKAGE_NAME OpenSSL-1.1.1b-rev1-mac
ly_associate_package(PACKAGE_NAME qt-5.15.2-rev5-mac TARGETS Qt PACKAGE_HASH 9d25918351898b308ded3e9e571fff6f26311b2071aeafd00dd5b249fdf53f7e)
ly_associate_package(PACKAGE_NAME libpng-1.6.37-mac TARGETS libpng PACKAGE_HASH 0000000000000000000000000000000000000000000000000000000000000000)
ly_associate_package(PACKAGE_NAME libsamplerate-0.2.1-rev2-mac TARGETS libsamplerate PACKAGE_HASH b912af40c0ac197af9c43d85004395ba92a6a859a24b7eacd920fed5854a97fe)
ly_associate_package(PACKAGE_NAME zlib-1.2.11-rev1-mac TARGETS zlib PACKAGE_HASH 7fd8a77b3598423d9d6be5f8c60d52aecf346ab4224f563a5282db283aa0da02)
ly_associate_package(PACKAGE_NAME zlib-1.2.11-rev2-mac TARGETS zlib PACKAGE_HASH 21714e8a6de4f2523ee92a7f52d51fbee29c5f37ced334e00dc3c029115b472e)
ly_associate_package(PACKAGE_NAME squish-ccr-deb557d-rev1-mac TARGETS squish-ccr PACKAGE_HASH 155bfbfa17c19a9cd2ef025de14c5db598f4290045d5b0d83ab58cb345089a77)
ly_associate_package(PACKAGE_NAME ISPCTexComp-36b80aa-rev1-mac TARGETS ISPCTexComp PACKAGE_HASH 8a4e93277b8face6ea2fd57c6d017bdb55643ed3d6387110bc5f6b3b884dd169)
ly_associate_package(PACKAGE_NAME lz4-1.9.3-vcpkg-rev4-mac TARGETS lz4 PACKAGE_HASH 891ff630bf34f7ab1d8eaee2ea0a8f1fca89dbdc63fca41ee592703dd488a73b)
-9
View File
@@ -1,9 +0,0 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
set(SQUISH-CCR_LIBS ${BASE_PATH}/lib/Mac/Release/libsquish-ccr.a)
@@ -9,14 +9,12 @@
# shared by other platforms:
ly_associate_package(PACKAGE_NAME ilmbase-2.3.0-rev4-multiplatform TARGETS ilmbase PACKAGE_HASH 97547fdf1fbc4d81b8ccf382261f8c25514ed3b3c4f8fd493f0a4fa873bba348)
ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev11-multiplatform TARGETS assimplib PACKAGE_HASH 1a9113788b893ef4a2ee63ac01eb71b981a92894a5a51175703fa225f5804dec)
ly_associate_package(PACKAGE_NAME squish-ccr-20150601-rev3-multiplatform TARGETS squish-ccr PACKAGE_HASH c878c6c0c705e78403c397d03f5aa7bc87e5978298710e14d09c9daf951a83b3)
ly_associate_package(PACKAGE_NAME ASTCEncoder-2017_11_14-rev2-multiplatform TARGETS ASTCEncoder PACKAGE_HASH c240ffc12083ee39a5ce9dc241de44d116e513e1e3e4cc1d05305e7aa3bdc326)
ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5 PACKAGE_HASH 29e52ad22c78051551f78a40c2709594f0378762ae03b417adca3f4b700affdf)
ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-rev1-multiplatform TARGETS RapidJSON PACKAGE_HASH 2f5e26ecf86c3b7a262753e7da69ac59928e78e9534361f3d00c1ad5879e4023)
ly_associate_package(PACKAGE_NAME RapidXML-1.13-multiplatform TARGETS RapidXML PACKAGE_HASH 510b3c12f8872c54b34733e34f2f69dd21837feafa55bfefa445c98318d96ebf)
ly_associate_package(PACKAGE_NAME pybind11-2.4.3-rev2-multiplatform TARGETS pybind11 PACKAGE_HASH d8012f907b6c54ac990b899a0788280857e7c93a9595405a28114b48c354eb1b)
ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform TARGETS cityhash PACKAGE_HASH 0ace9e6f0b2438c5837510032d2d4109125845c0efd7d807f4561ec905512dd2)
ly_associate_package(PACKAGE_NAME lz4-r128-multiplatform TARGETS lz4 PACKAGE_HASH d7b1d5651191db2c339827ad24f669d9d37754143e9173abc986184532f57c9d)
ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform TARGETS expat PACKAGE_HASH 452256acd1fd699cef24162575b3524fccfb712f5321c83f1df1ce878de5b418)
ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform TARGETS zstd PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665)
ly_associate_package(PACKAGE_NAME SQLite-3.32.2-rev3-multiplatform TARGETS SQLite PACKAGE_HASH dd4d3de6cbb4ce3d15fc504ba0ae0587e515dc89a25228037035fc0aef4831f4)
@@ -28,12 +26,11 @@ ly_associate_package(PACKAGE_NAME PVRTexTool-4.24.0-rev4-multiplatform
# platform-specific:
ly_associate_package(PACKAGE_NAME AWSGameLiftServerSDK-3.4.1-rev1-windows TARGETS AWSGameLiftServerSDK PACKAGE_HASH a0586b006e4def65cc25f388de17dc475e417dc1e6f9d96749777c88aa8271b0)
ly_associate_package(PACKAGE_NAME Blast-v1.1.7_rc2-9-geb169fe-rev1-windows TARGETS Blast PACKAGE_HASH 216df71f4ffaf4a6ea3f2e77e5f27d68f2325e717fbd1626b00c785b82cd1b67)
ly_associate_package(PACKAGE_NAME DirectXShaderCompilerDxc-1.6.2104-o3de-rev3-windows TARGETS DirectXShaderCompilerDxc PACKAGE_HASH 803e10b94006b834cbbdd30f562a8ddf04174c2cb6956c8399ec164ef8418d1f)
ly_associate_package(PACKAGE_NAME SPIRVCross-2021.04.29-rev1-windows TARGETS SPIRVCross PACKAGE_HASH 7d601ea9d625b1d509d38bd132a1f433d7e895b16adab76bac6103567a7a6817)
ly_associate_package(PACKAGE_NAME freetype-2.10.4.14-windows TARGETS freetype PACKAGE_HASH 88dedc86ccb8c92f14c2c033e51ee7d828fa08eafd6475c6aa963938a99f4bf3)
ly_associate_package(PACKAGE_NAME tiff-4.2.0.14-windows TARGETS tiff PACKAGE_HASH ab60d1398e4e1e375ec0f1a00cdb1d812a07c0096d827db575ce52dd6d714207)
ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev3-windows TARGETS AWSNativeSDK PACKAGE_HASH 929873d4252c464620a9d288e41bd5d47c0bd22750aeb3a1caa68a3da8247c48)
ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev4-windows TARGETS AWSNativeSDK PACKAGE_HASH a900e80f7259e43aed5c847afee2599ada37f29db70505481397675bcbb6c76c)
ly_associate_package(PACKAGE_NAME Lua-5.3.5-rev5-windows TARGETS Lua PACKAGE_HASH 136faccf1f73891e3fa3b95f908523187792e56f5b92c63c6a6d7e72d1158d40)
ly_associate_package(PACKAGE_NAME PhysX-4.1.2.29882248-rev3-windows TARGETS PhysX PACKAGE_HASH 0c5ffbd9fa588e5cf7643721a7cfe74d0fe448bf82252d39b3a96d06dfca2298)
ly_associate_package(PACKAGE_NAME etc2comp-9cd0f9cae0-rev1-windows TARGETS etc2comp PACKAGE_HASH fc9ae937b2ec0d42d5e7d0e9e8c80e5e4d257673fb33bc9b7d6db76002117123)
@@ -51,4 +48,7 @@ ly_associate_package(PACKAGE_NAME OpenMesh-8.1-rev1-windows
ly_associate_package(PACKAGE_NAME civetweb-1.8-rev1-windows TARGETS civetweb PACKAGE_HASH 36d0e58a59bcdb4dd70493fb1b177aa0354c945b06c30416348fd326cf323dd4)
ly_associate_package(PACKAGE_NAME OpenSSL-1.1.1b-rev2-windows TARGETS OpenSSL PACKAGE_HASH 9af1c50343f89146b4053101a7aeb20513319a3fe2f007e356d7ce25f9241040)
ly_associate_package(PACKAGE_NAME Crashpad-0.8.0-rev1-windows TARGETS Crashpad PACKAGE_HASH d162aa3070147bc0130a44caab02c5fe58606910252caf7f90472bd48d4e31e2)
ly_associate_package(PACKAGE_NAME zlib-1.2.11-rev1-windows TARGETS zlib PACKAGE_HASH 6fb46a0ef8c8614cde3517b50fca47f2a6d1fd059b21f3b8ff13e635ca7f2fa6)
ly_associate_package(PACKAGE_NAME zlib-1.2.11-rev2-windows TARGETS zlib PACKAGE_HASH 9afab1d67641ed8bef2fb38fc53942da47f2ab339d9e77d3d20704a48af2da0b)
ly_associate_package(PACKAGE_NAME squish-ccr-deb557d-rev1-windows TARGETS squish-ccr PACKAGE_HASH 5c3d9fa491e488ccaf802304ad23b932268a2b2846e383f088779962af2bfa84)
ly_associate_package(PACKAGE_NAME ISPCTexComp-36b80aa-rev1-windows TARGETS ISPCTexComp PACKAGE_HASH b6fa6ea28a2808a9a5524c72c37789c525925e435770f2d94eb2d387360fa2d0)
ly_associate_package(PACKAGE_NAME lz4-1.9.3-vcpkg-rev4-windows TARGETS lz4 PACKAGE_HASH 4ea457b833cd8cfaf8e8e06ed6df601d3e6783b606bdbc44a677f77e19e0db16)
@@ -1,9 +0,0 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
set(SQUISH-CCR_LIBS ${BASE_PATH}/lib/Windows/Release/squish-ccr.lib)
+2 -2
View File
@@ -11,7 +11,6 @@ ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5
ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-rev1-multiplatform TARGETS RapidJSON PACKAGE_HASH 2f5e26ecf86c3b7a262753e7da69ac59928e78e9534361f3d00c1ad5879e4023)
ly_associate_package(PACKAGE_NAME RapidXML-1.13-multiplatform TARGETS RapidXML PACKAGE_HASH 510b3c12f8872c54b34733e34f2f69dd21837feafa55bfefa445c98318d96ebf)
ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform TARGETS cityhash PACKAGE_HASH 0ace9e6f0b2438c5837510032d2d4109125845c0efd7d807f4561ec905512dd2)
ly_associate_package(PACKAGE_NAME lz4-r128-multiplatform TARGETS lz4 PACKAGE_HASH d7b1d5651191db2c339827ad24f669d9d37754143e9173abc986184532f57c9d)
ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform TARGETS expat PACKAGE_HASH 452256acd1fd699cef24162575b3524fccfb712f5321c83f1df1ce878de5b418)
ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform TARGETS zstd PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665)
ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform TARGETS glad PACKAGE_HASH ff97ee9664e97d0854b52a3734c2289329d9f2b4cd69478df6d0ca1f1c9392ee)
@@ -29,4 +28,5 @@ ly_associate_package(PACKAGE_NAME googlebenchmark-1.5.0-rev2-ios TARGETS GoogleB
ly_associate_package(PACKAGE_NAME libpng-1.6.37-mac TARGETS libpng PACKAGE_HASH 0000000000000000000000000000000000000000000000000000000000000000)
ly_associate_package(PACKAGE_NAME libsamplerate-0.2.1-rev2-ios TARGETS libsamplerate PACKAGE_HASH 7656b961697f490d4f9c35d2e61559f6fc38c32102e542a33c212cd618fc2119)
ly_associate_package(PACKAGE_NAME OpenSSL-1.1.1b-rev1-ios TARGETS OpenSSL PACKAGE_HASH cd0dfce3086a7172777c63dadbaf0ac3695b676119ecb6d0614b5fb1da03462f)
ly_associate_package(PACKAGE_NAME zlib-1.2.11-rev1-ios TARGETS zlib PACKAGE_HASH 20bfccf3b98bd9a7d3506cf344ac48135035eb517752bf9bede1e821f163608d)
ly_associate_package(PACKAGE_NAME zlib-1.2.11-rev2-ios TARGETS zlib PACKAGE_HASH a59fc0f83a02c616b679799310e9d86fde84514c6d2acefa12c6def0ae4a880c)
ly_associate_package(PACKAGE_NAME lz4-1.9.3-vcpkg-rev4-ios TARGETS lz4 PACKAGE_HASH 588ea05739caa9231a9a17a1e8cf64c5b9a265e16528bc05420af7e2534e86c1)
+3 -1
View File
@@ -35,7 +35,9 @@ function(ly_add_dependencies TARGET)
if(TARGET ${TARGET})
# Target already created, add it
ly_parse_third_party_dependencies("${extra_function_args}")
add_dependencies(${TARGET} ${extra_function_args})
# Dependencies can only be added on non-alias target
ly_de_alias_target(${TARGET} de_aliased_target)
add_dependencies(${de_aliased_target} ${extra_function_args})
else()
set_property(GLOBAL APPEND PROPERTY LY_DELAYED_DEPENDENCIES_${TARGET} ${extra_function_args})
endif()
+11 -7
View File
@@ -17,23 +17,27 @@ endfunction()
o3de_current_file_path(current_path)
# Make sure we are matching LY_ENGINE_NAME_TO_USE with the current engine
file(READ ${current_path}/../engine.json engine_json)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${current_path}/../engine.json)
# Make sure the cmake configure dependency added here is a normalized path to engine.json,
# because later it's read again using a path like ${LY_ROOT_FOLDER}/engine.json, which
# is also normalized. They should match to avoid errors on some build systems.
cmake_path(SET engine_json_path NORMALIZE ${current_path}/../engine.json)
file(READ ${engine_json_path} engine_json)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${engine_json_path})
string(JSON this_engine_name ERROR_VARIABLE json_error GET ${engine_json} engine_name)
if(json_error)
message(FATAL_ERROR "Unable to read key 'engine_name' from '${current_path}/../engine.json', error: ${json_error}")
message(FATAL_ERROR "Unable to read key 'engine_name' from '${engine_json_path}', error: ${json_error}")
endif()
# Make sure we are matching LY_ENGINE_NAME_TO_USE with the current engine
set(found_matching_engine FALSE)
if(this_engine_name STREQUAL LY_ENGINE_NAME_TO_USE)
set(found_matching_engine TRUE)
endif()
find_package_handle_standard_args(o3de
"Could not find an engine with matching ${LY_ENGINE_NAME_TO_USE}"
found_matching_engine
"Could not find an engine with matching ${LY_ENGINE_NAME_TO_USE}"
found_matching_engine
)
macro(o3de_initialize)
@@ -41,4 +45,4 @@ macro(o3de_initialize)
set(LY_PROJECTS ${CMAKE_CURRENT_LIST_DIR})
o3de_current_file_path(current_path)
add_subdirectory(${current_path}/.. o3de)
endmacro()
endmacro()
+196 -124
View File
@@ -6,7 +6,13 @@
#
#
# This file contains utility wrappers for dealing with the Gems system.
# This file contains utility wrappers for dealing with the Gems system.
define_property(TARGET PROPERTY LY_PROJECT_NAME
BRIEF_DOCS "Name of the project, this target can use enabled gems from"
FULL_DOCS "If set, the when iterating over the enabled gems in ly_enabled_gems_delayed
only a project with that name can have it's enabled gem list added as a dependency to this target.
If the __NOPROJECT__ placeholder is associated with a list enabled gems, then it applies to this target regardless of this property value")
# ly_create_alias
# given an alias to create, and a list of one or more targets,
@@ -34,7 +40,8 @@ function(ly_create_alias)
# easy version - if its just one target and it exist at the time of this call,
# we can directly get the target, and make both aliases,
# the namespaced and non namespaced one, point at it.
# the namespace and non namespace one, point at it.
set(create_interface_target TRUE)
list(LENGTH ly_create_alias_TARGETS number_of_targets)
if (number_of_targets EQUAL 1)
if(TARGET ${ly_create_alias_TARGETS})
@@ -43,11 +50,7 @@ function(ly_create_alias)
if (NOT TARGET ${ly_create_alias_NAME})
add_library(${ly_create_alias_NAME} ALIAS ${de_aliased_target_name})
endif()
# Store off the arguments needed used ly_create_alias into a DIRECTORY property
# This will be used to re-create the calls in the generated CMakeLists.txt in the INSTALL step
string(REPLACE ";" " " create_alias_args "${ly_create_alias_NAME},${ly_create_alias_NAMESPACE},${ly_create_alias_TARGETS}")
set_property(DIRECTORY APPEND PROPERTY LY_CREATE_ALIAS_ARGUMENTS "${ly_create_alias_NAME},${ly_create_alias_NAMESPACE},${ly_create_alias_TARGETS}")
return()
set(create_interface_target FALSE)
endif()
endif()
@@ -55,41 +58,48 @@ function(ly_create_alias)
# To actually achieve this we have to create an interface library with those dependencies,
# then we have to create an alias to that target.
# By convention we create one without a namespace then alias the namespaced one.
if(TARGET ${ly_create_alias_NAME})
message(FATAL_ERROR "Internal alias target already exists, cannot create an alias for it: ${ly_create_alias_NAME}\n"
"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 GLOBAL)
set_target_properties(${ly_create_alias_NAME} PROPERTIES GEM_MODULE TRUE)
foreach(target_name ${ly_create_alias_TARGETS})
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})
if(create_interface_target)
if(TARGET ${ly_create_alias_NAME})
message(FATAL_ERROR "Internal alias target already exists, cannot create an alias for it: ${ly_create_alias_NAME}\n"
"This could be a copy-paste error, where some part of the ly_create_alias call was changed but the other")
endif()
list(APPEND final_targets ${de_aliased_target_name})
endforeach()
# add_dependencies must be called with at least one dependent target
if(final_targets)
ly_parse_third_party_dependencies("${final_targets}")
ly_add_dependencies(${ly_create_alias_NAME} ${final_targets})
endif()
# now add the final alias:
add_library(${ly_create_alias_NAMESPACE}::${ly_create_alias_NAME} ALIAS ${ly_create_alias_NAME})
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})
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()
# add_dependencies must be called with at least one dependent target
if(final_targets)
ly_parse_third_party_dependencies("${final_targets}")
ly_add_dependencies(${ly_create_alias_NAME} ${final_targets})
endif()
# now add the final alias:
add_library(${ly_create_alias_NAMESPACE}::${ly_create_alias_NAME} ALIAS ${ly_create_alias_NAME})
endif()
# Store off the arguments used by ly_create_alias into a DIRECTORY property
# This will be used to re-create the calls in the generated CMakeLists.txt in the INSTALL step
# Replace the CMake list separator with a space to replicate the space separated TARGETS arguments
string(REPLACE ";" " " create_alias_args "${ly_create_alias_NAME},${ly_create_alias_NAMESPACE},${ly_create_alias_TARGETS}")
# Replace the CMake list separator with a space to replicate the space separated arguments
# A single create_alias_args variable encodes two values. The alias NAME used to check if the target exists
# and the ly_create_alias arguments to replace this function call
unset(create_alias_args)
list(APPEND create_alias_args "${ly_create_alias_NAME},"
NAME ${ly_create_alias_NAME}
NAMESPACE ${ly_create_alias_NAMESPACE}
TARGETS ${ly_create_alias_TARGETS})
list(JOIN create_alias_args " " create_alias_args)
set_property(DIRECTORY APPEND PROPERTY LY_CREATE_ALIAS_ARGUMENTS "${create_alias_args}")
# Store the directory path in the GLOBAL property so that it can be accessed
@@ -100,13 +110,54 @@ function(ly_create_alias)
endif()
endfunction()
# ly_set_gem_variant_to_load
# Associates a key, value entry of CMake target -> Gem variant
# \arg:TARGETS - list of Targets to associate with the Gem variant
# \arg:VARIANTS - Gem variant
function(ly_set_gem_variant_to_load)
set(options)
set(oneValueArgs)
set(multiValueArgs TARGETS VARIANTS)
cmake_parse_arguments(ly_set_gem_variant_to_load "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if (NOT ly_set_gem_variant_to_load_TARGETS)
message(FATAL_ERROR "You must provide at least 1 target to ${CMAKE_CURRENT_FUNCTION} using the TARGETS keyword")
endif()
# Store a list of targets
foreach(target_name ${ly_set_gem_variant_to_load_TARGETS})
# Append the target to the list of targets with variants if it has not been added
get_property(ly_targets_with_variants GLOBAL PROPERTY LY_TARGETS_WITH_GEM_VARIANTS)
if(NOT target_name IN_LIST ly_targets_with_variants)
set_property(GLOBAL APPEND PROPERTY LY_TARGETS_WITH_GEM_VARIANTS "${target_name}")
endif()
foreach(variant_name ${ly_set_gem_variant_to_load_VARIANTS})
get_property(target_gem_variants GLOBAL PROPERTY LY_GEM_VARIANTS_"${target_name}")
if(NOT variant_name IN_LIST target_gem_variants)
set_property(GLOBAL APPEND PROPERTY LY_GEM_VARIANTS_"${target_name}" "${variant_name}")
endif()
endforeach()
endforeach()
# Store of the arguments used to invoke this function in order to replicate the call in the generated CMakeLists.txt
# in the install layout
unset(set_gem_variant_args)
list(APPEND set_gem_variant_args
TARGETS ${ly_set_gem_variant_to_load_TARGETS}
VARIANTS ${ly_set_gem_variant_to_load_VARIANTS})
# Replace the list separator with space to have it be stored as a single property element
list(JOIN set_gem_variant_args " " set_gem_variant_args)
set_property(DIRECTORY APPEND PROPERTY LY_SET_GEM_VARIANT_TO_LOAD_ARGUMENTS "${set_gem_variant_args}")
endfunction()
# ly_enable_gems
# this function makes sure that the given gems, or gems listed in the variable ENABLED_GEMS
# in the GEM_FILE name, are set as runtime dependencies (and thus loaded) for the given targets
# in the context of the given project.
# note that it can't do this immediately, so it saves the data for later processing.
# Note: If you don't supply a project name, it will apply it across the board to all projects.
# this is useful in the case of "ly_add_gems being called for so called 'mandatory gems' inside the engine.
# this is useful in the case of "ly_enable_gems" being called for so called 'mandatory gems' inside the engine.
# if you specify a gem name with a namespace, it will be used, otherwise it will assume Gem::
function(ly_enable_gems)
set(options)
@@ -115,23 +166,21 @@ function(ly_enable_gems)
cmake_parse_arguments(ly_enable_gems "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if (NOT ly_enable_gems_TARGETS)
message(FATAL_ERROR "You must provide the targets to add gems to using the TARGETS keyword")
endif()
if (NOT ly_enable_gems_PROJECT_NAME)
message(VERBOSE "Note: ly_enable_gems called with no PROJECT_NAME name, applying to all projects: \n"
" - VARIANTS ${ly_enable_gems_VARIANTS} \n"
" - GEMS ${ly_enable_gems_GEMS} \n"
" - TARGETS ${ly_enable_gems_TARGETS} \n"
" - GEMS ${ly_enable_gems_GEMS} \n"
" - GEM_FILE ${ly_enable_gems_GEM_FILE}")
set(ly_enable_gems_PROJECT_NAME "__NOPROJECT__") # so that the token is not blank
endif()
if (NOT ly_enable_gems_VARIANTS)
message(FATAL_ERROR "You must provide at least 1 variant of the gem modules (Editor, Server, Client, Builder) to "
"add to your targets, using the VARIANTS keyword")
# Backwards-Compatibility - Delegate any TARGETS and VARIANTS arguments to the ly_set_gem_variant_to_load
# command. That command is used to associate TARGETS with the list of Gem Variants they desire to use
if (ly_enable_gems_TARGETS AND ly_enable_gems_VARIANTS)
message(DEPRECATION "The TARGETS and VARIANTS arguments to \"${CMAKE_CURRENT_FUNCTION}\" is deprecated.\n"
"Please use the \"ly_set_gem_variant_to_load\" function directly to associate a Target with a Gem Variant.\n"
"This function will forward the TARGETS and VARIANTS arguments to \"ly_set_gem_variant_to_load\" for now,"
" but this functionality will be removed.")
ly_set_gem_variant_to_load(TARGETS ${ly_enable_gems_TARGETS} VARIANTS ${ly_enable_gems_VARIANTS})
endif()
if ((NOT ly_enable_gems_GEMS AND NOT ly_enable_gems_GEM_FILE) OR (ly_enable_gems_GEMS AND ly_enable_gems_GEM_FILE))
@@ -153,103 +202,126 @@ function(ly_enable_gems)
endif()
# all the actual work has to be done later.
foreach(target_name ${ly_enable_gems_TARGETS})
foreach(variant_name ${ly_enable_gems_VARIANTS})
set_property(GLOBAL APPEND PROPERTY LY_DELAYED_ENABLE_GEMS "${ly_enable_gems_PROJECT_NAME},${target_name},${variant_name}")
define_property(GLOBAL PROPERTY LY_DELAYED_ENABLE_GEMS_"${ly_enable_gems_PROJECT_NAME},${target_name},${variant_name}"
BRIEF_DOCS "List of gem names to evaluate variants against" FULL_DOCS "Names of gems that will be paired with the variant name
to determine if it is valid target that should be added as an application dynamic load dependency")
set_property(GLOBAL APPEND PROPERTY LY_DELAYED_ENABLE_GEMS_"${ly_enable_gems_PROJECT_NAME},${target_name},${variant_name}" ${ly_enable_gems_GEMS})
endforeach()
endforeach()
set_property(GLOBAL APPEND PROPERTY LY_DELAYED_ENABLE_GEMS "${ly_enable_gems_PROJECT_NAME}")
define_property(GLOBAL PROPERTY LY_DELAYED_ENABLE_GEMS_"${ly_enable_gems_PROJECT_NAME}"
BRIEF_DOCS "List of gem names to evaluate variants against" FULL_DOCS "Names of gems that will be paired with the variant name
to determine if it is valid target that should be added as an application dynamic load dependency")
set_property(GLOBAL APPEND PROPERTY LY_DELAYED_ENABLE_GEMS_"${ly_enable_gems_PROJECT_NAME}" ${ly_enable_gems_GEMS})
# Store off the arguments used by ly_enable_gems into a DIRECTORY property
# This will be used to re-create the ly_enable_gems call in the generated CMakeLists.txt at the INSTALL step
# Replace the CMake list separator with a space to replicate the space separated TARGETS arguments
if(NOT ly_enable_gems_PROJECT_NAME STREQUAL "__NOPROJECT__")
set(replicated_project_name ${ly_enable_gems_PROJECT_NAME})
set(replicated_project_name PROJECT_NAME ${ly_enable_gems_PROJECT_NAME})
endif()
# The GEM_FILE file is used to populate the GEMS argument via the ENABLED_GEMS variable in the file.
# Furthermore the GEM_FILE itself is not copied over to the install layout, so make its argument entry blank and use the list of GEMS
# stored in ly_enable_gems_GEMS
string(REPLACE ";" " " enable_gems_args "${replicated_project_name},${ly_enable_gems_GEMS},,${ly_enable_gems_VARIANTS},${ly_enable_gems_TARGETS}")
unset(enable_gems_args)
list(APPEND enable_gems_args
${replicated_project_name}
GEMS ${ly_enable_gems_GEMS})
list(JOIN enable_gems_args " " enable_gems_args)
set_property(DIRECTORY APPEND PROPERTY LY_ENABLE_GEMS_ARGUMENTS "${enable_gems_args}")
endfunction()
function(ly_add_gem_dependencies_to_project_variants)
set(options)
set(oneValueArgs PROJECT_NAME TARGET VARIANT)
set(multiValueArgs GEM_DEPENDENCIES)
cmake_parse_arguments(ly_add_gem_dependencies "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if (NOT ly_add_gem_dependencies_PROJECT_NAME)
message(FATAL_ERROR "Missing required PROJECT_NAME argument which is used to determine gem load prefix")
endif()
if (NOT ly_add_gem_dependencies_TARGET)
message(FATAL_ERROR "Missing required TARGET argument ")
endif()
if (NOT ly_add_gem_dependencies_VARIANT)
message(FATAL_ERROR "Missing required gem VARIANT argument needed to determine which gem variants to load for the target")
endif()
if(${ly_add_gem_dependencies_PROJECT_NAME} STREQUAL "__NOPROJECT__")
# special case, apply to all
unset(PREFIX_CLAUSE)
else()
set(PREFIX_CLAUSE "PREFIX;${ly_add_gem_dependencies_PROJECT_NAME}")
endif()
# apply the list of gem targets. Adding a gem really just means adding the appropriate dependency.
foreach(gem_name ${ly_add_gem_dependencies_GEM_DEPENDENCIES})
set(gem_target ${gem_name}.${ly_add_gem_dependencies_VARIANT})
# if the target exists, add it.
if (TARGET ${gem_target})
# Dealias actual target
ly_de_alias_target(${gem_target} dealiased_gem_target)
ly_add_target_dependencies(
${PREFIX_CLAUSE}
TARGETS ${ly_add_gem_dependencies_TARGET}
DEPENDENT_TARGETS ${dealiased_gem_target})
endif()
endforeach()
endfunction()
# call this before runtime dependencies are used to add any relevant targets
# saved by the above function
function(ly_enable_gems_delayed)
get_property(ly_delayed_enable_gems GLOBAL PROPERTY LY_DELAYED_ENABLE_GEMS)
foreach(project_target_variant ${ly_delayed_enable_gems})
# we expect a colon separated list of
# PROJECT_NAME,target_name,variant_name
string(REPLACE "," ";" project_target_variant_list "${project_target_variant}")
list(LENGTH project_target_variant_list project_target_variant_length)
if(project_target_variant_length EQUAL 0)
continue()
endif()
if(NOT project_target_variant_length EQUAL 3)
message(FATAL_ERROR "Invalid specification of gems, expected 'project','target','variant' and got ${project_target_variant}")
endif()
list(POP_BACK project_target_variant_list variant)
list(POP_BACK project_target_variant_list target)
list(POP_BACK project_target_variant_list project)
get_property(gem_dependencies GLOBAL PROPERTY LY_DELAYED_ENABLE_GEMS_"${project_target_variant}")
if (NOT gem_dependencies)
get_property(gem_dependencies_defined GLOBAL PROPERTY LY_DELAYED_ENABLE_GEMS_"${project_target_variant}" DEFINED)
if (gem_dependencies_defined)
# special case, if the LY_DELAYED_ENABLE_GEMS_"${project_target_variant}" property is DEFINED
# but empty, add an entry to the LY_DELAYED_LOAD_DEPENDENCIES to have the
# cmake_dependencies.*.setreg file for the (project, target) tuple to be regenerated
# This is needed if the ENABLED_GEMS list for a project goes from >0 to 0. In this case
# the cmake_dependencies would have a stale list of gems to load unless it is regenerated
get_property(delayed_load_target_set GLOBAL PROPERTY LY_DELAYED_LOAD_"${project},${target}" SET)
if(NOT delayed_load_target_set)
set_property(GLOBAL APPEND PROPERTY LY_DELAYED_LOAD_DEPENDENCIES "${project},${target}")
set_property(GLOBAL APPEND PROPERTY LY_DELAYED_LOAD_"${project},${target}" "")
endif()
endif()
# Continue to the next iteration loop regardless as there are no gem dependencies
continue()
endif()
if(${project} STREQUAL "__NOPROJECT__")
# special case, apply to all
unset(PREFIX_CLAUSE)
else()
set(PREFIX_CLAUSE "PREFIX;${project}")
endif()
# Query the list of targets that are associated with a gem variant
get_property(targets_with_variants GLOBAL PROPERTY LY_TARGETS_WITH_GEM_VARIANTS)
# Query the projects that have made calls to ly_enable_gems
get_property(enable_gem_projects GLOBAL PROPERTY LY_DELAYED_ENABLE_GEMS)
foreach(target ${targets_with_variants})
if (NOT TARGET ${target})
message(FATAL_ERROR "ly_enable_gems specified TARGET '${target}' but no such target was found.")
message(FATAL_ERROR "ly_set_gem_variant_to_load specified TARGET '${target}' but no such target was found.")
endif()
# apply the list of gem targets. Adding a gem really just means adding the appropriate dependency.
foreach(gem_name ${gem_dependencies})
# the gem name may already have a namespace. If it does, we use that one
ly_strip_target_namespace(TARGET ${gem_name} OUTPUT_VARIABLE unaliased_gem_name)
if (${unaliased_gem_name} STREQUAL ${gem_name})
# if stripping a namespace had no effect, it had no namespace
# and we supply the default Gem:: namespace.
set(gem_name_with_namespace Gem::${gem_name})
else()
# if stripping the namespace had an effect then we use the original
# with the namespace, instead of assuming Gem::
set(gem_name_with_namespace ${gem_name})
# Lookup if the target is scoped to a project
# In that case the target can only use gem targets that is
# - not project specific: i.e "__NOPROJECT__"
# - or specific to the <LY_PROJECT_NAME> project
get_property(target_project_association TARGET ${target} PROPERTY LY_PROJECT_NAME)
foreach(project ${enable_gem_projects})
if (target_project_association AND
(NOT (project STREQUAL "__NOPROJECT__") AND NOT (project STREQUAL target_project_association)))
# Skip adding the gem dependencies to this target if it is associated with a project
# and the current project doesn't match
continue()
endif()
# if the target exists, add it.
if (TARGET ${gem_name_with_namespace}.${variant})
ly_add_target_dependencies(
${PREFIX_CLAUSE}
TARGETS ${target}
DEPENDENT_TARGETS ${gem_name_with_namespace}.${variant}
)
get_property(gem_dependencies GLOBAL PROPERTY LY_DELAYED_ENABLE_GEMS_"${project}")
if (NOT gem_dependencies)
get_property(gem_dependencies_defined GLOBAL PROPERTY LY_DELAYED_ENABLE_GEMS_"${project}" DEFINED)
if (gem_dependencies_defined)
# special case, if the LY_DELAYED_ENABLE_GEMS_"${project_target_variant}" property is DEFINED
# but empty, add an entry to the LY_DELAYED_LOAD_DEPENDENCIES to have the
# cmake_dependencies.*.setreg file for the (project, target) tuple to be regenerated
# This is needed if the ENABLED_GEMS list for a project goes from >0 to 0. In this case
# the cmake_dependencies would have a stale list of gems to load unless it is regenerated
get_property(delayed_load_target_set GLOBAL PROPERTY LY_DELAYED_LOAD_"${project},${target}" SET)
if(NOT delayed_load_target_set)
set_property(GLOBAL APPEND PROPERTY LY_DELAYED_LOAD_DEPENDENCIES "${project},${target}")
set_property(GLOBAL APPEND PROPERTY LY_DELAYED_LOAD_"${project},${target}" "")
endif()
endif()
# Continue to the next iteration loop regardless as there are no gem dependencies
continue()
endif()
# Gather the Gem variants associated with this target and iterate over them to combine them with the enabled
# gems for the each project
get_property(target_gem_variants GLOBAL PROPERTY LY_GEM_VARIANTS_"${target}")
foreach(variant ${target_gem_variants})
ly_add_gem_dependencies_to_project_variants(
PROJECT_NAME ${project}
TARGET ${target}
VARIANT ${variant}
GEM_DEPENDENCIES ${gem_dependencies})
endforeach()
endforeach()
endforeach()
endfunction()
+144 -2
View File
@@ -6,7 +6,149 @@
#
#
if(NOT INSTALLED_ENGINE)
ly_set(LY_INSTALL_ENABLED TRUE)
if(INSTALLED_ENGINE)
ly_set(LY_INSTALL_ENABLED FALSE)
endif()
if(LY_INSTALL_ENABLED)
ly_get_absolute_pal_filename(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME})
include(${pal_dir}/Install_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
endif()
endif()
#! ly_install_directory: specifies a directory to be copied to the install layout at install time
#
# \arg:DIRECTORIES directories to install
# \arg:DESTINATION (optional) destination to install the directory to (relative to CMAKE_PREFIX_PATH)
# \arg:EXCLUDE_PATTERNS (optional) patterns to exclude
# \arg:VERBATIM (optional) copies the directories as they are, this excludes the default exclude patterns
#
# \notes:
# - refer to cmake's install(DIRECTORY documentation for more information
# - If the directory contains programs/scripts, exclude them from this call and add a specific ly_install_files with
# PROGRAMS set. This is necessary to set the proper execution permissions.
# - This function will automatically filter out __pycache__, *.egg-info, CMakeLists.txt, *.cmake files. If those files
# need to be installed, use ly_install_files. Use VERBATIM to exclude such filters.
#
function(ly_install_directory)
if(NOT LY_INSTALL_ENABLED)
return()
endif()
set(options VERBATIM)
set(oneValueArgs DESTINATION)
set(multiValueArgs DIRECTORIES EXCLUDE_PATTERNS)
cmake_parse_arguments(ly_install_directory "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT ly_install_directory_DIRECTORIES)
message(FATAL_ERROR "You must provide at least a directory to install")
endif()
foreach(directory ${ly_install_directory_DIRECTORIES})
cmake_path(ABSOLUTE_PATH directory)
if(NOT ly_install_directory_DESTINATION)
# maintain the same structure relative to LY_ROOT_FOLDER
set(ly_install_directory_DESTINATION ${directory})
if(${ly_install_directory_DESTINATION} STREQUAL ".")
set(ly_install_directory_DESTINATION ${CMAKE_CURRENT_LIST_DIR})
else()
cmake_path(ABSOLUTE_PATH ly_install_directory_DESTINATION BASE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
endif()
# take out the last directory since install asks for the destination of the folder, without including the fodler itself
cmake_path(GET ly_install_directory_DESTINATION PARENT_PATH ly_install_directory_DESTINATION)
cmake_path(RELATIVE_PATH ly_install_directory_DESTINATION BASE_DIRECTORY ${LY_ROOT_FOLDER})
endif()
unset(exclude_patterns)
if(ly_install_directory_EXCLUDE_PATTERNS)
foreach(exclude_pattern ${ly_install_directory_EXCLUDE_PATTERNS})
list(APPEND exclude_patterns PATTERN ${exclude_pattern} EXCLUDE)
endforeach()
endif()
if(NOT ly_install_directory_VERBATIM)
# Exclude cmake since that has to be generated
list(APPEND exclude_patterns PATTERN CMakeLists.txt EXCLUDE)
list(APPEND exclude_patterns PATTERN *.cmake EXCLUDE)
# Exclude python-related things that dont need to be installed
list(APPEND exclude_patterns PATTERN __pycache__ EXCLUDE)
list(APPEND exclude_patterns PATTERN *.egg-info EXCLUDE)
endif()
install(DIRECTORY ${directory}
DESTINATION ${ly_install_directory_DESTINATION}
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME} # use the deafult for the time being
${exclude_patterns}
)
endforeach()
endfunction()
#! ly_install_files: specifies files to be copied to the install layout at install time
#
# \arg:FILES files to install
# \arg:DESTINATION destination to install the directory to (relative to CMAKE_PREFIX_PATH)
# \arg:PROGRAMS (optional) indicates if the files are programs that should be installed with EXECUTE permissions
#
# \notes:
# - refer to cmake's install(FILES/PROGRAMS documentation for more information
#
function(ly_install_files)
if(NOT LY_INSTALL_ENABLED)
return()
endif()
set(options PROGRAMS)
set(oneValueArgs DESTINATION)
set(multiValueArgs FILES)
cmake_parse_arguments(ly_install_files "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT ly_install_files_FILES)
message(FATAL_ERROR "You must provide a list of files to install")
endif()
if(NOT ly_install_files_DESTINATION)
message(FATAL_ERROR "You must provide a destination to install files to")
endif()
unset(files)
foreach(file ${ly_install_files_FILES})
cmake_path(ABSOLUTE_PATH file)
list(APPEND files ${file})
endforeach()
if(ly_install_files_PROGRAMS)
set(install_type PROGRAMS)
else()
set(install_type FILES)
endif()
install(${install_type} ${files}
DESTINATION ${ly_install_files_DESTINATION}
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME} # use the default for the time being
)
endfunction()
#! ly_install_run_code: specifies code to be added to the install process (will run at install time)
#
# \notes:
# - refer to cmake's install(CODE documentation for more information
#
function(ly_install_run_code CODE)
if(NOT LY_INSTALL_ENABLED)
return()
endif()
install(CODE ${CODE}
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME} # use the default for the time being
)
endfunction()
+2 -2
View File
@@ -29,8 +29,8 @@ elseif (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Darwin" )
ly_set(LY_PYTHON_PACKAGE_HASH 3f65801894e4e44b5faa84dd85ef80ecd772dcf728cdd2d668a6e75978a32695)
elseif (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows" )
ly_set(LY_PYTHON_VERSION 3.7.10)
ly_set(LY_PYTHON_PACKAGE_NAME python-3.7.10-rev1-windows)
ly_set(LY_PYTHON_PACKAGE_HASH 851383addea5c54b7c6398860d04606c1053f1157c2edd801ec3d47394f73136)
ly_set(LY_PYTHON_PACKAGE_NAME python-3.7.10-rev2-windows)
ly_set(LY_PYTHON_PACKAGE_HASH 06d97488a2dbabe832ecfa832a42d3e8a7163ba95e975f032727331b0f49d280)
endif()
# settings and globals
+8 -5
View File
@@ -18,7 +18,7 @@ set(LY_GOOGLETEST_EXTRA_PARAMS CACHE STRING "Allows injection of additional opti
find_package(Python REQUIRED MODULE)
ly_set(LY_PYTEST_EXECUTABLE ${LY_PYTHON_CMD} -B -m pytest -v --tb=short --show-capture=log -c ${LY_ROOT_FOLDER}/ctest_pytest.ini --build-directory "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>")
ly_set(LY_TEST_GLOBAL_KNOWN_SUITE_NAMES "smoke" "main" "periodic" "benchmark" "sandbox")
ly_set(LY_TEST_GLOBAL_KNOWN_SUITE_NAMES "smoke" "main" "periodic" "benchmark" "sandbox" "awsi")
ly_set(LY_TEST_GLOBAL_KNOWN_REQUIREMENTS "gpu")
# Set default test aborts to 25 minutes, avoids hitting the CI pipeline inactivity timeout usually set to 30 minutes
@@ -71,11 +71,14 @@ endfunction()
# \arg:PARENT_NAME(optional) - Name of the parent test run target (if this is a subsequent call to specify a suite)
# \arg:TEST_REQUIRES(optional) - List of system resources that are required to run this test.
# Only available option is "gpu"
# \arg:TEST_SUITE(optional) - "smoke" or "periodic" or "sandbox" - prevents the test from running normally
# \arg:TEST_SUITE(optional) - "smoke" or "periodic" or "benchmark" or "sandbox" or "awsi" - prevents the test from running normally
# and instead places it a special suite of tests that only run when requested.
# Otherwise, do not specify a TEST_SUITE value and the default ("main") will apply.
# "smoke" is tiny, quick tests of fundamental operation (tests with no suite marker will also execute here in CI)
# "periodic" is low-priority verification, which should not block code submission
# "benchmark" is currently reserved for Google Benchmarks
# "sandbox" should be only be used for the workflow of flaky tests
# "awsi" Time consuming AWS integration end-to-end tests
# \arg:TIMEOUT (optional) The timeout in seconds for the module. Defaults to LY_TEST_DEFAULT_TIMEOUT.
# \arg:TEST_COMMAND - Command which runs the tests. It is a required argument
# \arg:NON_IDE_PARAMS - extra params that will be run in ctest, but will not be used in the IDE.
@@ -279,7 +282,7 @@ endfunction()
# \arg:RUNTIME_DEPENDENCIES (optional) - List of additional runtime dependencies required by this test.
# \arg:COMPONENT (optional) - Scope of the feature area that the test belongs to (eg. physics, graphics, etc.).
# \arg:EXCLUDE_TEST_RUN_TARGET_FROM_IDE(bool) - If set the test run target will be not be shown in the IDE
# \arg:TEST_SUITE(optional) - "smoke" or "periodic" or "sandbox" - prevents the test from running normally
# \arg:TEST_SUITE(optional) - "smoke" or "periodic" or "sandbox" or "awsi" - prevents the test from running normally
# and instead places it a special suite of tests that only run when requested.
# \arg:TIMEOUT (optional) The timeout in seconds for the module. If not set defaults to LY_TEST_DEFAULT_TIMEOUT
#
@@ -331,7 +334,7 @@ endfunction()
# \arg:TARGET Name of the target module that is being run for tests. If not provided, will default to 'NAME'
# \arg:TEST_REQUIRES(optional) List of system resources that are required to run this test.
# Only available option is "gpu"
# \arg:TEST_SUITE(optional) - "smoke" or "periodic" or "sandbox" - prevents the test from running normally
# \arg:TEST_SUITE(optional) - "smoke" or "periodic" or "sandbox" or "awsi" - prevents the test from running normally
# and instead places it a special suite of tests that only run when requested.
# \arg:TEST_COMMAND(optional) - Command which runs the tests.
# If not supplied, a default of "AzTestRunner $<TARGET_FILE:${NAME}> AzRunUnitTests" will be used
@@ -372,7 +375,7 @@ function(ly_add_googletest)
# will actually run everything in main OR everything tagged as requiring a GPU
# instead of only tests tagged with BOTH main and gpu...
# so we have to do it this way (negating all others)
set(non_ide_params "--gtest_filter=-*SUITE_smoke*:*SUITE_periodic*:*SUITE_benchmark*:*SUITE_sandbox*")
set(non_ide_params "--gtest_filter=-*SUITE_smoke*:*SUITE_periodic*:*SUITE_benchmark*:*SUITE_sandbox*:*SUITE_awsi*")
endif()
if(NOT ly_add_googletest_TEST_COMMAND)
+58 -6
View File
@@ -29,6 +29,20 @@ define_property(TARGET PROPERTY GEM_MODULE
]]
)
define_property(TARGET PROPERTY RUNTIME_DEPENDENCIES_DEPENDS
BRIEF_DOCS "Defines the dependencies the runtime dependencies of a target has"
FULL_DOCS [[
Property which is queried through generator expressions at the moment
the target is declared so a custom command that will do the copies can
be generated later. Custom commands need to be declared in the same folder
the target is declared, however, runtime dependencies need all targets
to be declared, so it is done towards the end of CMake parsing. When
runtime dependencies are processed, this target property is filled so the
right dependencies are set for the custom command.
This property contains all the files that are going to be copied to the output
when the target gets built.
]]
)
#! ly_add_target: adds a target and provides parameters for the common configurations.
#
@@ -310,15 +324,53 @@ function(ly_add_target)
set_property(GLOBAL APPEND PROPERTY LY_ALL_TARGET_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR})
endif()
# Custom commands need to be declared in the same folder as the target that they use.
# Not all the targets will require runtime dependencies, but we will generate at least an
# empty file for them.
set(runtime_dependencies_list SHARED MODULE EXECUTABLE APPLICATION)
if(NOT ly_add_target_IMPORTED AND linking_options IN_LIST runtime_dependencies_list)
add_custom_command(TARGET ${ly_add_target_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/runtime_dependencies/$<CONFIG>/${ly_add_target_NAME}.cmake
DEPENDS ${CMAKE_BINARY_DIR}/runtime_dependencies/${ly_add_target_NAME}.cmake
MESSAGE "Copying runtime dependencies..."
VERBATIM
)
get_property(is_multi_config_generator GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
# XCode generator doesnt support different source files per configuration, so we cannot have
# the runtime dependencies using file-tracking, instead, we will have them as a post build step
# Non-multi config generators like Ninja (not "Ninja Multi-Config"), Makefiles, etc have trouble to
# produce file-level dependencies per configuration, so we also default to use a post build step
if(NOT is_multi_config_generator OR CMAKE_GENERATOR MATCHES Xcode)
add_custom_command(TARGET ${ly_add_target_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/runtime_dependencies/$<CONFIG>/${ly_add_target_NAME}.cmake
COMMENT "Copying ${ly_add_target_NAME} runtime dependencies to output..."
DEPENDS ${CMAKE_BINARY_DIR}/runtime_dependencies/${ly_add_target_NAME}.cmake
COMMENT "Copying runtime dependencies..."
VERBATIM
)
else()
# the stamp file will be the one that triggers the execution of the custom rule. At the end
# of running the copy of runtime dependencies, the stamp file is touched so the timestamp is updated.
# Adding a config as part of the name since the stamp file is added to the VS project.
# Note the STAMP_OUTPUT_FILE need to match with the one used in runtime dependencies (e.g. RuntimeDependencies_common.cmake)
set(STAMP_OUTPUT_FILE ${CMAKE_BINARY_DIR}/runtime_dependencies/$<CONFIG>/${ly_add_target_NAME}_$<CONFIG>.stamp)
add_custom_command(
OUTPUT ${STAMP_OUTPUT_FILE}
DEPENDS "$<GENEX_EVAL:$<TARGET_PROPERTY:${ly_add_target_NAME},RUNTIME_DEPENDENCIES_DEPENDS>>"
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/runtime_dependencies/$<CONFIG>/${ly_add_target_NAME}.cmake
COMMENT "Copying ${ly_add_target_NAME} runtime dependencies to output..."
VERBATIM
)
# Unfortunately the VS generator cannot deal with generation expressions as part of the file name, wrapping the
# stamp file on each configuration so it gets properly excluded by the generator
unset(stamp_files_per_config)
foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES)
set(stamp_file_conf ${CMAKE_BINARY_DIR}/runtime_dependencies/${conf}/${ly_add_target_NAME}_${conf}.stamp)
set_source_files_properties(${stamp_file_conf} PROPERTIES GENERATED TRUE SKIP_AUTOGEN TRUE)
list(APPEND stamp_files_per_config $<$<CONFIG:${conf}>:${stamp_file_conf}>)
endforeach()
target_sources(${ly_add_target_NAME} PRIVATE ${stamp_files_per_config})
endif()
endif()
+1 -1
View File
@@ -34,8 +34,8 @@ function(ly_add_autogen)
add_custom_command(
OUTPUT ${AUTOGEN_OUTPUTS}
DEPENDS ${AZCG_DEPENDENCIES}
COMMAND ${CMAKE_COMMAND} -E echo "Running AutoGen for ${ly_add_autogen_NAME}"
COMMAND ${LY_PYTHON_CMD} "${LY_ROOT_FOLDER}/cmake/AzAutoGen.py" "${CMAKE_BINARY_DIR}/Azcg/TemplateCache/" "${CMAKE_CURRENT_BINARY_DIR}/Azcg/Generated/" "${CMAKE_CURRENT_SOURCE_DIR}" "${AZCG_INPUTFILES}" "${ly_add_autogen_AUTOGEN_RULES}"
COMMENT "Running AutoGen for ${ly_add_autogen_NAME}"
VERBATIM
)
set_target_properties(${ly_add_autogen_NAME} PROPERTIES AUTOGEN_INPUT_FILES "${AZCG_INPUTFILES}")
+4 -2
View File
@@ -13,5 +13,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin CACHE PATH "Build dir
# We install outside of the binary dir because our install support muliple platforms to
# be installed together. We also have an exclusion rule in the AP that filters out the
# "build" folder which is a common binary dir
set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/install CACHE PATH "Installation prefix")
# "install" folder to avoid the AP picking it up
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/install CACHE PATH "Install directory" FORCE)
endif()
+24 -19
View File
@@ -112,7 +112,8 @@ function(read_engine_restricted_path output_restricted_path)
# Set manifest path to path in the user home directory
set(manifest_path ${LY_ROOT_FOLDER}/engine.json)
if(EXISTS ${manifest_path})
o3de_restricted_path(${manifest_path} output_restricted_path)
o3de_restricted_path(${manifest_path} read_restricted_path)
set(${output_restricted_path} ${read_restricted_path} PARENT_SCOPE)
endif()
endfunction()
@@ -133,16 +134,17 @@ ly_set(PAL_HOST_PLATFORM_NAME_LOWERCASE ${PAL_HOST_PLATFORM_NAME_LOWERCASE})
set(PAL_RESTRICTED_PLATFORMS)
string(LENGTH "${O3DE_ENGINE_RESTRICTED_PATH}" engine_restricted_length)
file(GLOB pal_restricted_files ${O3DE_ENGINE_RESTRICTED_PATH}/*/cmake/PAL_*.cmake)
foreach(pal_restricted_file ${pal_restricted_files})
string(FIND ${pal_restricted_file} "/cmake/PAL" end)
if(${end} GREATER -1)
math(EXPR platform_length "${end} - ${engine_restricted_length} - 1")
math(EXPR platform_start "${engine_restricted_length} + 1")
string(SUBSTRING ${pal_restricted_file} ${platform_start} ${platform_length} platform)
list(APPEND PAL_RESTRICTED_PLATFORMS "${platform}")
endif()
# Get relative path from restricted root directory
cmake_path(RELATIVE_PATH pal_restricted_file BASE_DIRECTORY ${O3DE_ENGINE_RESTRICTED_PATH} OUTPUT_VARIABLE relative_pal_restricted_file)
# Split relative restricted path into path segments
string(REPLACE "/" ";" pal_restricted_segments ${relative_pal_restricted_file})
# Retrieve the first path segment which should be the restricted platform
list(GET pal_restricted_segments 0 platform)
# Append the new restricted platform
string(TOLOWER ${platform} platform_lower)
list(APPEND PAL_RESTRICTED_PLATFORMS ${platform_lower})
endforeach()
ly_set(PAL_RESTRICTED_PLATFORMS ${PAL_RESTRICTED_PLATFORMS})
@@ -186,11 +188,17 @@ function(ly_get_absolute_pal_filename out_name in_name)
# Remove one path segment from the end of the current_object_path and prepend it to the list path_segments
cmake_path(GET current_object_path PARENT_PATH parent_path)
cmake_path(GET current_object_path FILENAME path_segment)
list(PREPEND path_segments_visited path_segment)
list(PREPEND path_segments_visited ${path_segment})
cmake_path(COMPARE current_object_path NOT_EQUAL parent_path is_prev_path_segment)
cmake_path(SET current_object_path "${parent_path}")
set(is_prev_path_segment TRUE)
while(is_prev_path_segment)
# Remove one path segment from the end of the current_object_path and prepend it to the list path_segments
cmake_path(GET current_object_path PARENT_PATH parent_path)
cmake_path(GET current_object_path FILENAME path_segment)
cmake_path(COMPARE current_object_path NOT_EQUAL parent_path is_prev_path_segment)
cmake_path(SET current_object_path "${parent_path}")
# The Path is in a PAL structure
# Decompose the path into sections before "Platform" and after "Platform"
if(path_segment STREQUAL "Platform")
@@ -205,21 +213,17 @@ function(ly_get_absolute_pal_filename out_name in_name)
break()
endif()
# Remove one path segment from the end of the current_object_path and prepend it to the list path_segments
cmake_path(GET current_object_path PARENT_PATH parent_path)
cmake_path(GET current_object_path FILENAME path_segment)
list(PREPEND path_segments_visited path_segment)
cmake_path(COMPARE current_object_path NOT_EQUAL parent_path is_prev_path_segment)
cmake_path(SET current_object_path "${parent_path}")
list(PREPEND path_segments_visited ${path_segment})
endwhile()
# Compose a candidate restricted path and examine if it exists
cmake_path(APPEND object_restricted_path ${pre_platform_paths} "Platform" ${post_platform_paths}
cmake_path(APPEND ${pre_platform_paths} "Platform" ${post_platform_paths}
OUTPUT_VARIABLE candidate_PAL_path)
if(NOT EXISTS ${candidate_PAL_path})
if("${candidate_platform_name}" IN_LIST PAL_RESTRICTED_PLATFORMS)
string(TOLOWER ${candidate_platform_name} candidate_platform_name_lower)
if("${candidate_platform_name_lower}" IN_LIST PAL_RESTRICTED_PLATFORMS)
cmake_path(APPEND object_restricted_path ${candidate_platform_name} ${object_name}
${pre_platform_paths} ${post_platform_paths} OUTPUT_VARIABLE candidate_PAL_path)
${pre_platform_paths} OUTPUT_VARIABLE candidate_PAL_path)
endif()
endif()
if(EXISTS ${candidate_PAL_path})
@@ -227,6 +231,7 @@ function(ly_get_absolute_pal_filename out_name in_name)
endif()
endif()
endif()
cmake_path(ABSOLUTE_PATH full_name BASE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
set(${out_name} ${full_name} PARENT_SCOPE)
endfunction()
@@ -18,28 +18,12 @@ ly_append_configurations_options(
# Disabled warnings (please do not disable any others without first consulting ly-warnings)
-Wrange-loop-analysis
-Wno-unknown-warning-option
"-Wno-#pragma-messages"
-Wno-absolute-value
-Wno-dynamic-class-memaccess
-Wno-format-security
-Wno-unknown-warning-option # used as a way to mark warnings that are MSVC only
-Wno-inconsistent-missing-override
-Wno-invalid-offsetof
-Wno-multichar
-Wno-parentheses
-Wno-reorder
-Wno-self-assign
-Wno-switch
-Wno-tautological-compare
-Wno-undefined-var-template
-Wno-unknown-pragmas
-Wno-unused-function
-Wno-unused-private-field
-Wno-unused-value
-Wno-unused-variable
-Wno-unused-lambda-capture
# Workaround for compiler seeing file case differently from what OS show in console.
-Wno-nonportable-include-path
COMPILATION_DEBUG
-O0 # No optimization
+123 -198
View File
@@ -38,9 +38,6 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar
# Get the target source directory relative to the LY root folder
ly_get_engine_relative_source_dir(${absolute_target_source_dir} relative_target_source_dir)
# get the component ID. if the property isn't set for the target, it will auto fallback to use CMAKE_INSTALL_DEFAULT_COMPONENT_NAME
get_property(install_component TARGET ${TARGET_NAME} PROPERTY INSTALL_COMPONENT)
# All include directories marked PUBLIC or INTERFACE will be installed. We dont use PUBLIC_HEADER because in order to do that
# we need to set the PUBLIC_HEADER property of the target for all the headers we are exporting. After doing that, installing the
# headers end up in one folder instead of duplicating the folder structure of the public/interface include directory.
@@ -69,7 +66,7 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar
install(DIRECTORY ${include_directory}
DESTINATION ${destination_dir}
COMPONENT ${install_component}
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
FILES_MATCHING
PATTERN *.h
PATTERN *.hpp
@@ -108,13 +105,13 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar
TARGETS ${TARGET_NAME}
ARCHIVE
DESTINATION ${archive_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>
COMPONENT ${install_component}
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
LIBRARY
DESTINATION ${library_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>/${target_library_output_subdirectory}
COMPONENT ${install_component}
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
RUNTIME
DESTINATION ${runtime_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>/${target_runtime_output_subdirectory}
COMPONENT ${install_component}
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
)
endif()
@@ -138,16 +135,20 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar
string(REPLACE "_LIBRARY" "" TARGET_TYPE_PLACEHOLDER ${target_type})
# For HEADER_ONLY libs we end up generating "INTERFACE" libraries, need to specify HEADERONLY instead
string(REPLACE "INTERFACE" "HEADERONLY" TARGET_TYPE_PLACEHOLDER ${TARGET_TYPE_PLACEHOLDER})
if(TARGET_TYPE_PLACEHOLDER STREQUAL "MODULE")
# In non-monolithic mode, gem targets are MODULE libraries, In monolithic mode gem targets are STATIC libraries
set(GEM_LIBRARY_TYPES "MODULE" "STATIC")
if(TARGET_TYPE_PLACEHOLDER IN_LIST GEM_LIBRARY_TYPES)
get_target_property(gem_module ${TARGET_NAME} GEM_MODULE)
if(gem_module)
set(TARGET_TYPE_PLACEHOLDER "GEM_MODULE")
endif()
endif()
string(REPEAT " " 12 PLACEHOLDER_INDENT)
get_target_property(COMPILE_DEFINITIONS_PLACEHOLDER ${TARGET_NAME} INTERFACE_COMPILE_DEFINITIONS)
if(COMPILE_DEFINITIONS_PLACEHOLDER)
string(REPLACE ";" "\n" COMPILE_DEFINITIONS_PLACEHOLDER "${COMPILE_DEFINITIONS_PLACEHOLDER}")
set(COMPILE_DEFINITIONS_PLACEHOLDER "${PLACEHOLDER_INDENT}${COMPILE_DEFINITIONS_PLACEHOLDER}")
list(JOIN COMPILE_DEFINITIONS_PLACEHOLDER "\n${PLACEHOLDER_INDENT}" COMPILE_DEFINITIONS_PLACEHOLDER)
else()
unset(COMPILE_DEFINITIONS_PLACEHOLDER)
endif()
@@ -159,25 +160,28 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar
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 "${target_include}\n")
string(APPEND INCLUDE_DIRECTORIES_PLACEHOLDER "${PLACEHOLDER_INDENT}${target_include}\n")
endif()
endforeach()
endif()
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
string(REPLACE ";" "\n" RUNTIME_DEPENDENCIES_PLACEHOLDER "${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 " " 12 PLACEHOLDER_INDENT)
get_target_property(inteface_build_dependencies_props ${TARGET_NAME} INTERFACE_LINK_LIBRARIES)
unset(INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER)
if(inteface_build_dependencies_props)
foreach(build_dependency ${inteface_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 "${build_dependency}")
list(APPEND INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER "${PLACEHOLDER_INDENT}${build_dependency}")
endif()
endforeach()
endif()
@@ -187,12 +191,19 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar
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 "${build_dependency}")
list(APPEND INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER "${PLACEHOLDER_INDENT}${build_dependency}")
endif()
endforeach()
endif()
list(REMOVE_DUPLICATES INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER)
string(REPLACE ";" "\n" INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER "${INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER}")
list(JOIN INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER "\n" INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER)
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)
if(target_project_association)
list(APPEND TARGET_PROPERTIES_PLACEHOLDER "${PLACEHOLDER_INDENT}LY_PROJECT_NAME ${target_project_association}")
endif()
# If the target is an executable/application, add a custom target so we can debug the target in project-centric workflow
if(should_create_helper)
@@ -257,7 +268,7 @@ set_property(TARGET ${NAME_PLACEHOLDER}
file(GENERATE OUTPUT "${target_install_source_dir}/${NAME_PLACEHOLDER}_$<CONFIG>.cmake" CONTENT "${target_file_contents}")
install(FILES "${target_install_source_dir}/${NAME_PLACEHOLDER}_$<CONFIG>.cmake"
DESTINATION ${relative_target_source_dir}
COMPONENT ${install_component}
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
)
# Since a CMakeLists.txt could contain multiple targets, we generate it in a folder per target
@@ -288,44 +299,9 @@ function(ly_setup_subdirectory absolute_target_source_dir)
string(APPEND all_configured_targets "${configured_target}")
endforeach()
# Replicate the ly_create_alias() calls based on the SOURCE_DIR for each target that generates an installed CMakeLists.txt
string(JOIN "\n" create_alias_template
"if(NOT TARGET @ALIAS_NAME@)"
" ly_create_alias(NAME @ALIAS_NAME@ NAMESPACE @ALIAS_NAMESPACE@ TARGETS @ALIAS_TARGETS@)"
"endif()"
""
)
get_property(create_alias_commands_arg_list DIRECTORY ${absolute_target_source_dir} PROPERTY LY_CREATE_ALIAS_ARGUMENTS)
foreach(create_alias_single_command_arg_list ${create_alias_commands_arg_list})
# Split the ly_create_alias arguments back out based on commas
string(REPLACE "," ";" create_alias_single_command_arg_list "${create_alias_single_command_arg_list}")
list(POP_FRONT create_alias_single_command_arg_list ALIAS_NAME)
list(POP_FRONT create_alias_single_command_arg_list ALIAS_NAMESPACE)
# The rest of the list are the target dependencies
set(ALIAS_TARGETS ${create_alias_single_command_arg_list})
string(CONFIGURE "${create_alias_template}" create_alias_command @ONLY)
string(APPEND CREATE_ALIASES_PLACEHOLDER ${create_alias_command})
endforeach()
# Reproduce the ly_enable_gems() calls made in the the SOURCE_DIR for this target into the CMakeLists.txt that
# is about to be generated
set(enable_gems_template "ly_enable_gems(@enable_gem_PROJECT_NAME@ @enable_gem_GEMS@ @enable_gem_GEM_FILE@ @enable_gem_VARIANTS@ @enable_gem_TARGETS@)\n")
get_property(enable_gems_commands_arg_list DIRECTORY ${absolute_target_source_dir} PROPERTY LY_ENABLE_GEMS_ARGUMENTS)
foreach(enable_gems_single_command_arg_list ${enable_gems_commands_arg_list})
# Split the ly_enable_gems arguments back out based on commas
string(REPLACE "," ";" enable_gems_single_command_arg_list "${enable_gems_single_command_arg_list}")
foreach(enable_gem_arg_kw IN ITEMS PROJECT_NAME GEMS GEM_FILE VARIANTS TARGETS)
list(POP_FRONT enable_gems_single_command_arg_list enable_gem_${enable_gem_arg_kw})
if(enable_gem_${enable_gem_arg_kw})
# if the argument exist append to argument keyword to the front
string(PREPEND enable_gem_${enable_gem_arg_kw} "${enable_gem_arg_kw} ")
endif()
endforeach()
string(CONFIGURE "${enable_gems_template}" enable_gems_command @ONLY)
string(APPEND ENABLE_GEMS_PLACEHOLDER ${enable_gems_command})
endforeach()
ly_setup_subdirectory_create_alias("${absolute_target_source_dir}" CREATE_ALIASES_PLACEHOLDER)
ly_setup_subdirectory_set_gem_variant_to_load("${absolute_target_source_dir}" GEM_VARIANT_TO_LOAD_PLACEHOLDER)
ly_setup_subdirectory_enable_gems("${absolute_target_source_dir}" ENABLE_GEMS_PLACEHOLDER)
ly_file_read(${LY_ROOT_FOLDER}/cmake/install/Copyright.in cmake_copyright_comment)
@@ -337,15 +313,13 @@ function(ly_setup_subdirectory absolute_target_source_dir)
"${all_configured_targets}"
"\n"
"${CREATE_ALIASES_PLACEHOLDER}"
"${GEM_VARIANT_TO_LOAD_PLACEHOLDER}"
"${ENABLE_GEMS_PLACEHOLDER}"
)
# get the component ID. if the property isn't set for the directory, it will auto fallback to use CMAKE_INSTALL_DEFAULT_COMPONENT_NAME
get_property(install_component DIRECTORY ${absolute_target_source_dir} PROPERTY INSTALL_COMPONENT)
install(FILES "${target_install_source_dir}/CMakeLists.txt"
DESTINATION ${relative_target_source_dir}
COMPONENT ${install_component}
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
)
endfunction()
@@ -355,9 +329,17 @@ function(ly_setup_o3de_install)
ly_setup_subdirectories()
ly_setup_cmake_install()
ly_setup_target_generator()
ly_setup_runtime_dependencies()
ly_setup_others()
ly_setup_assets()
# Misc
install(FILES
${LY_ROOT_FOLDER}/ctest_pytest.ini
${LY_ROOT_FOLDER}/LICENSE.txt
${LY_ROOT_FOLDER}/README.md
DESTINATION .
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
)
endfunction()
@@ -366,6 +348,7 @@ function(ly_setup_cmake_install)
install(DIRECTORY "${LY_ROOT_FOLDER}/cmake"
DESTINATION .
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
PATTERN "__pycache__" EXCLUDE
REGEX "Findo3de.cmake" EXCLUDE
REGEX "Platform\/.*\/BuiltInPackages_.*\.cmake" EXCLUDE
@@ -393,18 +376,32 @@ function(ly_setup_cmake_install)
"${LY_ROOT_FOLDER}/CMakeLists.txt"
"${CMAKE_CURRENT_BINARY_DIR}/cmake/engine.json"
DESTINATION .
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
)
# Collect all Find files that were added with ly_add_external_target_path
unset(additional_find_files)
unset(additional_platform_files)
get_property(additional_module_paths GLOBAL PROPERTY LY_ADDITIONAL_MODULE_PATH)
foreach(additional_module_path ${additional_module_paths})
unset(find_files)
file(GLOB find_files "${additional_module_path}/Find*.cmake")
list(APPEND additional_find_files "${find_files}")
foreach(find_file ${find_files})
# also copy the Platform/<current_platform> to the destination
cmake_path(GET find_file PARENT_PATH find_file_parent)
unset(plat_files)
file(GLOB plat_files "${find_file_parent}/Platform/${PAL_PLATFORM_NAME}/*.cmake")
list(APPEND additional_platform_files "${plat_files}")
endforeach()
endforeach()
install(FILES ${additional_find_files}
DESTINATION cmake/3rdParty
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
)
install(FILES ${additional_platform_files}
DESTINATION cmake/3rdParty/Platform/${PAL_PLATFORM_NAME}
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
)
# Findo3de.cmake file: we generate a different Findo3de.camke file than the one we have in cmake. This one is going to expose all
@@ -421,6 +418,7 @@ function(ly_setup_cmake_install)
configure_file(${LY_ROOT_FOLDER}/cmake/install/Findo3de.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/cmake/Findo3de.cmake @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/cmake/Findo3de.cmake"
DESTINATION cmake
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
)
# BuiltInPackage_<platform>.cmake: since associations could happen in any cmake file across the engine. We collect
@@ -440,6 +438,7 @@ function(ly_setup_cmake_install)
)
install(FILES "${pal_builtin_file}"
DESTINATION cmake/3rdParty/Platform/${PAL_PLATFORM_NAME}
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
)
endfunction()
@@ -455,6 +454,7 @@ function(ly_setup_runtime_dependencies)
"function(ly_copy source_file target_directory)
file(COPY \"\${source_file}\" DESTINATION \"\${target_directory}\" FILE_PERMISSIONS ${LY_COPY_PERMISSIONS})
endfunction()"
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
)
endif()
@@ -479,7 +479,8 @@ endfunction()"
ly_get_runtime_dependencies(runtime_dependencies ${target})
foreach(runtime_dependency ${runtime_dependencies})
unset(runtime_command)
ly_get_runtime_dependency_command(runtime_command ${runtime_dependency})
unset(runtime_depend) # unused, but required to be passed to ly_get_runtime_dependency_command
ly_get_runtime_dependency_command(runtime_command runtime_depend ${runtime_dependency})
string(CONFIGURE "${runtime_command}" runtime_command @ONLY)
list(APPEND runtime_commands ${runtime_command})
endforeach()
@@ -488,75 +489,14 @@ endfunction()"
list(REMOVE_DUPLICATES runtime_commands)
list(JOIN runtime_commands " " runtime_commands_str) # the spaces are just to see the right identation in the cmake_install.cmake file
install(CODE "${runtime_commands_str}"
install(CODE "${runtime_commands_str}"
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
)
endfunction()
#! ly_setup_others: install directories required by the engine
function(ly_setup_others)
# List of directories we want to install relative to engine root
set(DIRECTORIES_TO_INSTALL Tools/LyTestTools Tools/RemoteConsole)
foreach(dir ${DIRECTORIES_TO_INSTALL})
get_filename_component(install_path ${dir} DIRECTORY)
if (NOT install_path)
set(install_path .)
endif()
install(DIRECTORY "${LY_ROOT_FOLDER}/${dir}"
DESTINATION ${install_path}
PATTERN "__pycache__" EXCLUDE
)
endforeach()
# Scripts
file(GLOB o3de_scripts "${LY_ROOT_FOLDER}/scripts/o3de.*")
install(PROGRAMS
${o3de_scripts}
DESTINATION ./scripts
)
install(DIRECTORY
${LY_ROOT_FOLDER}/scripts/bundler
${LY_ROOT_FOLDER}/scripts/o3de
DESTINATION ./scripts
PATTERN "__pycache__" EXCLUDE
PATTERN "CMakeLists.txt" EXCLUDE
PATTERN "tests" EXCLUDE
)
install(DIRECTORY "${LY_ROOT_FOLDER}/python"
DESTINATION .
REGEX "downloaded_packages" EXCLUDE
REGEX "runtime" EXCLUDE
REGEX ".*$\.sh" EXCLUDE
)
# For Mac/Linux shell scripts need to be installed as PROGRAMS to have execute permission
file(GLOB python_scripts "${LY_ROOT_FOLDER}/python/*.sh")
install(PROGRAMS
${python_scripts}
DESTINATION ./python
)
# Registry
install(DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>/Registry
DESTINATION ./${runtime_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>
)
install(DIRECTORY
${LY_ROOT_FOLDER}/Registry
DESTINATION .
)
# Engine Source Assets
install(DIRECTORY
${LY_ROOT_FOLDER}/Assets
DESTINATION .
)
#! ly_setup_assets: install asset directories required by the engine
function(ly_setup_assets)
# Gem Source Assets and configuration files
# Find all gem directories relative to the CMake Source Dir
@@ -637,88 +577,73 @@ function(ly_setup_others)
cmake_path(SET gem_install_dest_dir .)
endif()
if(IS_DIRECTORY ${gem_absolute_path})
install(DIRECTORY "${gem_absolute_path}" DESTINATION ${gem_install_dest_dir})
install(DIRECTORY "${gem_absolute_path}"
DESTINATION ${gem_install_dest_dir}
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
)
elseif (EXISTS ${gem_absolute_path})
install(FILES ${gem_absolute_path} DESTINATION ${gem_install_dest_dir})
install(FILES ${gem_absolute_path}
DESTINATION ${gem_install_dest_dir}
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
)
endif()
endforeach()
endforeach()
# Templates
install(DIRECTORY
${LY_ROOT_FOLDER}/Templates
DESTINATION .
)
# Misc
install(FILES
${LY_ROOT_FOLDER}/ctest_pytest.ini
${LY_ROOT_FOLDER}/LICENSE.txt
${LY_ROOT_FOLDER}/README.md
DESTINATION .
)
endfunction()
#! ly_setup_target_generator: install source files needed for project launcher generation
function(ly_setup_target_generator)
install(FILES
${LY_ROOT_FOLDER}/Code/LauncherUnified/launcher_generator.cmake
${LY_ROOT_FOLDER}/Code/LauncherUnified/launcher_project_files.cmake
${LY_ROOT_FOLDER}/Code/LauncherUnified/LauncherProject.cpp
${LY_ROOT_FOLDER}/Code/LauncherUnified/StaticModules.in
DESTINATION LauncherGenerator
)
install(DIRECTORY ${LY_ROOT_FOLDER}/Code/LauncherUnified/Platform
DESTINATION LauncherGenerator
)
install(FILES ${LY_ROOT_FOLDER}/Code/LauncherUnified/FindLauncherGenerator.cmake
DESTINATION cmake
)
#! ly_setup_subdirectory_create_alias: Replicates the call to the `ly_create_alias` function
#! within the generated CMakeLists.txt in the same relative install layout directory
function(ly_setup_subdirectory_create_alias absolute_target_source_dir output_script)
# Replicate the create_alias() calls made in the SOURCE_DIR into the generated CMakeLists.txt
string(JOIN "\n" create_alias_template
"if(NOT TARGET @alias_name@)"
" ly_create_alias(@create_alias_args@)"
"endif()"
"")
endfunction()
#! ly_add_install_paths: Adds the list of path to copy to the install layout relative to the same folder
# \arg:PATHS - Paths to copy over to the install layout. The DESTINATION sub argument is optional
# The INPUT sub-argument is required
# \arg:BASE_DIRECTORY(Optional) - Absolute path where a relative path from the each input path will be
# based off of. Defaults to LY_ROOT_FOLDER if not supplied
function(ly_add_install_paths)
set(options)
set(oneValueArgs BASE_DIRECTORY)
set(multiValueArgs PATHS)
cmake_parse_arguments(ly_add_install_paths "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT ly_add_install_paths_PATHS)
message(FATAL_ERROR "ly_add_install_paths requires at least one input path to copy to the destination")
endif()
# The default is the "." directory if not supplied
if(NOT ly_add_install_paths_BASE_DIRECTORY)
cmake_path(SET ly_add_install_paths_BASE_DIRECTORY ${LY_ROOT_FOLDER})
endif()
# Separate each path into an INPUT and DESTINATION parameter
set(options)
set(oneValueArgs INPUT DESTINATION)
set(multiValueArgs)
foreach(install_path IN LISTS ly_add_install_paths_PATHS)
string(REPLACE " " ";" install_path ${install_path})
cmake_parse_arguments(install "${options}" "${oneValueArgs}" "${multiValueArgs}" ${install_path})
if(NOT install_DESTINATION)
ly_get_engine_relative_source_dir(${install_INPUT} rel_to_root_input_path
BASE_DIRECTORY ${ly_add_install_paths_BASE_DIRECTORY})
cmake_path(GET rel_to_root_input_path PARENT_PATH install_DESTINATION)
endif()
if(NOT install_DESTINATION)
cmake_path(SET install_DESTINATION .)
endif()
if(IS_DIRECTORY ${install_INPUT})
install(DIRECTORY ${install_INPUT} DESTINATION ${install_DESTINATION})
elseif(EXISTS ${install_INPUT})
install(FILES ${install_INPUT} DESTINATION ${install_DESTINATION})
endif()
unset(${output_script} PARENT_SCOPE)
get_property(create_alias_args_list DIRECTORY ${absolute_target_source_dir} PROPERTY LY_CREATE_ALIAS_ARGUMENTS)
foreach(create_alias_args IN LISTS create_alias_args_list)
# Create a list out of the comma separated arguments and store it into the same variable
string(REPLACE "," ";" create_alias_args ${create_alias_args})
# The first argument of the create alias argument list is the ALIAS NAME so pop it from the list
# It is used to protect against registering the same alias twice
list(POP_FRONT create_alias_args alias_name)
string(CONFIGURE "${create_alias_template}" create_alias_command @ONLY)
string(APPEND create_alias_calls ${create_alias_command})
endforeach()
set(${output_script} ${create_alias_calls} PARENT_SCOPE)
endfunction()
#! ly_setup_subdirectory_set_gem_variant_to_load: Replicates the call to the `ly_set_gem_variant_to_load` function
#! within the generated CMakeLists.txt in the same relative install layout directory
function(ly_setup_subdirectory_set_gem_variant_to_load absolute_target_source_dir output_script)
# Replicate the ly_set_gem_variant_to_load() calls made in the SOURCE_DIR for into the generated CMakeLists.txt
set(set_gem_variant_args_template "ly_set_gem_variant_to_load(@set_gem_variant_args@)\n")
unset(${output_script} PARENT_SCOPE)
get_property(set_gem_variant_args_lists DIRECTORY ${absolute_target_source_dir} PROPERTY LY_SET_GEM_VARIANT_TO_LOAD_ARGUMENTS)
foreach(set_gem_variant_args IN LISTS set_gem_variant_args_lists)
string(CONFIGURE "${set_gem_variant_args_template}" set_gem_variant_to_load_command @ONLY)
string(APPEND set_gem_variant_calls ${set_gem_variant_to_load_command})
endforeach()
set(${output_script} ${set_gem_variant_calls} PARENT_SCOPE)
endfunction()
#! ly_setup_subdirectory_enable_gems: Replicates the call to the `ly_enable_gems` function
#! within the generated CMakeLists.txt in the same relative install layout directory
function(ly_setup_subdirectory_enable_gems absolute_target_source_dir output_script)
# Replicate the ly_set_gem_variant_to_load() calls made in the SOURCE_DIR into the generated CMakeLists.txt
set(enable_gems_template "ly_enable_gems(@enable_gems_args@)\n")
unset(${output_script} PARENT_SCOPE)
get_property(enable_gems_args_list DIRECTORY ${absolute_target_source_dir} PROPERTY LY_ENABLE_GEMS_ARGUMENTS)
foreach(enable_gems_args IN LISTS enable_gems_args_list)
string(CONFIGURE "${enable_gems_template}" enable_gems_command @ONLY)
string(APPEND enable_gems_calls ${enable_gems_command})
endforeach()
set(${output_script} ${enable_gems_calls} PARENT_SCOPE)
endfunction()
@@ -33,6 +33,7 @@ ly_append_configurations_options(
/nologo # Suppress Copyright and version number message
/W4 # Warning level 4
/WX # Warnings as errors
/permissive- # Conformance with standard
# Disabling some warnings
/wd4201 # nonstandard extension used: nameless struct/union. This actually became part of the C++11 std, MS has an open issue: https://developercommunity.visualstudio.com/t/warning-level-4-generates-a-bogus-warning-c4201-no/103064
@@ -40,12 +41,14 @@ ly_append_configurations_options(
# Enabling warnings that are disabled by default from /W4
# https://docs.microsoft.com/en-us/cpp/preprocessor/compiler-warnings-that-are-off-by-default?view=vs-2019
/we4296 # 'operator': expression is always false
# /we4426 # optimization flags changed after including header, may be due to #pragma optimize()
# /we4464 # relative include path contains '..'
# /we4619 # #pragma warning: there is no warning number 'number'
# /we4777 # 'function' : format string 'string' requires an argument of type 'type1', but variadic argument number has type 'type2'
# /we5031 # #pragma warning(pop): likely mismatch, popping warning state pushed in different file
# /WE5032 # detected #pragma warning(push) with no corresponding #pragma warning(pop)
/we4426 # optimization flags changed after including header, may be due to #pragma optimize()
#/we4619 # #pragma warning: there is no warning number 'number'. Unfortunately some versions of MSVC 16.X dont filter this warning coming from external headers and Qt has a bad warning in QtCore/qvector.h(340,12)
/we4774 # 'string' : format string expected in argument number is not a string literal
/we4777 # 'function' : format string 'string' requires an argument of type 'type1', but variadic argument number has type 'type2
/we5031 # #pragma warning(pop): likely mismatch, popping warning state pushed in different file
/we5032 # detected #pragma warning(push) with no corresponding #pragma warning(pop)
/we5233 # explicit lambda capture 'identifier' is not used
/Zc:forScope # Force Conformance in for Loop Scope
/diagnostics:caret # Compiler diagnostic options: includes the column where the issue was found and places a caret (^) under the location in the line of code where the issue was detected.
@@ -113,7 +113,7 @@ function(ly_get_runtime_dependencies ly_RUNTIME_DEPENDENCIES ly_TARGET)
unset(target_locations)
get_target_property(target_locations ${ly_TARGET} ${imported_property})
if(target_locations)
list(APPEND all_runtime_dependencies ${target_locations})
list(APPEND all_runtime_dependencies "${target_locations}")
else()
# Check if the property exists for configurations
unset(target_locations)
@@ -156,7 +156,7 @@ function(ly_get_runtime_dependencies ly_RUNTIME_DEPENDENCIES ly_TARGET)
endfunction()
function(ly_get_runtime_dependency_command ly_RUNTIME_COMMAND ly_TARGET)
function(ly_get_runtime_dependency_command ly_RUNTIME_COMMAND ly_RUNTIME_DEPEND ly_TARGET)
# To optimize this, we are going to cache the commands for the targets we requested. A lot of targets end up being
# dependencies of other targets.
@@ -166,6 +166,8 @@ function(ly_get_runtime_dependency_command ly_RUNTIME_COMMAND ly_TARGET)
# We already walked through this target
get_property(cached_command GLOBAL PROPERTY LY_RUNTIME_DEPENDENCY_COMMAND_${ly_TARGET})
set(${ly_RUNTIME_COMMAND} ${cached_command} PARENT_SCOPE)
get_property(cached_depend GLOBAL PROPERTY LY_RUNTIME_DEPENDENCY_DEPEND_${ly_TARGET})
set(${ly_RUNTIME_DEPEND} "${cached_depend}" PARENT_SCOPE)
return()
endif()
@@ -223,6 +225,8 @@ function(ly_get_runtime_dependency_command ly_RUNTIME_COMMAND ly_TARGET)
set_property(GLOBAL PROPERTY LY_RUNTIME_DEPENDENCY_COMMAND_${ly_TARGET} "${runtime_command}")
set(${ly_RUNTIME_COMMAND} ${runtime_command} PARENT_SCOPE)
set_property(GLOBAL PROPERTY LY_RUNTIME_DEPENDENCY_DEPEND_${ly_TARGET} "${source_file}")
set(${ly_RUNTIME_DEPEND} "${source_file}" PARENT_SCOPE)
endfunction()
@@ -245,15 +249,19 @@ function(ly_delayed_generate_runtime_dependencies)
unset(runtime_dependencies)
unset(LY_COPY_COMMANDS)
unset(runtime_depends)
ly_get_runtime_dependencies(runtime_dependencies ${target})
foreach(runtime_dependency ${runtime_dependencies})
unset(runtime_command)
ly_get_runtime_dependency_command(runtime_command ${runtime_dependency})
unset(runtime_depend)
ly_get_runtime_dependency_command(runtime_command runtime_depend ${runtime_dependency})
string(APPEND LY_COPY_COMMANDS ${runtime_command})
list(APPEND runtime_depends ${runtime_depend})
endforeach()
# Generate the output file
# Generate the output file, note the STAMP_OUTPUT_FILE need to match with the one defined in LYWrappers.cmake
set(STAMP_OUTPUT_FILE ${CMAKE_BINARY_DIR}/runtime_dependencies/$<CONFIG>/${target}_$<CONFIG>.stamp)
set(target_file_dir "$<TARGET_FILE_DIR:${target}>")
set(target_file "$<TARGET_FILE:${target}>")
ly_file_read(${LY_RUNTIME_DEPENDENCIES_TEMPLATE} template_file)
@@ -263,6 +271,9 @@ function(ly_delayed_generate_runtime_dependencies)
OUTPUT ${CMAKE_BINARY_DIR}/runtime_dependencies/$<CONFIG>/${target}.cmake
CONTENT "${configured_template_file}"
)
# set the property that is consumed from the custom command generated in LyWrappers.cmake
set_target_properties(${target} PROPERTIES RUNTIME_DEPENDENCIES_DEPENDS "${runtime_depends}")
endforeach()
@@ -22,3 +22,5 @@ function(ly_copy source_file target_directory)
endfunction()
@LY_COPY_COMMANDS@
file(TOUCH @STAMP_OUTPUT_FILE@)
+6 -1
View File
@@ -14,12 +14,17 @@ function(ly_copy source_file target_directory)
if("${source_file}" MATCHES "qt/plugins" AND "${target_filename_ext}" STREQUAL ".so")
get_filename_component(target_filename "${source_file}" NAME)
file(RPATH_CHANGE FILE "${target_directory}/${target_filename}" OLD_RPATH "\$ORIGIN/../../lib" NEW_RPATH "\$ORIGIN/..")
elseif("${source_file}" MATCHES "lrelease")
get_filename_component(target_filename "${source_file}" NAME)
file(RPATH_CHANGE FILE "${target_directory}/${target_filename}" OLD_RPATH "\$ORIGIN/../lib" NEW_RPATH "\$ORIGIN")
endif()
endfunction()]])
function(ly_install_code_function_override)
string(CONFIGURE "${ly_copy_template}" ly_copy_function_linux @ONLY)
install(CODE "${ly_copy_function_linux}")
install(CODE "${ly_copy_function_linux}"
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
)
endfunction()
include(cmake/Platform/Common/Install_common.cmake)
+8 -8
View File
@@ -42,8 +42,6 @@ function(ly_install_target_override)
set(multiValueArgs)
cmake_parse_arguments(ly_platform_install_target "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
get_property(install_component TARGET ${ly_platform_install_target_TARGET} PROPERTY INSTALL_COMPONENT)
# For bundles on Mac, we set the icons by passing in a path to the Images.xcassets directory.
# However, the CMake install command expects paths to files for the the RESOURCE property.
# More details can be found in the CMake issue: https://gitlab.kitware.com/cmake/cmake/-/issues/22409
@@ -57,19 +55,19 @@ function(ly_install_target_override)
TARGETS ${ly_platform_install_target_TARGET}
ARCHIVE
DESTINATION ${ly_platform_install_target_ARCHIVE_DIR}/${PAL_PLATFORM_NAME}/$<CONFIG>
COMPONENT ${install_component}
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
LIBRARY
DESTINATION ${ly_platform_install_target_LIBRARY_DIR}/${PAL_PLATFORM_NAME}/$<CONFIG>/${ly_platform_install_target_LIBRARY_SUBDIR}
COMPONENT ${install_component}
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
RUNTIME
DESTINATION ${ly_platform_install_target_RUNTIME_DIR}/${PAL_PLATFORM_NAME}/$<CONFIG>/${ly_platform_install_target_RUNTIME_SUBDIR}
COMPONENT ${install_component}
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
BUNDLE
DESTINATION ${ly_platform_install_target_RUNTIME_DIR}/${PAL_PLATFORM_NAME}/$<CONFIG>/${ly_platform_install_target_RUNTIME_SUBDIR}
COMPONENT ${install_component}
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
RESOURCE
DESTINATION ${ly_platform_install_target_RUNTIME_DIR}/${PAL_PLATFORM_NAME}/$<CONFIG>/${ly_platform_install_target_RUNTIME_SUBDIR}/
COMPONENT ${install_component}
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
)
if (${is_bundle})
@@ -95,7 +93,9 @@ function(ly_install_code_function_override)
endif()
file(COPY \"\${source_file}\" DESTINATION \"\${target_directory}\" FILE_PERMISSIONS ${LY_COPY_PERMISSIONS})
endfunction()")
endfunction()"
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
)
endfunction()
+18 -34
View File
@@ -53,7 +53,7 @@ function(ly_add_target_dependencies)
# Append the DEPENDENT_TARGETS to the list of ALL_GEM_DEPENDENCIES
list(APPEND ALL_GEM_DEPENDENCIES ${ly_add_gem_dependencies_DEPENDENT_TARGETS})
# for each target, add the dependencies and generate gems json
# for each target, add the dependencies and generate setreg json with the list of gems to load
foreach(target ${ly_add_gem_dependencies_TARGETS})
ly_add_dependencies(${target} ${ALL_GEM_DEPENDENCIES})
@@ -69,39 +69,6 @@ function(ly_add_target_dependencies)
endforeach()
endfunction()
#! ly_add_project_dependencies: adds the dependencies to runtime and tools for this project.
#
# Each project may have dependencies to gems. To properly define these dependencies, we are making the project to define
# through a "files list" cmake file the dependencies to the different targets.
# So for example, the game's runtime dependencies are associated to the project's launcher; the game's tools dependencies
# are associated to the asset processor; etc
#
# \arg:PROJECT_NAME name of the game project
# \arg:TARGETS names of the targets to associate the dependencies to
# \arg:DEPENDENCIES_FILES file(s) that contains the runtime dependencies the TARGETS will be associated to
# \arg:DEPENDENT_TARGETS additional list of targets should be added as load-time dependencies for the TARGETS list
#
function(ly_add_project_dependencies)
set(options)
set(oneValueArgs PROJECT_NAME)
set(multiValueArgs TARGETS DEPENDENCIES_FILES DEPENDENT_TARGETS)
cmake_parse_arguments(ly_add_project_dependencies "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
# Validate input arguments
if(NOT ly_add_project_dependencies_PROJECT_NAME)
message(FATAL_ERROR "PROJECT_NAME parameter missing. If not project name is needed, then call ly_add_target_dependencies directly")
endif()
ly_add_target_dependencies(
PREFIX ${ly_add_project_dependencies_PROJECT_NAME}
TARGETS ${ly_add_project_dependencies_TARGETS}
DEPENDENCIES_FILES ${ly_add_project_dependencies_DEPENDENCIES_FILES}
DEPENDENT_TARGETS ${ly_add_project_dependencies_DEPENDENT_TARGETS}
)
endfunction()
#template for generating the project build_path setreg
set(project_build_path_template [[
@@ -175,6 +142,23 @@ foreach(project ${LY_PROJECTS})
add_subdirectory(${project} "${project_folder_name}-${full_directory_hash}")
ly_generate_project_build_path_setreg(${full_directory_path})
add_project_json_external_subdirectories(${full_directory_path})
# Generate pak for project in release installs
cmake_path(RELATIVE_PATH CMAKE_RUNTIME_OUTPUT_DIRECTORY BASE_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_VARIABLE runtime_output_directory)
set(install_engine_pak_template [=[
if("${CMAKE_INSTALL_CONFIG_NAME}" MATCHES "^([Rr][Ee][Ll][Ee][Aa][Ss][Ee])$")
set(install_output_folder "${CMAKE_INSTALL_PREFIX}/@runtime_output_directory@/@PAL_PLATFORM_NAME@/${CMAKE_INSTALL_CONFIG_NAME}")
message(STATUS "Generating ${install_output_folder}/Engine.pak from @full_directory_path@/Cache")
file(ARCHIVE_CREATE OUTPUT ${install_output_folder}/Engine.pak
PATHS @full_directory_path@/Cache
FORMAT zip
)
message(STATUS "${install_output_folder}/Engine.pak generated")
endif()
]=])
string(CONFIGURE "${install_engine_pak_template}" install_engine_pak_code @ONLY)
ly_install_run_code("${install_engine_pak_code}")
endforeach()
# If just one project is defined we pass it as a parameter to the applications
+18 -7
View File
@@ -28,7 +28,7 @@ set(gems_json_template [[
string(APPEND gem_module_template
[=[ "@stripped_gem_target@":]=] "\n"
[=[ {]=] "\n"
[=[$<$<NOT:$<IN_LIST:$<TARGET_PROPERTY:@gem_target@,TYPE>,INTERFACE_LIBRARY>>: "Modules":["$<TARGET_FILE_NAME:@gem_target@>"]]=] "$<COMMA>\n>"
[=[$<$<IN_LIST:$<TARGET_PROPERTY:@gem_target@,TYPE>,MODULE_LIBRARY$<SEMICOLON>SHARED_LIBRARY>: "Modules":["$<TARGET_FILE_NAME:@gem_target@>"]]=] "$<COMMA>\n>"
[=[ "SourcePaths":["@gem_module_root_relative_to_engine_root@"]]=] "\n"
[=[ }]=]
)
@@ -87,7 +87,7 @@ endfunction()
#
# \arg:gem_target(TARGET) - Target to look upwards from using its SOURCE_DIR property
function(ly_get_gem_module_root output_gem_module_root gem_target)
unset(gem_module_roots)
unset(${output_gem_module_root} PARENT_SCOPE)
get_property(gem_source_dir TARGET ${gem_target} PROPERTY SOURCE_DIR)
if(gem_source_dir)
@@ -96,8 +96,8 @@ function(ly_get_gem_module_root output_gem_module_root gem_target)
while(NOT EXISTS ${candidate_gem_dir}/gem.json)
get_filename_component(parent_dir ${candidate_gem_dir} DIRECTORY)
if (${parent_dir} STREQUAL ${candidate_gem_dir})
message(WARNING "Did not find a gem.json while processing GEM_MODULE target ${gem_target}!")
break()
# "Did not find a gem.json while processing GEM_MODULE target ${gem_target}!"
return()
endif()
set(candidate_gem_dir ${parent_dir})
endwhile()
@@ -118,6 +118,12 @@ endfunction()
# The generated file contains the file to the each dependent targets
# This can be used for example to determine which list of gems to load with an application
function(ly_delayed_generate_settings_registry)
if(LY_MONOLITHIC_GAME) # No need to generate setregs for monolithic builds
set_property(GLOBAL PROPERTY LY_DELAYED_LOAD_DEPENDENCIES) # Clear out the load targets from the global load dependencies list
return()
endif()
get_property(ly_delayed_load_targets GLOBAL PROPERTY LY_DELAYED_LOAD_DEPENDENCIES)
foreach(prefix_target ${ly_delayed_load_targets})
string(REPLACE "," ";" prefix_target_list "${prefix_target}")
@@ -160,11 +166,15 @@ function(ly_delayed_generate_settings_registry)
endif()
ly_get_gem_module_root(gem_module_root ${gem_target})
if (NOT gem_module_root)
# If the target doesn't have a gem.json, skip it
continue()
endif()
file(RELATIVE_PATH gem_module_root_relative_to_engine_root ${LY_ROOT_FOLDER} ${gem_module_root})
# De-alias namespace from gem targets before configuring them into the json template
ly_de_alias_target(${gem_target} stripped_gem_target)
string(CONFIGURE ${gem_module_template} gem_module_json @ONLY)
string(CONFIGURE "${gem_module_template}" gem_module_json @ONLY)
list(APPEND target_gem_dependencies_names ${gem_module_json})
endforeach()
@@ -177,7 +187,8 @@ function(ly_delayed_generate_settings_registry)
string(CONFIGURE ${gems_json_template} gem_json @ONLY)
get_target_property(is_imported ${target} IMPORTED)
get_target_property(target_type ${target} TYPE)
if(is_imported OR target_type STREQUAL UTILITY)
set(non_loadable_types "UTILITY" "INTERFACE_LIBRARY" "STATIC_LIBRARY")
if(is_imported OR (target_type IN_LIST non_loadable_types))
unset(target_dir)
foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES)
string(TOUPPER ${conf} UCONF)
@@ -196,7 +207,7 @@ function(ly_delayed_generate_settings_registry)
set_property(GLOBAL PROPERTY LY_DELAYED_LOAD_"${prefix_target}")
endforeach()
# Clear out the load targets from the glboal load dependencies list
# Clear out the load targets from the global load dependencies list
set_property(GLOBAL PROPERTY LY_DELAYED_LOAD_DEPENDENCIES)
endfunction()
+2
View File
@@ -15,6 +15,8 @@ ly_add_target(
@INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER@
RUNTIME_DEPENDENCIES
@RUNTIME_DEPENDENCIES_PLACEHOLDER@
TARGET_PROPERTIES
@TARGET_PROPERTIES_PLACEHOLDER@
)
@TARGET_RUN_HELPER@