123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289 |
- #
- # 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
- #
- #
- if(NOT PAL_TRAIT_BUILD_HOST_TOOLS)
- return()
- endif()
- # Builders need to be defined first because we collect the builders and pass them
- # to AssetBuilder and AssetProcessor so it loads them.
- add_subdirectory(AssetBuilderSDK)
- add_subdirectory(AssetBuilder)
- ly_add_target(
- NAME AssetProcessor.Static STATIC
- NAMESPACE AZ
- AUTOMOC
- AUTORCC
- FILES_CMAKE
- assetprocessor_static_files.cmake
- Platform/${PAL_PLATFORM_NAME}/assetprocessor_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
- INCLUDE_DIRECTORIES
- PUBLIC
- .
- Platform/${PAL_PLATFORM_NAME}
- PRIVATE
- native
- BUILD_DEPENDENCIES
- PUBLIC
- 3rdParty::Qt::Core
- 3rdParty::Qt::Gui
- 3rdParty::Qt::Network
- 3rdParty::RapidJSON
- 3rdParty::SQLite
- 3rdParty::xxhash
- AZ::AzCore
- AZ::AzFramework
- AZ::AzQtComponents
- AZ::AzToolsFramework
- AZ::AssetBuilderSDK
- AZ::AssetBuilder.Static
- ${additional_dependencies}
- )
- # Aggregates all combined AssetBuilders into a single LY_ASSET_BUILDERS #define
- get_property(asset_builders GLOBAL PROPERTY LY_ASSET_BUILDERS)
- string (REPLACE ";" "," asset_builders "${asset_builders}")
- ly_add_source_properties(
- SOURCES native/utilities/ApplicationManager.cpp
- PROPERTY COMPILE_DEFINITIONS
- VALUES LY_ASSET_BUILDERS="${asset_builders}"
- )
- ly_add_target(
- NAME AssetProcessor APPLICATION
- NAMESPACE AZ
- AUTOMOC
- AUTOUIC
- AUTORCC
- FILES_CMAKE
- assetprocessor_gui_files.cmake
- Platform/${PAL_PLATFORM_NAME}/assetprocessor_gui_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
- PLATFORM_INCLUDE_FILES
- Platform/${PAL_PLATFORM_NAME}/assetprocessor_${PAL_PLATFORM_NAME_LOWERCASE}.cmake
- INCLUDE_DIRECTORIES
- PUBLIC
- .
- PRIVATE
- native
- BUILD_DEPENDENCIES
- PRIVATE
- AZ::AssetProcessor.Static
- RUNTIME_DEPENDENCIES
- AZ::AssetBuilder
- )
- # Adds the AssetProcessor target as a C preprocessor define so that it can be used as a Settings Registry
- # specialization in order to look up the generated .setreg which contains the dependencies
- # specified for the target.
- if(TARGET AssetProcessor)
- ly_set_gem_variant_to_load(TARGETS AssetProcessor VARIANTS Builders)
- set_source_files_properties(
- native/AssetProcessorBuildTarget.cpp
- PROPERTIES
- COMPILE_DEFINITIONS
- LY_CMAKE_TARGET="AssetProcessor"
- )
- else()
- message(FATAL_ERROR "Cannot set LY_CMAKE_TARGET define to AssetProcessor as the target doesn't exist anymore."
- " Perhaps it has been renamed")
- endif()
- ly_add_target(
- NAME AssetProcessorBatch.Static STATIC
- NAMESPACE AZ
- AUTOMOC
- FILES_CMAKE
- assetprocessor_static_batch_files.cmake
- INCLUDE_DIRECTORIES
- PUBLIC
- .
- PRIVATE
- native
- BUILD_DEPENDENCIES
- PUBLIC
- AZ::AssetProcessor.Static
- )
- ly_add_target(
- NAME AssetProcessorBatch EXECUTABLE
- NAMESPACE AZ
- AUTOMOC
- FILES_CMAKE
- assetprocessor_batch_files.cmake
- INCLUDE_DIRECTORIES
- PRIVATE
- .
- native
- BUILD_DEPENDENCIES
- PRIVATE
- AZ::AssetProcessorBatch.Static
- RUNTIME_DEPENDENCIES
- AZ::AssetBuilder
- )
- if(LY_DEFAULT_PROJECT_PATH)
- set_property(TARGET AssetProcessor AssetProcessorBatch APPEND PROPERTY VS_DEBUGGER_COMMAND_ARGUMENTS "--project-path=\"${LY_DEFAULT_PROJECT_PATH}\"")
- endif()
- # Adds the AssetProcessorBatch target as a C preprocessor define so that it can be used as a Settings Registry
- # specialization in order to look up the generated .setreg which contains the dependencies
- # specified for the target.
- if(TARGET AssetProcessorBatch)
- ly_set_gem_variant_to_load(TARGETS AssetProcessorBatch VARIANTS Builders)
- set_source_files_properties(
- native/AssetProcessorBatchBuildTarget.cpp
- PROPERTIES
- COMPILE_DEFINITIONS
- LY_CMAKE_TARGET="AssetProcessorBatch"
- )
- else()
- message(FATAL_ERROR "Cannot set LY_CMAKE_TARGET define to AssetProcessorBatch as the target doesn't exist anymore."
- " Perhaps it has been renamed")
- endif()
- ################################################################################
- # Tests
- ################################################################################
- if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
- ly_add_target(
- NAME AssetProcessor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
- NAMESPACE AZ
- AUTOMOC
- AUTORCC
- FILES_CMAKE
- assetprocessor_test_files.cmake
- INCLUDE_DIRECTORIES
- PRIVATE
- native
- .
- BUILD_DEPENDENCIES
- PRIVATE
- AZ::AzTest
- AZ::AssetProcessorBatch.Static
- AZ::AzToolsFrameworkTestCommon
- )
- ly_add_source_properties(
- SOURCES native/tests/assetBuilderSDK/assetBuilderSDKTest.cpp
- PROPERTY COMPILE_DEFINITIONS
- VALUES ${LY_PAL_TOOLS_DEFINES}
- )
- ly_add_source_properties(
- SOURCES native/unittests/AssetProcessorManagerUnitTests.cpp
- PROPERTY COMPILE_DEFINITIONS
- VALUES LY_CMAKE_BINARY_DIR="${CMAKE_BINARY_DIR}"
- )
- ly_add_target_files(
- TARGETS
- AssetProcessor.Tests
- FILES
- ${CMAKE_CURRENT_SOURCE_DIR}/testdata/config_broken_badplatform/AssetProcessorPlatformConfig.setreg
- OUTPUT_SUBDIRECTORY
- testdata/config_broken_badplatform
- )
- ly_add_target_files(
- TARGETS
- AssetProcessor.Tests
- FILES
- ${CMAKE_CURRENT_SOURCE_DIR}/testdata/config_broken_noscans/AssetProcessorPlatformConfig.setreg
- OUTPUT_SUBDIRECTORY
- testdata/config_broken_noscans
- )
- ly_add_target_files(
- TARGETS
- AssetProcessor.Tests
- FILES
- ${CMAKE_CURRENT_SOURCE_DIR}/testdata/config_broken_recognizers/AssetProcessorPlatformConfig.setreg
- OUTPUT_SUBDIRECTORY
- testdata/config_broken_recognizers
- )
- ly_add_target_files(
- TARGETS
- AssetProcessor.Tests
- FILES
- ${CMAKE_CURRENT_SOURCE_DIR}/testdata/config_broken_noplatform/AssetProcessorPlatformConfig.setreg
- OUTPUT_SUBDIRECTORY
- testdata/config_broken_noplatform
- )
- ly_add_target_files(
- TARGETS
- AssetProcessor.Tests
- FILES
- ${CMAKE_CURRENT_SOURCE_DIR}/testdata/config_regular/AssetProcessorPlatformConfig.setreg
- OUTPUT_SUBDIRECTORY
- testdata/config_regular
- )
- ly_add_target_files(
- TARGETS
- AssetProcessor.Tests
- FILES
- ${CMAKE_CURRENT_SOURCE_DIR}/testdata/config_regular_platform_scanfolder/AssetProcessorPlatformConfig.setreg
- OUTPUT_SUBDIRECTORY
- testdata/config_regular_platform_scanfolder
- )
- ly_add_target_files(
- TARGETS
- AssetProcessor.Tests
- FILES
- ${CMAKE_CURRENT_SOURCE_DIR}/testdata/EmptyDummyProject/AssetProcessorGamePlatformConfig.setreg
- OUTPUT_SUBDIRECTORY
- testdata/EmptyDummyProject
- )
- ly_add_target_files(
- TARGETS
- AssetProcessor.Tests
- FILES
- ${CMAKE_CURRENT_SOURCE_DIR}/testdata/DummyProject/AssetProcessorGamePlatformConfig.setreg
- OUTPUT_SUBDIRECTORY
- testdata/DummyProject
- )
- ly_add_target_files(
- TARGETS
- AssetProcessor.Tests
- FILES
- ${CMAKE_CURRENT_SOURCE_DIR}/testdata/config_metadata/AssetProcessorPlatformConfig.setreg
- OUTPUT_SUBDIRECTORY
- testdata/config_metadata
- )
- # Have the AssetProcessorTest use the LY_CMAKE_TARGET define of AssetProcessorBatch for the purpose
- # of looking up the generated cmake build dependencies settings registry .setreg file
- # It is tied to the UnitTestUtils.cpp file
- if(TARGET AssetProcessorBatch)
- set_source_files_properties(
- native/unittests/UnitTestUtils.cpp
- PROPERTIES
- COMPILE_DEFINITIONS
- LY_CMAKE_TARGET="AssetProcessorBatch"
- )
- else()
- message(FATAL_ERROR "Cannot set LY_CMAKE_TARGET define to AssetProcessorBatch as the target doesn't exist anymore."
- " Perhaps it has been renamed")
- endif()
- # there are some tests in the main suite, and some in periodic.
- ly_add_googletest(
- NAME AZ::AssetProcessor.Tests
- LABELS REQUIRES_tiaf
- )
- ly_add_googletest(NAME AZ::AssetProcessor.Tests.Periodic
- TARGET AZ::AssetProcessor.Tests
- TEST_SUITE periodic)
- # Sandbox the tests that fail intermittently
- ly_add_googletest(NAME AZ::AssetProcessor.Tests.Sandbox
- TARGET AZ::AssetProcessor.Tests
- TEST_SUITE sandbox)
- ly_add_googlebenchmark(
- NAME AZ::AssetProcessor.Benchmarks
- TARGET AZ::AssetProcessor.Tests
- )
- endif()
|