diff --git a/meson.build b/meson.build
index 58ebf6f56e37fb672a174b8c9411134f25886676..802ed7ddda84f78c50e7db440ab28ff20f8036ef 100644
--- a/meson.build
+++ b/meson.build
@@ -74,8 +74,7 @@ foreach header : headers
   endif
 endforeach
 
-# FIXME: Add a config option to validate spice-widget-egl being built or not
-spice_gtk_has_egl = compiler.has_header('epoxy/egl.h')
+spice_gtk_has_egl = compiler.has_header('epoxy/egl.h', required: get_option('egl'))
 spice_gtk_config_data.set('HAVE_EGL', spice_gtk_has_egl)
 
 #
diff --git a/meson_options.txt b/meson_options.txt
index 5acfc9a278ff3ec63ac7eec6d74a2eb3bed872b5..f31d5ce0ba110a6bc32ddc644ad02c25394b91b1 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -77,6 +77,10 @@ option('smartcard',
     type : 'feature',
     description : 'Enable smartcard support')
 
+option('egl',
+    type : 'feature',
+    description: 'EGL support')
+
 option('gtk_doc',
        type : 'feature',
        description : 'Generate API documentation with gtk-doc')