Closed VortexAcherontic closed 9 months ago
Does this work?
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5c2fdfa..e65aa3e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -111,6 +111,9 @@ if (HAVE_X11_XCB)
$<TARGET_PROPERTY:PkgConfig::XCB_XFIXES,INTERFACE_INCLUDE_DIRECTORIES>
)
endif()
+if (HAVE_WAYLAND)
+ target_include_directories(VkLayer_obs_vkcapture PRIVATE $<TARGET_PROPERTY:PkgConfig::WAYLAND_CLIENT,INTERFACE_INCLUDE_DIRECTORIES>)
+endif()
set(GL_SOURCES src/dlsym.c src/elfhacks.c src/glinject.c src/capture.c)
add_library(obs_glcapture MODULE ${GL_SOURCES})
I replaced my patch file with your suggested changes but it still seems to fail.
Looking up the patched source inside the build environment it seems to have applied the patch correctly:
if (HAVE_X11_XCB)
target_include_directories(VkLayer_obs_vkcapture PRIVATE
$<TARGET_PROPERTY:PkgConfig::XCB,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:PkgConfig::XCB_XFIXES,INTERFACE_INCLUDE_DIRECTORIES>
)
endif()
if (HAVE_WAYLAND)
target_include_directories(VkLayer_obs_vkcapture PRIVATE $<TARGET_PROPERTY:PkgConfig::WAYLAND_CLIENT,INTERFACE_INCLUDE_DIRECTORIES>)
endif()
But the error remains:
[ 6s] [ 53%] Building C object CMakeFiles/obs_glcapture.dir/src/glinject.c.o
[ 6s] /usr/bin/cc -DENABLE_WAYLAND=1 -Dobs_glcapture_EXPORTS -I/home/abuild/rpmbuild/BUILD/obs-vkcapture-1.4.3/build -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -O2 -g -DNDEBUG -std=gnu11 -fPIC -MD -MT CMakeFiles/obs_glcapture.dir/src/glinject.c.o -MF CMakeFiles/obs_glcapture.dir/src/glinject.c.o.d -o CMakeFiles/obs_glcapture.dir/src/glinject.c.o -c /home/abuild/rpmbuild/BUILD/obs-vkcapture-1.4.3/src/glinject.c
[ 6s] In file included from /home/abuild/rpmbuild/BUILD/obs-vkcapture-1.4.3/src/glinject.c:27:
[ 6s] /home/abuild/rpmbuild/BUILD/obs-vkcapture-1.4.3/src/vklayer.h:34:10: fatal error: wayland-client.h: No such file or directory
[ 6s] 34 | #include <wayland-client.h>
[ 6s] | ^~~~~~~~~~~~~~~~~~
[ 6s] compilation terminated.
[ 6s] make[2]: *** [CMakeFiles/obs_glcapture.dir/build.make:107: CMakeFiles/obs_glcapture.dir/src/glinject.c.o] Error 1
[ 6s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/obs-vkcapture-1.4.3/build'
[ 6s] make[2]: *** Waiting for unfinished jobs....
Strange, what's the contents of /usr/lib/pkgconfig/wayland-client.pc
on your system? And output of pkg-config --cflags wayland-client
.
The content of /usr/lib64/pkgconfig/wayland-client.pc
is:
prefix=/usr
includedir=${prefix}/include/wayland
libdir=${prefix}/lib64
datarootdir=${prefix}/share
pkgdatadir=${datarootdir}/wayland
Name: Wayland Client
Description: Wayland client side library
Version: 1.22.0
Requires.private: libffi
Libs: -L${libdir} -lwayland-client
Libs.private: -lm -pthread -lrt
Cflags: -I${includedir}
and the output of pkg-config is:
pkg-config --cflags wayland-client
-I/usr/include/wayland
Looks all legit to me no clue why the patch does not work 😕
Yeah it looks correct, how come it doesn't work ...
This should work, however I don't really want to link to libwayland when only headers are needed.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5c2fdfa..0fceca1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -100,7 +100,7 @@ endif()
set(LAYER_SOURCES src/vklayer.c src/capture.c)
add_library(VkLayer_obs_vkcapture MODULE ${LAYER_SOURCES})
set_target_properties(VkLayer_obs_vkcapture PROPERTIES LINK_FLAGS "-Wl,--version-script=\"${CMAKE_CURRENT_SOURCE_DIR}/src/vklayer.version\"")
-target_link_libraries(VkLayer_obs_vkcapture Vulkan::Vulkan)
+target_link_libraries(VkLayer_obs_vkcapture Vulkan::Vulkan PkgConfig::WAYLAND_CLIENT)
target_include_directories(VkLayer_obs_vkcapture PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
if (HAVE_X11_XLIB)
target_include_directories(VkLayer_obs_vkcapture PRIVATE $<TARGET_PROPERTY:PkgConfig::X11,INTERFACE_INCLUDE_DIRECTORIES>)
Sorry for the late response.
Your last suggested change did not helped as well.
But as I noticed you pushed a small addition to vklayer.h I did re-create the commit in my patch file and can confirm, that works as well.
Thank you for your time looking into this ❤️
Describe the bug Since 1.4.3 when building obs-vulkan capture on RPM based distributions (or at least openSUSE it seems) wayland-client.h is located at
/usr/include/wayland/
but/usr/include/
is assumed in vklayer.hSystem (please complete the following information):
Build Log:
Temporary patch file I use for a successful build: build.opensuse.org