void-packages/srcpkgs/renderdoc/patches/add-x86-family.patch

57 lines
2.0 KiB
Diff

From: Jordan Justen <jordan.l.justen@intel.com>
Date: Wed, 29 Jul 2020 02:01:24 -0700
Subject: Add RENDERDOC_X86_PROC_FAMILY CMake and RDOC_X86_FAMILY C switches
This can build useful when trying to build renderdoc on unsupported
platforms. For example, if trying to build renderdoc on ARM, but
without targeting ANDROID, the compressonator code will fail to
compile. Instead of depending on the BUILD_ANDROID flag, we can use
the RENDERDOC_X86 flag.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
---
CMakeLists.txt | 8 ++++++++
renderdoc/common/globalconfig.h | 10 ++++++++++
2 files changed, 18 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7ee30d4..d2edf3d 100644
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -89,6 +89,14 @@ set(RENDERDOC_APK_PATH "" CACHE STRING "Path to RenderDoc .apk files after insta
set(LIB_SUFFIX "" CACHE STRING "Suffix for 'lib' folder in target directory structure. E.g. set to '64' to use /usr/local/lib64 instead of /usr/local/lib.")
set(LIB_SUBFOLDER "" CACHE STRING "Subfolder under the 'lib' folder in target directory structure. E.g. set to 'renderdoc' to use /usr/local/lib/renderdoc instead of /usr/local/lib.")
+if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64" OR
+ CMAKE_SYSTEM_PROCESSOR MATCHES "i686")
+set(RENDERDOC_X86_PROC_FAMILY TRUE)
+add_definitions(-DRENDERDOC_X86_PROC_FAMILY=1)
+else()
+set(RENDERDOC_X86_PROC_FAMILY FALSE)
+endif()
+
if(NOT LIB_SUFFIX STREQUAL "")
add_definitions(-DRENDERDOC_LIB_SUFFIX=${LIB_SUFFIX})
endif()
diff --git a/renderdoc/common/globalconfig.h b/renderdoc/common/globalconfig.h
index d266166..d21da15 100644
--- renderdoc/common/globalconfig.h
+++ renderdoc/common/globalconfig.h
@@ -125,6 +125,16 @@
#endif
+#if defined(RENDERDOC_X86_PROC_FAMILY)
+
+#define RDOC_X86_FAMILY OPTION_ON
+
+#else
+
+#define RDOC_X86_FAMILY OPTION_OFF
+
+#endif
+
// is size_t a real separate type, not just typedef'd to uint32_t or uint64_t (or equivalent)?
#if defined(RENDERDOC_PLATFORM_APPLE)
#define RDOC_SIZET_SEP_TYPE OPTION_ON