Fix gfxstream Magma build
- use pkg-config to look for libmagma.a: this is more standard
in "Linux-distro" style builds rather Meson wrap files.
- don't use magma_fuchsia_log(..) with the gfxstream build. The
specialized logger should likely be only needed for Fuchsia
builds, since mesa_loge(..) already has hooks for Android/Linux.
BUG=326101772
TEST=compile with related gfxstream patches
Change-Id: I4f962b54da8580b298a0126e67ba16563f1acc10
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/mesa/+/994038
Reviewed-by: Craig Stout <cstout@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@google.com>
diff --git a/meson.build b/meson.build
index 7c7412c..ed7296b 100644
--- a/meson.build
+++ b/meson.build
@@ -366,8 +366,7 @@
if with_backend_magma
if get_option('magma-gfxstream')
- gfxstream_proj = subproject('gfxstream')
- dep_magma = gfxstream_proj.get_variable('lib_magma_gfxstream_dep')
+ dep_magma = dependency('magma')
else
# If magma not found in the sysroot, assume it's a subproject
dep_magma = dependency('libmagma_virt', required: false)
diff --git a/src/util/log.c b/src/util/log.c
index 38763f8..63aa124 100644
--- a/src/util/log.c
+++ b/src/util/log.c
@@ -37,7 +37,7 @@
#include "util/log.h"
#include "util/ralloc.h"
-#if USE_MAGMA
+#if DETECT_OS_FUCHSIA && USE_MAGMA
#include <lib/magma_client/include/lib/magma/magma_logging.h>
#endif
@@ -98,7 +98,7 @@
{
#ifdef ANDROID
__android_log_vprint(level_to_android(level), tag, format, va);
-#elif USE_MAGMA
+#elif USE_MAGMA && DETECT_OS_FUCHSIA
magma_fuchsia_log(level_to_fuchsia(level), tag, __FILE__, __LINE__, format, va);
#else
#if !DETECT_OS_WINDOWS && !__Fuchsia__