diff options
author | Eric Engestrom <eric@igalia.com> | 2024-04-30 17:43:26 +0200 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2024-04-30 18:34:08 +0000 |
commit | a963c67298e9433b8832e08edd827b7818600bc5 (patch) | |
tree | 7fee5f3f7f8ff5203f9a7184459ee078d430b212 /meson.build | |
parent | f9d78f110cb42947852f4977bb602a3e653078e4 (diff) |
meson: use bool.to_int() instead of manually converting
Suggested-by: @dbaker
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28990>
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/meson.build b/meson.build index 335b120839d..24709d65eb4 100644 --- a/meson.build +++ b/meson.build @@ -127,9 +127,9 @@ with_gles2 = get_option('gles2') \ .require(with_shared_glapi, error_message : 'OpengGL ES 2.x requires shared-glapi') \ .allowed() -pre_args += '-DHAVE_OPENGL=@0@'.format(with_opengl ? '1' : '0') -pre_args += '-DHAVE_OPENGL_ES_1=@0@'.format(with_gles1 ? '1' : '0') -pre_args += '-DHAVE_OPENGL_ES_2=@0@'.format(with_gles2 ? '1' : '0') +pre_args += '-DHAVE_OPENGL=@0@'.format(with_opengl.to_int()) +pre_args += '-DHAVE_OPENGL_ES_1=@0@'.format(with_gles1.to_int()) +pre_args += '-DHAVE_OPENGL_ES_2=@0@'.format(with_gles2.to_int()) with_any_opengl = with_opengl or with_gles1 or with_gles2 # Only build shared_glapi if at least one OpenGL API is enabled @@ -554,7 +554,7 @@ _glvnd = get_option('glvnd') \ error_message: '''EGL lib suffix can't be used with libglvnd''') dep_glvnd = dependency('libglvnd', version : '>= 1.3.2', required : _glvnd) with_glvnd = dep_glvnd.found() -pre_args += '-DUSE_LIBGLVND=@0@'.format(with_glvnd ? '1' : '0') +pre_args += '-DUSE_LIBGLVND=@0@'.format(with_glvnd.to_int()) glvnd_vendor_name = get_option('glvnd-vendor-name') if with_vulkan_icd_dir == '' @@ -681,10 +681,8 @@ else with_gallium_omx = _omx endif -pre_args += [ - '-DENABLE_ST_OMX_BELLAGIO=' + (with_gallium_omx == 'bellagio' ? '1' : '0'), - '-DENABLE_ST_OMX_TIZONIA=' + (with_gallium_omx == 'tizonia' ? '1' : '0'), -] +pre_args += '-DENABLE_ST_OMX_BELLAGIO=@0@'.format((with_gallium_omx == 'bellagio').to_int()) +pre_args += '-DENABLE_ST_OMX_TIZONIA=@0@'.format((with_gallium_omx == 'tizonia').to_int()) omx_drivers_path = get_option('omx-libs-path') @@ -881,7 +879,7 @@ if with_shared_glapi and not with_glx_indirect_rendering # Imply !defined(GLX_INDIRECT_RENDERING) with_glapi_export_proto_entry_points = true endif -pre_args += '-DGLAPI_EXPORT_PROTO_ENTRY_POINTS=@0@'.format(with_glapi_export_proto_entry_points ? '1' : '0') +pre_args += '-DGLAPI_EXPORT_PROTO_ENTRY_POINTS=@0@'.format(with_glapi_export_proto_entry_points.to_int()) with_android_stub = get_option('android-stub') if with_android_stub and not with_platform_android @@ -957,7 +955,7 @@ 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') +pre_args += '-DMESA_DEBUG=@0@'.format(with_mesa_debug.to_int()) with_split_debug = get_option('split-debug') \ .disable_if(not cc.has_argument('-gsplit-dwarf'), @@ -1823,8 +1821,8 @@ elif with_clc else draw_with_llvm = false endif -pre_args += '-DLLVM_AVAILABLE=' + (with_llvm ? '1' : '0') -pre_args += '-DDRAW_LLVM_AVAILABLE=' + (with_llvm and draw_with_llvm ? '1' : '0') +pre_args += '-DLLVM_AVAILABLE=@0@'.format(with_llvm.to_int()) +pre_args += '-DDRAW_LLVM_AVAILABLE=@0@'.format((with_llvm and draw_with_llvm).to_int()) with_opencl_spirv = (_opencl != 'disabled' and get_option('opencl-spirv')) or with_clc if with_opencl_spirv |