Mesa (master): panfrost: Meson dependency

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon May 3 21:28:17 UTC 2021


Module: Mesa
Branch: master
Commit: 1b87a7d5e06687026048a3cebea1a911f93d87f5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1b87a7d5e06687026048a3cebea1a911f93d87f5

Author: Antonio Caggiano <antonio.caggiano at collabora.com>
Date:   Fri Apr  9 17:27:12 2021 +0200

panfrost: Meson dependency

Declare a meson dependency for libpanfrost and wrap some key functions
within an extern C block allowing proper compilation by C++ compilers.

Signed-off-by: Antonio Caggiano <antonio.caggiano at collabora.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10462>

---

 src/panfrost/lib/meson.build  | 6 ++++++
 src/panfrost/lib/pan_device.h | 8 ++++++++
 2 files changed, 14 insertions(+)

diff --git a/src/panfrost/lib/meson.build b/src/panfrost/lib/meson.build
index b0ebff32ac3..d6f69364a12 100644
--- a/src/panfrost/lib/meson.build
+++ b/src/panfrost/lib/meson.build
@@ -80,3 +80,9 @@ libpanfrost_decode = static_library(
   gnu_symbol_visibility : 'hidden',
   build_by_default : false,
 )
+
+libpanfrost_dep = declare_dependency(
+  link_with: [libpanfrost_lib, libpanfrost_decode, libpanfrost_midgard, libpanfrost_bifrost],
+  include_directories: [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_panfrost_hw, inc_panfrost],
+  dependencies: [dep_libdrm, idep_nir, idep_midgard_pack],
+)
diff --git a/src/panfrost/lib/pan_device.h b/src/panfrost/lib/pan_device.h
index 27f40eedf54..a6b40d4f508 100644
--- a/src/panfrost/lib/pan_device.h
+++ b/src/panfrost/lib/pan_device.h
@@ -42,6 +42,10 @@
 
 #include <midgard_pack.h>
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 /* Driver limits */
 #define PAN_MAX_CONST_BUFFERS 16
 
@@ -259,4 +263,8 @@ pan_is_bifrost(const struct panfrost_device *dev)
         return dev->arch >= 6 && dev->arch <= 7;
 }
 
+#if defined(__cplusplus)
+} // extern "C"
+#endif
+
 #endif



More information about the mesa-commit mailing list