build2-packaging / glfw

build2 package for glfw
0 stars 1 forks source link

usewayland follow GLFW_BUILD_WAYLAND instead of _GLFW_WAYLAND #9

Open duarm opened 8 months ago

duarm commented 8 months ago

After https://github.com/glfw/glfw/commit/56a4cb0a3a2c7a44a2fd8ab3335adf915e19d30c , glfw can now use the GLFW_BUILD_X11 and GLFW_BUILD_WAYLAND defines to include x11/wayland support, both backends can now coexist and be dinamically selected when opening a window. We should do that instead of an if-else compiling only one backend

https://github.com/glfw/glfw/blob/46cebb5081820418f2a20f3e90b07f9b1bd44b42/src/CMakeLists.txt#L51

if (GLFW_BUILD_WAYLAND)
    target_compile_definitions(glfw PRIVATE _GLFW_WAYLAND)
    target_sources(glfw PRIVATE wl_platform.h xkb_unicode.h wl_init.c
                                wl_monitor.c wl_window.c xkb_unicode.c)
endif()
duarm commented 5 months ago

With the release of 3.8, both are now included by default

Swat-SomeBug commented 2 months ago

Hi, I was just looking into this and so far I don't see a difference. Looking at the CMakeLists.txt, I see that _GLFW_X11 and _GLFW_WAYLAND are exclusive to each other and any libraries linked at compile time are therefore mutually exclusive. I'm currently looking at tag 3.3.8.

Swat-SomeBug commented 2 months ago

Is this maybe in the 3.4 release? I see several changes related to Wayland that made it to 3.4

duarm commented 2 months ago

I was referring to this commit, which made into 3.4 release, https://github.com/glfw/glfw/commit/2590d4cdd460b6d4a4bbc17328f283f447f1c3e9

just noticed I typed 3.8, my mistake