summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-09-19 15:24:36 +0200
committerGitHub <noreply@github.com>2023-09-19 15:24:36 +0200
commitda8cbbf958c6a5b481e93ab11b018194fffea93d (patch)
tree8c1701330b5198f21b5363af00bdc46896635edc
parentMerge pull request #11538 from cathyjf/renderdoc-check-correct-win32-symbol (diff)
parentcmake: prefer system renderdoc header (diff)
downloadyuzu-da8cbbf958c6a5b481e93ab11b018194fffea93d.tar
yuzu-da8cbbf958c6a5b481e93ab11b018194fffea93d.tar.gz
yuzu-da8cbbf958c6a5b481e93ab11b018194fffea93d.tar.bz2
yuzu-da8cbbf958c6a5b481e93ab11b018194fffea93d.tar.lz
yuzu-da8cbbf958c6a5b481e93ab11b018194fffea93d.tar.xz
yuzu-da8cbbf958c6a5b481e93ab11b018194fffea93d.tar.zst
yuzu-da8cbbf958c6a5b481e93ab11b018194fffea93d.zip
-rw-r--r--CMakeLists.txt1
-rw-r--r--CMakeModules/FindRenderDoc.cmake19
-rw-r--r--externals/CMakeLists.txt7
-rw-r--r--src/core/CMakeLists.txt2
4 files changed, 26 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3b0891adf..2bef9d6ed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -333,6 +333,7 @@ find_package(LLVM 17 MODULE COMPONENTS Demangle)
find_package(lz4 REQUIRED)
find_package(nlohmann_json 3.8 REQUIRED)
find_package(Opus 1.3 MODULE)
+find_package(RenderDoc MODULE)
find_package(VulkanMemoryAllocator CONFIG)
find_package(ZLIB 1.2 REQUIRED)
find_package(zstd 1.5 REQUIRED)
diff --git a/CMakeModules/FindRenderDoc.cmake b/CMakeModules/FindRenderDoc.cmake
new file mode 100644
index 000000000..2678b936b
--- /dev/null
+++ b/CMakeModules/FindRenderDoc.cmake
@@ -0,0 +1,19 @@
+# SPDX-FileCopyrightText: 2023 Alexandre Bouvier <contact@amb.tf>
+#
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+find_path(RenderDoc_INCLUDE_DIR renderdoc_app.h)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(RenderDoc
+ REQUIRED_VARS RenderDoc_INCLUDE_DIR
+)
+
+if (RenderDoc_FOUND AND NOT TARGET RenderDoc::API)
+ add_library(RenderDoc::API INTERFACE IMPORTED)
+ set_target_properties(RenderDoc::API PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${RenderDoc_INCLUDE_DIR}"
+ )
+endif()
+
+mark_as_advanced(RenderDoc_INCLUDE_DIR)
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt
index a4c2ffc10..9eebc7d65 100644
--- a/externals/CMakeLists.txt
+++ b/externals/CMakeLists.txt
@@ -174,8 +174,11 @@ target_include_directories(stb PUBLIC ./stb)
add_library(bc_decoder bc_decoder/bc_decoder.cpp)
target_include_directories(bc_decoder PUBLIC ./bc_decoder)
-add_library(renderdoc INTERFACE)
-target_include_directories(renderdoc SYSTEM INTERFACE ./renderdoc)
+if (NOT TARGET RenderDoc::API)
+ add_library(renderdoc INTERFACE)
+ target_include_directories(renderdoc SYSTEM INTERFACE ./renderdoc)
+ add_library(RenderDoc::API ALIAS renderdoc)
+endif()
if (ANDROID)
if (ARCHITECTURE_arm64)
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index b2dc71d4c..4e1f1f47a 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -890,7 +890,7 @@ endif()
create_target_directory_groups(core)
target_link_libraries(core PUBLIC common PRIVATE audio_core network video_core nx_tzdb)
-target_link_libraries(core PUBLIC Boost::headers PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls renderdoc)
+target_link_libraries(core PUBLIC Boost::headers PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls RenderDoc::API)
if (MINGW)
target_link_libraries(core PRIVATE ${MSWSOCK_LIBRARY})
endif()