Changes how renderdoc is added, since this is not a real 3rdParty we want to depend on but some functionality we want to enable/disable

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-09-03 17:32:37 -07:00
parent 15e889a2f6
commit 9929782e86
8 changed files with 76 additions and 58 deletions
+13 -16
View File
@@ -11,19 +11,16 @@ ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Sourc
include(${pal_dir}/AtomRHITests_traits_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
set(LY_RENDERDOC_ENABLED OFF CACHE BOOL "Enable RenderDoc integration.")
set(RENDERDOC_CMAKE ${CMAKE_CURRENT_SOURCE_DIR}/${pal_dir}/renderdoc_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
if(EXISTS ${RENDERDOC_CMAKE})
include(${RENDERDOC_CMAKE})
endif()
if(LY_RENDERDOC_ENABLED AND TARGET "3rdParty::renderdoc")
message(STATUS "Renderdoc found, adding as runtime dependency")
set(USE_RENDERDOC_DEFINE "USE_RENDERDOC")
set(RENDERDOC_BUILD_DEPENDENCY "3rdParty::renderdoc")
else()
set(USE_RENDERDOC_DEFINE "")
set(RENDERDOC_BUILD_DEPENDENCY "")
include(${CMAKE_CURRENT_SOURCE_DIR}/${pal_dir}/renderdoc_support_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
if(PAL_TRAIT_BUILD_RENDERDOC_SUPPORTED)
set(LY_RENDERDOC_ENABLED OFF CACHE BOOL "Enable RenderDoc integration. Use LY_RENDERDOC_PATH to specific the path to RenderDoc.")
if(LY_RENDERDOC_ENABLED)
include(${CMAKE_CURRENT_SOURCE_DIR}/${pal_dir}/renderdoc_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
if(PAL_TRAIT_BUILD_RENDERDOC_ENABLED)
message(STATUS "Renderdoc found, adding as runtime dependency")
set(RENDERDOC_DEFINE USE_RENDERDOC)
endif()
endif()
endif()
ly_add_target(
@@ -61,11 +58,11 @@ ly_add_target(
AZ::AzCore
AZ::AzFramework
Gem::Atom_RHI.Reflect
PUBLIC
${RENDERDOC_BUILD_DEPENDENCY}
COMPILE_DEFINITIONS
PUBLIC
${USE_RENDERDOC_DEFINE}
${RENDERDOC_DEFINE}
RUNTIME_DEPENDENCIES
${RENDERDOC_RUNTIME_DEPENDENCIES}
)
ly_add_target(
@@ -6,5 +6,4 @@
#
#
set(ATOM_RHI_TRAIT_BUILD_SUPPORTS_TEST FALSE)
set(ATOM_RHI_TRAIT_BUILD_SUPPORTS_EDIT FALSE)
set(PAL_TRAIT_BUILD_RENDERDOC_SUPPORTED FALSE)
@@ -6,24 +6,13 @@
#
#
# Prevent bundling the renderdoc dll with a packaged title
if(NOT LY_MONOLITHIC_GAME)
if(DEFINED ENV{"ATOM_RENDERDOC_PATH"})
set(RENDERDOC_PATH ENV{"ATOM_RENDERDOC_PATH"})
endif()
set(PAL_TRAIT_BUILD_RENDERDOC_ENABLED FALSE)
set(LY_RENDERDOC_PATH "/usr/local" CACHE PATH "Path to RenderDoc.")
if(RENDERDOC_PATH)
# Normalize file path
file(TO_CMAKE_PATH "${RENDERDOC_PATH}" RENDERDOC_PATH)
# Normalize file path
file(TO_CMAKE_PATH "${LY_RENDERDOC_PATH}" LY_RENDERDOC_PATH)
if(EXISTS "${RENDERDOC_PATH}/librenderdoc.so")
ly_add_external_target(
NAME renderdoc
VERSION
3RDPARTY_ROOT_DIRECTORY ${RENDERDOC_PATH}
INCLUDE_DIRECTORIES "."
RUNTIME_DEPENDENCIES "${RENDERDOC_PATH}/librenderdoc.so"
)
endif()
endif()
endif()
if(EXISTS "${LY_RENDERDOC_PATH}/librenderdoc.so")
set(RENDERDOC_RUNTIME_DEPENDENCIES "${RENDERDOC_PATH}/librenderdoc.so")
set(PAL_TRAIT_BUILD_RENDERDOC_ENABLED TRUE)
endif()
@@ -0,0 +1,14 @@
#
# 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
#
#
# Prevent bundling the renderdoc dll with a packaged title
if(LY_MONOLITHIC_GAME)
set(PAL_TRAIT_BUILD_RENDERDOC_SUPPORTED FALSE)
else()
set(PAL_TRAIT_BUILD_RENDERDOC_SUPPORTED TRUE)
endif()
@@ -0,0 +1,9 @@
#
# 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(PAL_TRAIT_BUILD_RENDERDOC_SUPPORTED FALSE)
@@ -0,0 +1,14 @@
#
# 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
#
#
# Prevent bundling the renderdoc dll with a packaged title
if(LY_MONOLITHIC_GAME)
set(PAL_TRAIT_BUILD_RENDERDOC_SUPPORTED FALSE)
else()
set(PAL_TRAIT_BUILD_RENDERDOC_SUPPORTED TRUE)
endif()
@@ -6,26 +6,13 @@
#
#
# Prevent bundling the renderdoc dll with a packaged title
if(NOT LY_MONOLITHIC_GAME)
# Common installation path for renderdoc path
set(RENDERDOC_PATH "$ENV{PROGRAMFILES}/RenderDoc")
if(DEFINED ENV{"ATOM_RENDERDOC_PATH"})
set(RENDERDOC_PATH ENV{"ATOM_RENDERDOC_PATH"})
endif()
set(PAL_TRAIT_BUILD_RENDERDOC_ENABLED FALSE)
set(LY_RENDERDOC_PATH "$ENV{PROGRAMFILES}/RenderDoc" CACHE PATH "Path to RenderDoc.")
if(RENDERDOC_PATH)
# Normalize file path
file(TO_CMAKE_PATH "${RENDERDOC_PATH}" RENDERDOC_PATH)
# Normalize file path
file(TO_CMAKE_PATH "${LY_RENDERDOC_PATH}" LY_RENDERDOC_PATH)
if(EXISTS "${RENDERDOC_PATH}/renderdoc.dll")
ly_add_external_target(
NAME renderdoc
VERSION
3RDPARTY_ROOT_DIRECTORY ${RENDERDOC_PATH}
INCLUDE_DIRECTORIES "."
RUNTIME_DEPENDENCIES "${RENDERDOC_PATH}/renderdoc.dll"
)
endif()
endif()
endif()
if(EXISTS "${LY_RENDERDOC_PATH}/renderdoc.dll")
set(RENDERDOC_RUNTIME_DEPENDENCIES "${RENDERDOC_PATH}/renderdoc.dll")
set(PAL_TRAIT_BUILD_RENDERDOC_ENABLED TRUE)
endif()
@@ -0,0 +1,9 @@
#
# 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(PAL_TRAIT_BUILD_RENDERDOC_SUPPORTED FALSE)