diff --git a/CMakeLists.txt b/CMakeLists.txt
index 62d52f0422..d97aa20aad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -407,7 +407,6 @@ set(kwin_KDEINIT_SRCS
decorations/decorationrenderer.cpp
decorations/decorations_logging.cpp
abstract_egl_backend.cpp
- eglonxbackend.cpp
platform.cpp
shell_client.cpp
wayland_server.cpp
diff --git a/plugins/platforms/x11/CMakeLists.txt b/plugins/platforms/x11/CMakeLists.txt
index dde23c6df5..8addf0b52e 100644
--- a/plugins/platforms/x11/CMakeLists.txt
+++ b/plugins/platforms/x11/CMakeLists.txt
@@ -1,3 +1,4 @@
+add_subdirectory(common)
add_subdirectory(standalone)
if(X11_XCB_FOUND)
add_subdirectory(windowed)
diff --git a/plugins/platforms/x11/common/CMakeLists.txt b/plugins/platforms/x11/common/CMakeLists.txt
new file mode 100644
index 0000000000..3b2d598bcf
--- /dev/null
+++ b/plugins/platforms/x11/common/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_library(eglx11common STATIC eglonxbackend.cpp)
+target_link_libraries(eglx11common kwin)
diff --git a/eglonxbackend.cpp b/plugins/platforms/x11/common/eglonxbackend.cpp
similarity index 99%
rename from eglonxbackend.cpp
rename to plugins/platforms/x11/common/eglonxbackend.cpp
index eca6e23291..07eec960ee 100644
--- a/eglonxbackend.cpp
+++ b/plugins/platforms/x11/common/eglonxbackend.cpp
@@ -32,6 +32,8 @@ along with this program. If not, see .
// system
#include
+Q_LOGGING_CATEGORY(KWIN_CORE, "kwin_core", QtCriticalMsg)
+
namespace KWin
{
diff --git a/eglonxbackend.h b/plugins/platforms/x11/common/eglonxbackend.h
similarity index 100%
rename from eglonxbackend.h
rename to plugins/platforms/x11/common/eglonxbackend.h
diff --git a/plugins/platforms/x11/standalone/CMakeLists.txt b/plugins/platforms/x11/standalone/CMakeLists.txt
index aec4039752..499bf19f35 100644
--- a/plugins/platforms/x11/standalone/CMakeLists.txt
+++ b/plugins/platforms/x11/standalone/CMakeLists.txt
@@ -9,7 +9,7 @@ if(HAVE_EPOXY_GLX)
endif()
add_library(KWinX11Platform MODULE ${X11PLATFORM_SOURCES})
-target_link_libraries(KWinX11Platform kwin Qt5::X11Extras)
+target_link_libraries(KWinX11Platform eglx11common kwin Qt5::X11Extras)
install(
TARGETS
diff --git a/plugins/platforms/x11/windowed/CMakeLists.txt b/plugins/platforms/x11/windowed/CMakeLists.txt
index c0824b09b5..c4767c41ed 100644
--- a/plugins/platforms/x11/windowed/CMakeLists.txt
+++ b/plugins/platforms/x11/windowed/CMakeLists.txt
@@ -6,7 +6,7 @@ set(X11BACKEND_SOURCES
)
add_library(KWinWaylandX11Backend MODULE ${X11BACKEND_SOURCES})
-target_link_libraries(KWinWaylandX11Backend kwin X11::XCB)
+target_link_libraries(KWinWaylandX11Backend eglx11common kwin X11::XCB)
install(
TARGETS