From 72cfe71b818f5ea645bbad3bcf02ed135fdf5df8 Mon Sep 17 00:00:00 2001 From: Kris Austin Date: Tue, 29 Sep 2026 06:04:48 -0500 Subject: [PATCH] fix: link webkit2gtk and X11 on every Linux build, not only Flatpak (#15972) libslic3r_gui calls webkit_* directly, and OrcaSlicer.cpp and libspnav call Xlib, but both libraries were only linked when FLATPAK was set. The default build links because the bundled static wxWidgets lists them in wx-config. A shared wxWidgets does not, so any build against one, like the Flatpak build or a distro package, fails with undefined webkit_* and X* symbols. --- src/slic3r/CMakeLists.txt | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt index 584fc2a2aa..f6a8249d4f 100644 --- a/src/slic3r/CMakeLists.txt +++ b/src/slic3r/CMakeLists.txt @@ -1019,14 +1019,9 @@ if (UNIX AND NOT APPLE) find_package(GTK${SLIC3R_GTK} REQUIRED) pkg_check_modules(LIBSECRET REQUIRED libsecret-1) pkg_check_modules(webkit2gtk REQUIRED webkit2gtk-4.1) - if (FLATPAK) - # I don't know why this is needed, but for whatever reason slic3r isn't - # linking to X11 and webkit2gtk. force it. - find_package(X11 REQUIRED) - target_link_libraries(libslic3r_gui ${X11_LIBRARIES} ${webkit2gtk_LIBRARIES}) - endif() + find_package(X11 REQUIRED) target_include_directories(libslic3r_gui SYSTEM PRIVATE ${GTK${SLIC3R_GTK}_INCLUDE_DIRS} ${LIBSECRET_INCLUDE_DIRS} ${webkit2gtk_INCLUDE_DIRS}) - target_link_libraries(libslic3r_gui ${GTK${SLIC3R_GTK}_LIBRARIES} fontconfig ${LIBSECRET_LIBRARIES}) + target_link_libraries(libslic3r_gui ${GTK${SLIC3R_GTK}_LIBRARIES} fontconfig ${LIBSECRET_LIBRARIES} ${webkit2gtk_LIBRARIES} ${X11_LIBRARIES}) # Propagate GDK backend detection results as compile definitions so that # LinuxDisplayBackend.cpp can include the right GDK headers.