if (getenv("WAYLAND_DISPLAY") != "")
Не:
elseif (_GLFW_X11) target_sources(glfw PRIVATE x11_platform.h xkb_unicode.h posix_time.h posix_thread.h glx_context.h egl_context.h osmesa_context.h x11_init.c x11_monitor.c x11_window.c xkb_unicode.c posix_time.c posix_thread.c glx_context.c egl_context.c osmesa_context.c)elseif (_GLFW_WAYLAND) target_sources(glfw PRIVATE wl_platform.h posix_time.h posix_thread.h xkb_unicode.h egl_context.h osmesa_context.h wl_init.c wl_monitor.c wl_window.c posix_time.c posix_thread.c xkb_unicode.c egl_context.c osmesa_context.c)elseif (_GLFW_OSMESA) target_sources(glfw PRIVATE null_platform.h null_joystick.h posix_time.h posix_thread.h osmesa_context.h null_init.c null_monitor.c null_window.c null_joystick.c posix_time.c posix_thread.c osmesa_context.c)endif()