From 04d28dad246a51843bc7f8e9ac3a1fd37ea97996 Mon Sep 17 00:00:00 2001 From: Konstantinos Chatzilygeroudis Date: Fri, 2 Feb 2024 16:41:13 +0200 Subject: [PATCH] EGL only in Linux --- waf_tools/magnum.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/waf_tools/magnum.py b/waf_tools/magnum.py index b5204083..55781efd 100644 --- a/waf_tools/magnum.py +++ b/waf_tools/magnum.py @@ -239,26 +239,27 @@ def fatal(required, msg): egl_found = False glx_found = False if 'TARGET_HEADLESS' in magnum_config or 'TARGET_EGL' in magnum_config: - # TARGET_HEADLESS requires EGL - egl_inc = get_directory('EGL/egl.h', includes_check) + if conf.env['DEST_OS'] != 'darwin': # EGL is available only in Linux + # TARGET_HEADLESS requires EGL + egl_inc = get_directory('EGL/egl.h', includes_check) - magnum_includes = magnum_includes + [egl_inc] + magnum_includes = magnum_includes + [egl_inc] - libs_egl = ['EGL'] - for lib_egl in libs_egl: - try: - lib_dir = get_directory('lib'+lib_egl+'.so', libs_check) - egl_found = True + libs_egl = ['EGL'] + for lib_egl in libs_egl: + try: + lib_dir = get_directory('lib'+lib_egl+'.so', libs_check) + egl_found = True - magnum_libpaths = magnum_libpaths + [lib_dir] - magnum_libs.append(lib_egl) - break - except: - egl_found = False + magnum_libpaths = magnum_libpaths + [lib_dir] + magnum_libs.append(lib_egl) + break + except: + egl_found = False - if not egl_found: - fatal(required, 'Not found') - return + if not egl_found: + fatal(required, 'Not found') + return else: # we need GLX glx_inc = get_directory('GL/glx.h', includes_check)