]> code.ossystems Code Review - openembedded-core.git/commitdiff
mesa.inc: allow the user to choose the build type
authorTrevor Woerner <twoerner@gmail.com>
Wed, 11 Dec 2019 17:23:34 +0000 (12:23 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 16 Dec 2019 23:22:03 +0000 (23:22 +0000)
Upstream mesa can either be built as a debug release (the default) or a
production release. This patch allows the user to choose which one they
want by setting MESA_BUILD_TYPE to either 'production' or 'debug' as
they see fit. Under OpenEmbedded a production build will be performed by
default.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-graphics/mesa/mesa.inc

index 5838207e6b4151345d15b46da9ed30b93b4af359..9ad9f2e37071101a20f27bcaabfcc278930ed531 100644 (file)
@@ -46,6 +46,19 @@ export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}"
 
 MESA_LLVM_RELEASE ?= "${LLVMVERSION}"
 
+# set the MESA_BUILD_TYPE to either 'release' (default) or 'debug'
+# by default the upstream mesa sources build a debug release
+# here we assume the user will want a release build by default
+MESA_BUILD_TYPE ?= "release"
+def check_buildtype(d):
+    _buildtype = d.getVar('MESA_BUILD_TYPE')
+    if _buildtype not in ['release', 'debug']:
+        bb.fatal("unknown build type (%s), please set MESA_BUILD_TYPE to either 'release' or 'debug'" % _buildtype)
+    if _buildtype == 'debug':
+        return 'debugoptimized'
+    return 'plain'
+MESON_BUILDTYPE = "${@check_buildtype(d)}"
+
 EXTRA_OEMESON = " \
     -Dshared-glapi=true \
     -Dgallium-opencl=disabled \