From efed107af6f9992a9e511736e908516b1d4afd53 Mon Sep 17 00:00:00 2001 From: jackun Date: Wed, 15 Apr 2020 19:45:59 +0300 Subject: [PATCH] [meson] check void* size once and better-ish xnvctrl checks --- meson.build | 6 +++--- src/meson.build | 17 ++++++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index 1554c132..4b415edd 100644 --- a/meson.build +++ b/meson.build @@ -215,10 +215,10 @@ util_files = files( 'src/mesa/util/os_time.c', ) -if cc.sizeof('void*') == 8 +sizeof_ptr = cc.sizeof('void*') +if sizeof_ptr == 8 pre_args += '-DMANGOHUD_ARCH="64bit"' -endif -if cc.sizeof('void*') == 4 +elif sizeof_ptr == 4 pre_args += '-DMANGOHUD_ARCH="32bit"' endif diff --git a/src/meson.build b/src/meson.build index f4ee3f7d..a769d143 100644 --- a/src/meson.build +++ b/src/meson.build @@ -64,12 +64,17 @@ opengl_files = files( pre_args += '-DHOOK_DLSYM' -glimgui_glx_dep = null_dep -glimgui_egl_dep = null_dep +if get_option('with_xnvctrl').enabled() + + if not get_option('with_x11').enabled() + error('XNVCtrl also needs \'with_x11\'') + endif + + xnvctrl_h_found = cc.has_header('NVCtrl/NVCtrl.h') + if not xnvctrl_h_found + error('NVCtrl.h was not found. Disable with \'with_xnvctrl\' if this feature is not needed.') + endif -if get_option('with_x11').enabled() and \ - get_option('with_xnvctrl').enabled() - xnvctrl_h_dep = cc.has_header('NVCtrl/NVCtrl.h') pre_args += '-DHAVE_XNVCTRL' vklayer_files += files( 'loaders/loader_nvctrl.cpp', @@ -122,8 +127,6 @@ vklayer_mesa_overlay = shared_library( dependencies : [ vulkan_wsi_deps, libimgui_core_dep, - glimgui_glx_dep, - glimgui_egl_dep, dbus_dep, dep_dl, dep_pthread,