Merge branch 'stabilization/2106' into daimini/gitflow_210716_o3de
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> # Conflicts: # scripts/build/bootstrap/incremental_build_util.py
This commit is contained in:
@@ -529,6 +529,12 @@ function(ly_force_download_package package_name)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf ${temp_download_target}
|
||||
WORKING_DIRECTORY ${final_folder} COMMAND_ECHO STDOUT OUTPUT_VARIABLE unpack_result)
|
||||
|
||||
# For the runtime dependencies cases, we need the timestamps of the files coming from 3rdParty to be newer than the ones
|
||||
# from the output so the new versions get copied over. The untar from the previous step preserves timestamps so they
|
||||
# can produce binaries with older timestamps to the ones that are in the build output.
|
||||
file(GLOB_RECURSE package_files LIST_DIRECTORIES false ${final_folder}/*)
|
||||
file(TOUCH_NOCREATE ${package_files})
|
||||
|
||||
if (NOT ${unpack_result} EQUAL 0)
|
||||
message(SEND_ERROR "ly_package: required package {package_name} could not be unpacked. Compile may fail! Enable LY_PACKAGE_DEBUG to debug.")
|
||||
return()
|
||||
|
||||
@@ -124,3 +124,42 @@ function(ly_file_read path content)
|
||||
set(${content} ${file_content} PARENT_SCOPE)
|
||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${path})
|
||||
endfunction()
|
||||
|
||||
|
||||
#! ly_get_last_path_segment_concat_sha256 : Concatenates the last path segment of the absolute path
|
||||
# with the first 8 characters of the absolute path SHA256 hash to make a unique relative path segment
|
||||
function(ly_get_last_path_segment_concat_sha256 absolute_path output_path)
|
||||
string(SHA256 target_source_hash ${absolute_path})
|
||||
string(SUBSTRING ${target_source_hash} 0 8 target_source_hash)
|
||||
cmake_path(GET absolute_path FILENAME last_path_segment)
|
||||
cmake_path(SET last_path_segment_sha256_path "${last_path_segment}-${target_source_hash}")
|
||||
|
||||
set(${output_path} ${last_path_segment_sha256_path} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
#! ly_get_engine_relative_source_dir: Attempts to form a path relative to the BASE_DIRECTORY.
|
||||
# If that fails the last path segment of the absolute_target_source_dir concatenated with a SHA256 hash to form a target directory
|
||||
# \arg:BASE_DIRECTORY - Directory to base relative path against. Defaults to LY_ROOT_FOLDER
|
||||
function(ly_get_engine_relative_source_dir absolute_target_source_dir output_source_dir)
|
||||
|
||||
set(options)
|
||||
set(oneValueArgs BASE_DIRECTORY)
|
||||
set(multiValueArgs)
|
||||
cmake_parse_arguments(ly_get_engine_relative_source_dir "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
if(NOT ly_get_engine_relative_source_dir_BASE_DIRECTORY)
|
||||
set(ly_get_engine_relative_source_dir_BASE_DIRECTORY ${LY_ROOT_FOLDER})
|
||||
endif()
|
||||
|
||||
# Get a relative target source directory to the LY root folder if possible
|
||||
# Otherwise use the final component name
|
||||
cmake_path(IS_PREFIX LY_ROOT_FOLDER ${absolute_target_source_dir} is_target_source_dir_subdirectory_of_engine)
|
||||
if(is_target_source_dir_subdirectory_of_engine)
|
||||
cmake_path(RELATIVE_PATH absolute_target_source_dir BASE_DIRECTORY ${LY_ROOT_FOLDER} OUTPUT_VARIABLE relative_target_source_dir)
|
||||
else()
|
||||
ly_get_last_path_segment_concat_sha256(${absolute_target_source_dir} target_source_dir_last_path_segment)
|
||||
unset(relative_target_source_dir)
|
||||
cmake_path(APPEND relative_target_source_dir "External" ${target_source_dir_last_path_segment})
|
||||
endif()
|
||||
|
||||
set(${output_source_dir} ${relative_target_source_dir} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
@@ -90,6 +90,13 @@ function(ly_create_alias)
|
||||
# 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}")
|
||||
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
|
||||
# in the layout install logic. Skip if the directory has already been added
|
||||
get_property(ly_all_target_directories GLOBAL PROPERTY LY_ALL_TARGET_DIRECTORIES)
|
||||
if(NOT CMAKE_CURRENT_SOURCE_DIR IN_LIST ly_all_target_directories)
|
||||
set_property(GLOBAL APPEND PROPERTY LY_ALL_TARGET_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# ly_enable_gems
|
||||
|
||||
+23
-28
@@ -125,37 +125,32 @@ install(FILES ${_cmake_package_dest}
|
||||
DESTINATION ./Tools/Redistributables/CMake
|
||||
)
|
||||
|
||||
# temporary workaround for acquiring the 3rd party SPDX license manifest, the desired location is from
|
||||
# another git repository that's private. once it's public, only how the URL is formed should change
|
||||
set(LY_INSTALLER_3RD_PARTY_LICENSE_URL "" CACHE STRING "URL to the 3rd party SPDX license manifest file for inclusion in packaging.")
|
||||
# the version string and git tags are intended to be synchronized so it should be safe to use that instead
|
||||
# of directly calling into git which could get messy in certain scenarios
|
||||
if(${CPACK_PACKAGE_VERSION} VERSION_GREATER "0.0.0.0")
|
||||
set(_3rd_party_license_filename SPDX-Licenses.txt)
|
||||
|
||||
if(${LY_VERSION_STRING} VERSION_GREATER "0.0.0.0" AND NOT LY_INSTALLER_3RD_PARTY_LICENSE_URL)
|
||||
message(FATAL_ERROR "Missing required URL for the 3rd party SPDX license manifest file. "
|
||||
"Please specifiy where to acquire the file via LY_INSTALLER_3RD_PARTY_LICENSE_URL")
|
||||
endif()
|
||||
set(_3rd_party_license_url "https://raw.githubusercontent.com/o3de/3p-package-source/${CPACK_PACKAGE_VERSION}/${_3rd_party_license_filename}")
|
||||
set(_3rd_party_license_dest ${CPACK_BINARY_DIR}/${_3rd_party_license_filename})
|
||||
|
||||
string(REPLACE "/" ";" _url_components ${LY_INSTALLER_3RD_PARTY_LICENSE_URL})
|
||||
list(POP_BACK _url_components _3rd_party_license_filename)
|
||||
|
||||
set(_3rd_party_license_dest ${CPACK_BINARY_DIR}/${_3rd_party_license_filename})
|
||||
|
||||
# use the plain file downloader as we don't have the file hash available and using a dummy will
|
||||
# delete the file once it fails hash verification
|
||||
file(DOWNLOAD
|
||||
${LY_INSTALLER_3RD_PARTY_LICENSE_URL}
|
||||
${_3rd_party_license_dest}
|
||||
STATUS _status
|
||||
TLS_VERIFY ON
|
||||
)
|
||||
list(POP_FRONT _status _status_code)
|
||||
|
||||
if (${_status_code} EQUAL 0 AND EXISTS ${_3rd_party_license_dest})
|
||||
install(FILES ${_3rd_party_license_dest}
|
||||
DESTINATION .
|
||||
# use the plain file downloader as we don't have the file hash available and using a dummy will
|
||||
# delete the file once it fails hash verification
|
||||
file(DOWNLOAD
|
||||
${_3rd_party_license_url}
|
||||
${_3rd_party_license_dest}
|
||||
STATUS _status
|
||||
TLS_VERIFY ON
|
||||
)
|
||||
else()
|
||||
file(REMOVE ${_3rd_party_license_dest})
|
||||
message(FATAL_ERROR "Failed to acquire the 3rd Party license manifest file. Error: ${_status}")
|
||||
list(POP_FRONT _status _status_code)
|
||||
|
||||
if (${_status_code} EQUAL 0 AND EXISTS ${_3rd_party_license_dest})
|
||||
install(FILES ${_3rd_party_license_dest}
|
||||
DESTINATION .
|
||||
)
|
||||
else()
|
||||
file(REMOVE ${_3rd_party_license_dest})
|
||||
message(FATAL_ERROR "Failed to acquire the 3rd Party license manifest file at ${_3rd_party_license_url}. Error: ${_status}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# checks for and removes trailing slash
|
||||
|
||||
@@ -9,6 +9,7 @@ SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
<PropertyGroup>
|
||||
<UseMultiToolTask>true</UseMultiToolTask>
|
||||
<EnforceProcessCountAcrossBuilds>true</EnforceProcessCountAcrossBuilds>
|
||||
@VCPKG_CONFIGURATION_MAPPING@
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#
|
||||
#
|
||||
|
||||
include(cmake/FileUtil.cmake)
|
||||
|
||||
set(CMAKE_INSTALL_MESSAGE NEVER) # Simplify messages to reduce output noise
|
||||
|
||||
ly_set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME Core)
|
||||
@@ -18,26 +20,6 @@ cmake_path(RELATIVE_PATH CMAKE_LIBRARY_OUTPUT_DIRECTORY BASE_DIRECTORY ${CMAKE_B
|
||||
set(install_output_folder "\${CMAKE_INSTALL_PREFIX}/${runtime_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>")
|
||||
|
||||
|
||||
function(ly_get_engine_relative_source_dir absolute_target_source_dir output_source_dir)
|
||||
# Get a relative target source directory to the LY root folder if possible
|
||||
# Otherwise use the final component name
|
||||
cmake_path(IS_PREFIX LY_ROOT_FOLDER ${absolute_target_source_dir} is_target_prefix_of_engine_root)
|
||||
if(is_target_prefix_of_engine_root)
|
||||
cmake_path(RELATIVE_PATH absolute_target_source_dir BASE_DIRECTORY ${LY_ROOT_FOLDER} OUTPUT_VARIABLE relative_target_source_dir)
|
||||
else()
|
||||
# In this case the target source directory is outside of the engine root of the target source directory and concatenate the first
|
||||
# is used first 8 characters of the absolute path SHA256 hash to make a unique relative directory
|
||||
# that can be used to install the generated CMakeLists.txt
|
||||
# of a SHA256 hash
|
||||
string(SHA256 target_source_hash ${absolute_target_source_dir})
|
||||
string(SUBSTRING ${target_source_hash} 0 8 target_source_hash)
|
||||
cmake_path(GET absolute_target_source_dir FILENAME target_source_dirname)
|
||||
cmake_path(SET relative_target_source_dir "${target_source_dirname}-${target_source_hash}")
|
||||
endif()
|
||||
|
||||
set(${output_source_dir} ${relative_target_source_dir} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
#! ly_setup_target: Setup the data needed to re-create the cmake target commands for a single target
|
||||
function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_target_source_dir)
|
||||
# De-alias target name
|
||||
@@ -265,7 +247,6 @@ endfunction()
|
||||
|
||||
#! ly_setup_subdirectory: setup all targets in the subdirectory
|
||||
function(ly_setup_subdirectory absolute_target_source_dir)
|
||||
# Get the target source directory relative to the LY roo folder
|
||||
ly_get_engine_relative_source_dir(${absolute_target_source_dir} relative_target_source_dir)
|
||||
|
||||
# The builtin BUILDSYSTEM_TARGETS property isn't being used here as that returns the de-alised
|
||||
@@ -559,56 +540,74 @@ function(ly_setup_others)
|
||||
)
|
||||
# Exclude transient artifacts that shouldn't be copied to the install layout
|
||||
list(FILTER external_subdir_files EXCLUDE REGEX "/([Bb]uild|[Cc]ache|[Uu]ser)$")
|
||||
list(APPEND filtered_asset_paths ${external_subdir_files})
|
||||
# Storing a "mapping" of gem candidate directories, to external_subdirectory files using
|
||||
# a DIRECTORY property for the "value" and the GLOBAL property for the "key"
|
||||
set_property(DIRECTORY ${gem_candidate_dir} APPEND PROPERTY directory_filtered_asset_paths "${external_subdir_files}")
|
||||
set_property(GLOBAL APPEND PROPERTY global_gem_candidate_dirs_prop ${gem_candidate_dir})
|
||||
endforeach()
|
||||
|
||||
# At this point the filtered_assets_paths contains the list of all directories and files
|
||||
# that are non-excluded candidates that can be scanned for target directories and files
|
||||
# to copy over to the install layout
|
||||
foreach(filtered_asset_path IN LISTS filtered_asset_paths)
|
||||
if(IS_DIRECTORY ${filtered_asset_path})
|
||||
file(GLOB_RECURSE
|
||||
recurse_assets_paths
|
||||
LIST_DIRECTORIES TRUE
|
||||
"${filtered_asset_path}/*"
|
||||
)
|
||||
set(gem_file_paths ${recurse_assets_paths})
|
||||
# Make sure to prepend the current path iteration to the gem_dirs_path to filter
|
||||
set(gem_dir_paths ${filtered_asset_path} ${recurse_assets_paths})
|
||||
# Iterate over each gem candidate directories and read populate a directory property
|
||||
# containing the files to copy over
|
||||
get_property(gem_candidate_dirs GLOBAL PROPERTY global_gem_candidate_dirs_prop)
|
||||
foreach(gem_candidate_dir IN LISTS gem_candidate_dirs)
|
||||
get_property(filtered_asset_paths DIRECTORY ${gem_candidate_dir} PROPERTY directory_filtered_asset_paths)
|
||||
ly_get_last_path_segment_concat_sha256(${gem_candidate_dir} last_gem_root_path_segment)
|
||||
# Check if the gem is a subdirectory of the engine
|
||||
cmake_path(IS_PREFIX LY_ROOT_FOLDER ${gem_candidate_dir} is_gem_subdirectory_of_engine)
|
||||
|
||||
# At this point the filtered_assets_paths contains the list of all directories and files
|
||||
# that are non-excluded candidates that can be scanned for target directories and files
|
||||
# to copy over to the install layout
|
||||
foreach(filtered_asset_path IN LISTS filtered_asset_paths)
|
||||
if(IS_DIRECTORY ${filtered_asset_path})
|
||||
file(GLOB_RECURSE
|
||||
recurse_assets_paths
|
||||
LIST_DIRECTORIES TRUE
|
||||
"${filtered_asset_path}/*"
|
||||
)
|
||||
set(gem_file_paths ${recurse_assets_paths})
|
||||
# Make sure to prepend the current path iteration to the gem_dirs_path to filter
|
||||
set(gem_dir_paths ${filtered_asset_path} ${recurse_assets_paths})
|
||||
|
||||
# Gather directories to copy over
|
||||
# Currently only the Assets, Registry and Config directories are copied over
|
||||
list(FILTER gem_dir_paths INCLUDE REGEX "/(Assets|Registry|Config)$")
|
||||
list(APPEND gems_assets_dir_path ${gem_dir_paths})
|
||||
else()
|
||||
set(gem_file_paths ${filtered_asset_path})
|
||||
endif()
|
||||
# Gather directories to copy over
|
||||
# Currently only the Assets, Registry and Config directories are copied over
|
||||
list(FILTER gem_dir_paths INCLUDE REGEX "/(Assets|Registry|Config|Editor/Scripts)$")
|
||||
set_property(DIRECTORY ${gem_candidate_dir} APPEND PROPERTY gems_assets_paths ${gem_dir_paths})
|
||||
else()
|
||||
set(gem_file_paths ${filtered_asset_path})
|
||||
endif()
|
||||
|
||||
# Gather files to copy over
|
||||
# Currently only the gem.json file is copied over
|
||||
list(FILTER gem_file_paths INCLUDE REGEX "/(gem.json)$")
|
||||
list(APPEND gems_assets_file_path "${gem_file_paths}")
|
||||
endforeach()
|
||||
# Gather files to copy over
|
||||
# Currently only the gem.json file is copied over
|
||||
list(FILTER gem_file_paths INCLUDE REGEX "/(gem.json|preview.png)$")
|
||||
set_property(DIRECTORY ${gem_candidate_dir} APPEND PROPERTY gems_assets_paths "${gem_file_paths}")
|
||||
endforeach()
|
||||
|
||||
# gem directories to install
|
||||
foreach(gem_absolute_dir_path ${gems_assets_dir_path})
|
||||
cmake_path(RELATIVE_PATH gem_absolute_dir_path BASE_DIRECTORY ${LY_ROOT_FOLDER} OUTPUT_VARIABLE gem_relative_dir_path)
|
||||
if (EXISTS ${gem_absolute_dir_path})
|
||||
# The trailing slash is IMPORTANT here as that is needed to prevent
|
||||
# the "Assets" folder from being copied underneath the <gem-root>/Assets folder
|
||||
install(DIRECTORY "${gem_absolute_dir_path}/"
|
||||
DESTINATION ${gem_relative_dir_path}
|
||||
)
|
||||
endif()
|
||||
endforeach()
|
||||
# gem directories and files to install
|
||||
get_property(gems_assets_paths DIRECTORY ${gem_candidate_dir} PROPERTY gems_assets_paths)
|
||||
foreach(gem_absolute_path IN LISTS gems_assets_paths)
|
||||
if(is_gem_subdirectory_of_engine)
|
||||
cmake_path(RELATIVE_PATH gem_absolute_path BASE_DIRECTORY ${LY_ROOT_FOLDER} OUTPUT_VARIABLE gem_install_dest_dir)
|
||||
else()
|
||||
# The gem resides outside of the LY_ROOT_FOLDER, so the destination is made relative to the
|
||||
# gem candidate directory and placed under the "External" directory"
|
||||
# directory
|
||||
cmake_path(RELATIVE_PATH gem_absolute_path BASE_DIRECTORY ${gem_candidate_dir} OUTPUT_VARIABLE gem_relative_path)
|
||||
unset(gem_install_dest_dir)
|
||||
cmake_path(APPEND gem_install_dest_dir "External" ${last_gem_root_path_segment} ${gem_relative_path})
|
||||
endif()
|
||||
|
||||
cmake_path(GET gem_install_dest_dir PARENT_PATH gem_install_dest_dir)
|
||||
if (NOT gem_install_dest_dir)
|
||||
cmake_path(SET gem_install_dest_dir .)
|
||||
endif()
|
||||
if(IS_DIRECTORY ${gem_absolute_path})
|
||||
install(DIRECTORY "${gem_absolute_path}" DESTINATION ${gem_install_dest_dir})
|
||||
elseif (EXISTS ${gem_absolute_path})
|
||||
install(FILES ${gem_absolute_path} DESTINATION ${gem_install_dest_dir})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# gem files to install
|
||||
foreach(gem_absolute_file_path ${gems_assets_file_path})
|
||||
cmake_path(RELATIVE_PATH gem_absolute_file_path BASE_DIRECTORY ${LY_ROOT_FOLDER} OUTPUT_VARIABLE gem_relative_file_path)
|
||||
cmake_path(GET gem_relative_file_path PARENT_PATH gem_relative_parent_dir)
|
||||
install(FILES ${gem_absolute_file_path}
|
||||
DESTINATION ${gem_relative_parent_dir}
|
||||
)
|
||||
endforeach()
|
||||
|
||||
# Templates
|
||||
@@ -645,3 +644,46 @@ function(ly_setup_target_generator)
|
||||
)
|
||||
|
||||
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()
|
||||
endforeach()
|
||||
|
||||
endfunction()
|
||||
|
||||
@@ -8,39 +8,16 @@
|
||||
include(cmake/Platform/Common/Configurations_common.cmake)
|
||||
include(cmake/Platform/Common/VisualStudio_common.cmake)
|
||||
|
||||
set(LY_MSVC_SUPPORTED_GENERATORS
|
||||
"Visual Studio 15"
|
||||
"Visual Studio 16"
|
||||
)
|
||||
set(FOUND_SUPPORTED_GENERATOR)
|
||||
foreach(supported_generator ${LY_MSVC_SUPPORTED_GENERATORS})
|
||||
if(CMAKE_GENERATOR MATCHES ${supported_generator})
|
||||
set(FOUND_SUPPORTED_GENERATOR TRUE)
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
# VS2017's checks since it defaults the toolchain and target architecture to x86
|
||||
if(CMAKE_GENERATOR MATCHES "Visual Studio 15")
|
||||
if(CMAKE_VS_PLATFORM_NAME AND CMAKE_VS_PLATFORM_NAME STREQUAL "Win32") # VS2017 has Win32 as the default architecture
|
||||
message(FATAL_ERROR "Win32 architecture not supported, specify \"-A x64\" when invoking cmake")
|
||||
endif()
|
||||
if(NOT CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE STREQUAL "x64") # There is at least one library (EditorLib) that make the x86 linker to run out of memory
|
||||
message(FATAL_ERROR "x86 toolset not supported, specify \"-T host=x64\" when invoking cmake")
|
||||
endif()
|
||||
else()
|
||||
# For the other cases, verify that it wasn't invoked with an unsupported architecture. defaults to x86 architecture
|
||||
if(SUPPORTED_VS_PLATFORM_NAME_OVERRIDE)
|
||||
set(SUPPORTED_VS_PLATFORM_NAME ${SUPPORTED_VS_PLATFORM_NAME_OVERRIDE})
|
||||
else()
|
||||
set(SUPPORTED_VS_PLATFORM_NAME x64)
|
||||
endif()
|
||||
if(NOT CMAKE_GENERATOR MATCHES "Visual Studio 1[6-7]")
|
||||
message(FATAL_ERROR "Generator ${CMAKE_GENERATOR} not supported")
|
||||
endif()
|
||||
|
||||
if(CMAKE_VS_PLATFORM_NAME AND NOT CMAKE_VS_PLATFORM_NAME STREQUAL "${SUPPORTED_VS_PLATFORM_NAME}")
|
||||
message(FATAL_ERROR "${CMAKE_VS_PLATFORM_NAME} architecture not supported")
|
||||
endif()
|
||||
if(CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE AND NOT CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE STREQUAL "x64")
|
||||
message(FATAL_ERROR "${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE} toolset not supported")
|
||||
endif()
|
||||
# Verify that it wasn't invoked with an unsupported target/host architecture. Currently only supports x64/x64
|
||||
if(CMAKE_VS_PLATFORM_NAME AND NOT CMAKE_VS_PLATFORM_NAME STREQUAL "x64")
|
||||
message(FATAL_ERROR "${CMAKE_VS_PLATFORM_NAME} target architecture is not supported, it must be 'x64'")
|
||||
endif()
|
||||
if(CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE AND NOT CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE STREQUAL "x64")
|
||||
message(FATAL_ERROR "${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE} host toolset is not supported, it must be 'x64'")
|
||||
endif()
|
||||
|
||||
ly_append_configurations_options(
|
||||
|
||||
@@ -5,6 +5,13 @@
|
||||
#
|
||||
#
|
||||
|
||||
if(CMAKE_GENERATOR MATCHES "Visual Studio 16")
|
||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/Directory.Build.props" "${CMAKE_BINARY_DIR}/Directory.Build.props" COPYONLY)
|
||||
endif()
|
||||
foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES)
|
||||
if(conf STREQUAL debug)
|
||||
string(APPEND VCPKG_CONFIGURATION_MAPPING " <VcpkgConfiguration Condition=\"'$(Configuration)' == '${conf}'\">Debug</VcpkgConfiguration>\n")
|
||||
else()
|
||||
string(APPEND VCPKG_CONFIGURATION_MAPPING " <VcpkgConfiguration Condition=\"'$(Configuration)' == '${conf}'\">Release</VcpkgConfiguration>\n")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/Directory.Build.props" "${CMAKE_BINARY_DIR}/Directory.Build.props" @ONLY)
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ function(ly_copy source_file target_directory)
|
||||
if("${source_file}" IS_NEWER_THAN "${target_directory}/${target_filename}")
|
||||
message(STATUS "Copying \"${source_file}\" to \"${target_directory}\"...")
|
||||
file(COPY "${source_file}" DESTINATION "${target_directory}" FILE_PERMISSIONS @LY_COPY_PERMISSIONS@ FOLLOW_SYMLINK_CHAIN)
|
||||
file(TOUCH_NOCREATE ${target_directory}/${target_filename})
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
@@ -125,7 +125,7 @@ function(ly_copy source_file target_directory)
|
||||
file(LOCK ${target_directory}/${target_filename}.lock GUARD FUNCTION TIMEOUT 300)
|
||||
endif()
|
||||
file(COPY "${source_file}" DESTINATION "${target_directory}" FILE_PERMISSIONS @LY_COPY_PERMISSIONS@ FOLLOW_SYMLINK_CHAIN)
|
||||
file(TOUCH ${target_directory}/${target_filename})
|
||||
file(TOUCH_NOCREATE ${target_directory}/${target_filename})
|
||||
set(anything_new TRUE PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user