From 0578f13fc93edf954b75ecf206410366b3712ff2 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Sat, 9 Mar 2024 03:26:05 +0800 Subject: [PATCH] meson: Define MESA_DEBUG for latter usage rationale: DEBUG is easily conflict with third-party headers, for example LLVM https://github.com/llvm/llvm-project/issues/24002#issuecomment-1673922017 And amdcommon's addrlib And according to https://github.com/llvm/llvm-project/issues/24002#issuecomment-1673922017 LLVM is already switched to LLVM_DEBUG, I think it's time for mesa switch to MESA_DEBUG for #ifdef DEBUG. Signed-off-by: Yonggang Luo Acked-by: David Heidelberg Reviewed-by: Eric Engestrom Part-of: --- meson.build | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meson.build b/meson.build index f4b3152b017..bf2612ebc38 100644 --- a/meson.build +++ b/meson.build @@ -961,6 +961,10 @@ if with_mesa_debug pre_args += '-DDEBUG' endif +# Define MESA_DEBUG to 1 for debug builds only (debugoptimized is not included on this one); +# otherwise define MESA_DEBUG to 0 +pre_args += '-DMESA_DEBUG=' + (with_mesa_debug ? '1' : '0') + with_shader_cache = get_option('shader-cache') \ .require(host_machine.system() != 'windows', error_message : 'Shader Cache does not currently work on Windows') \ .allowed()