c778606c89
* Templates/Restricted upgrade/fixes: Fixed template storage format: templates now only store true relative paths and no longer save "origin" paths and "optional" has been removed, it was never used. Upgraded all templates to new standard Template system now correctly handles child objects: Child objects no longer have to specify restricted they inherit from parent Restricted now operates at the object level and makes no assumptions about parent Restricted templates can now be combined and seperated on creation ly_get_list_relative_filename has been deprecated for o3de_pal_dir All Gems/Projects/Templates updated to use new code Signed-off-by: byrcolin <byrcolin@amazon.com>
50 lines
2.2 KiB
CMake
50 lines
2.2 KiB
CMake
#
|
|
# 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
|
|
#
|
|
#
|
|
|
|
# PlatformTools enables to deal with tools that perform functionality cross-platform
|
|
# For example, the AssetProcessor can generate assets for other platforms. For the
|
|
# asset processor to be able to provide that, it requires to have the funcionality enabled.
|
|
# This cmake file provides an entry point to discover variables that will allow to enable
|
|
# the different platforms and variables that can be passed to enable those platforms to the
|
|
# code.
|
|
|
|
# Discover all the platforms that are available
|
|
|
|
set(LY_PAL_TOOLS_DEFINES)
|
|
file(GLOB pal_tools_files "cmake/Platform/*/PALTools_*.cmake")
|
|
foreach(pal_tools_file ${pal_tools_files})
|
|
include(${pal_tools_file})
|
|
endforeach()
|
|
file(GLOB pal_restricted_tools_files "restricted/*/cmake/PALTools_*.cmake")
|
|
foreach(pal_restricted_tools_file ${pal_restricted_tools_files})
|
|
include(${pal_restricted_tools_file})
|
|
endforeach()
|
|
|
|
# Set the AZ_TOOLS_EXPAND_FOR_RESTRICTED_PLATFORMS macro using the aggregate of all the LY_PAL_TOOLS_RESTRICTED_PLATFORM_DEFINES variable
|
|
if(LY_PAL_TOOLS_RESTRICTED_PLATFORM_DEFINES)
|
|
list(JOIN LY_PAL_TOOLS_RESTRICTED_PLATFORM_DEFINES " " RESTRICTED_PLATFORM_DEFINES_MACRO)
|
|
list(APPEND LY_PAL_TOOLS_DEFINES "AZ_TOOLS_EXPAND_FOR_RESTRICTED_PLATFORMS=${RESTRICTED_PLATFORM_DEFINES_MACRO}")
|
|
endif()
|
|
ly_set(LY_PAL_TOOLS_DEFINES ${LY_PAL_TOOLS_DEFINES})
|
|
|
|
# Include files to the CMakeFiles project
|
|
foreach(enabled_platform ${LY_PAL_TOOLS_ENABLED})
|
|
string(TOLOWER ${enabled_platform} enabled_platform_lowercase)
|
|
o3de_pal_dir(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${enabled_platform})
|
|
ly_include_cmake_file_list(${pal_dir}/pal_tools_${enabled_platform_lowercase}_files.cmake)
|
|
endforeach()
|
|
|
|
function(ly_get_pal_tool_dirs out_list pal_path)
|
|
set(pal_paths "")
|
|
foreach(platform ${LY_PAL_TOOLS_ENABLED})
|
|
o3d_pal_dir(path ${pal_path}/${platform} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER})
|
|
list(APPEND pal_paths ${path})
|
|
endforeach()
|
|
set(${out_list} ${pal_paths} PARENT_SCOPE)
|
|
endfunction()
|