Mesa (main): android,d3d12: Support using DirectX-Headers dependency from AOSP

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 19 21:48:18 UTC 2021


Module: Mesa
Branch: main
Commit: 33e5a4378efee353ddadf103300ab27ed4dc32c7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=33e5a4378efee353ddadf103300ab27ed4dc32c7

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Wed Aug  4 17:55:58 2021 -0700

android,d3d12: Support using DirectX-Headers dependency from AOSP

Note that the Android build system apparently lowercases stuff,
so add a lowercase "directx-headers" dependency which is searched first,
before falling back to the proper-cased "DirectX-Headers" dependency.

Reviewed-by: Roman Stratiienko <r.stratiienko at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13532>

---

 android/Android.mk | 6 ++++++
 meson.build        | 9 ++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/android/Android.mk b/android/Android.mk
index 4cc400f2883..2523bc4fd4a 100644
--- a/android/Android.mk
+++ b/android/Android.mk
@@ -75,6 +75,12 @@ LOCAL_SHARED_LIBRARIES += libdrm_nouveau
 MESON_GEN_PKGCONFIGS += libdrm_nouveau:$(LIBDRM_VERSION)
 endif
 
+ifneq ($(filter d3d12,$(BOARD_MESA3D_GALLIUM_DRIVERS)),)
+LOCAL_HEADER_LIBRARIES += DirectX-Headers
+LOCAL_STATIC_LIBRARIES += DirectX-Guids
+MESON_GEN_PKGCONFIGS += DirectX-Headers
+endif
+
 ifneq ($(MESON_GEN_LLVM_STUB),)
 MESON_LLVM_VERSION := 12.0.0
 # Required for swr gallium target
diff --git a/meson.build b/meson.build
index fa37127612c..cf2b5f4b939 100644
--- a/meson.build
+++ b/meson.build
@@ -648,9 +648,12 @@ endif
 
 dep_dxheaders = null_dep
 if with_gallium_d3d12 or with_microsoft_clc
-  dep_dxheaders = dependency('DirectX-Headers', fallback : ['DirectX-Headers', 'dep_dxheaders'],
-    required : with_gallium_d3d12
-  )
+  dep_dxheaders = dependency('directx-headers', required : false)
+  if not dep_dxheaders.found()
+    dep_dxheaders = dependency('DirectX-Headers', fallback : ['DirectX-Headers', 'dep_dxheaders'],
+      required : with_gallium_d3d12
+    )
+  endif
 endif
 
 if with_vulkan_overlay_layer or with_aco_tests



More information about the mesa-commit mailing list