winft / wrapland

Qt/C++ library wrapping libwayland
GNU Lesser General Public License v2.1
6 stars 2 forks source link

Fails to build on OpenSUSE Build Service #83

Closed romangg closed 5 months ago

romangg commented 2 years ago

In GitLab by @seijikun on Oct 19, 2021, 10:17

Hey! I don't know what exactly I'm doing wrong, but when I tried to package it on OBS, the build fails.

When testing with a single threaded build locally on my machine, I see that the originating error seems to be this one:

[ 60%] Building CXX object src/tools/testserver/CMakeFiles/org-kde-kf5-wrapland-testserver.dir/testserver.cpp.o
In file included from /tmp/wrapland-wrapland@0.523.0/src/tools/testserver/testserver.cpp:25:
/tmp/wrapland-wrapland@0.523.0/src/tools/testserver/../../../server/seat.h:28:10: fatal error: wayland-server.h: No such file or directory
   28 | #include <wayland-server.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/tools/testserver/CMakeFiles/org-kde-kf5-wrapland-testserver.dir/build.make:104: src/tools/testserver/CMakeFiles/org-kde-kf5-wrapland-testserver.dir/testserver.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:651: src/tools/testserver/CMakeFiles/org-kde-kf5-wrapland-testserver.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

I was able to fix this by moving Wayland::Server from PRIVATE to the PUBLIC section for the build target WraplandServer here, but I don't know whether that's the right thing to do. Could you help me out here?

romangg commented 2 years ago

Hi, sorry I must have overlooked this issue ticket.

Moving it from PRIVATE to PUBLIC fixes your build because via CMake's transitive dependency chaining the target org-kde-kf5-wrapland-testserver then also knows about the include directory of libwayland.

In theory we want to fully wrap the libwayland library though through Wrapland and not leak anything of libwayland to consumers if they don't want that.

So keeping the Wayland::Server in the PRIVATE section would be better. Instead what you can also do is link directly from within the other CMake target here to libwayland, i.e. Wayland::Server.

romangg commented 2 years ago

In GitLab by @seijikun on Nov 15, 2021, 21:36

Instead what you can also do is link directly from within the other CMake target here to libwayland, i.e. Wayland::Server.

Okay. Should I do this in a patch for openSUSE, or will you do it upstream? This shouldn't be a problem only I encounter, but a general one with the current build system - or am I misunderstanding something here?

romangg commented 2 years ago

Yea, let's do it upstream. If you like you can also create an MR. :)

romangg commented 2 years ago

mentioned in commit c4b17dcc1c1e87c5c295d046a2a3ac0ae10ecf83