- Revision
- 291392
- Author
- [email protected]
- Date
- 2022-03-17 00:41:49 -0700 (Thu, 17 Mar 2022)
Log Message
[GTK][WPE] Guard libgbm and libdrm code, make them conditional dependencies for GTK
https://bugs.webkit.org/show_bug.cgi?id=237974
Patch by Zan Dobersek <[email protected]> on 2022-03-17
Reviewed by Alejandro G. Castro.
.:
Guard usage of libgbm and libdrm dependencies with the USE_LIBGBM
define. This should be required until we can switch to a possibly more
dynamic implementation that doesn't require build-time dependencies.
For the GTK port, the desire is to keep these dependencies fully
optional. At the moment they are required when enabling ANGLE-backed
WebGL, with the USE_LIBGBM also defined in that case. This is needed
because ANGLE integration for Linux ports already depends on these
libraries.
For the WPE port only USE_LIBGBM is defined and the two dependencies
remain required.
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:
Source/WebCore:
Add USE(LIBGBM) guards around GBMDevice and GBMBufferSwapchain code,
and compile against the libgbm and libdrm dependencies only when
USE_LIBGBM is defined. This makes the two dependencies optional if
desired.
* PlatformGTK.cmake:
* PlatformWPE.cmake:
* platform/graphics/gbm/GBMBufferSwapchain.cpp:
* platform/graphics/gbm/GBMBufferSwapchain.h:
* platform/graphics/gbm/GBMDevice.cpp:
* platform/graphics/gbm/GBMDevice.h:
Modified Paths
Diff
Modified: trunk/ChangeLog (291391 => 291392)
--- trunk/ChangeLog 2022-03-17 07:31:54 UTC (rev 291391)
+++ trunk/ChangeLog 2022-03-17 07:41:49 UTC (rev 291392)
@@ -1,3 +1,26 @@
+2022-03-17 Zan Dobersek <[email protected]>
+
+ [GTK][WPE] Guard libgbm and libdrm code, make them conditional dependencies for GTK
+ https://bugs.webkit.org/show_bug.cgi?id=237974
+
+ Reviewed by Alejandro G. Castro.
+
+ Guard usage of libgbm and libdrm dependencies with the USE_LIBGBM
+ define. This should be required until we can switch to a possibly more
+ dynamic implementation that doesn't require build-time dependencies.
+
+ For the GTK port, the desire is to keep these dependencies fully
+ optional. At the moment they are required when enabling ANGLE-backed
+ WebGL, with the USE_LIBGBM also defined in that case. This is needed
+ because ANGLE integration for Linux ports already depends on these
+ libraries.
+
+ For the WPE port only USE_LIBGBM is defined and the two dependencies
+ remain required.
+
+ * Source/cmake/OptionsGTK.cmake:
+ * Source/cmake/OptionsWPE.cmake:
+
2022-03-14 Gabriel Nava Marino <[email protected]>
Add myself (Gabriel Nava Marino) to contributors.json
Modified: trunk/Source/WebCore/ChangeLog (291391 => 291392)
--- trunk/Source/WebCore/ChangeLog 2022-03-17 07:31:54 UTC (rev 291391)
+++ trunk/Source/WebCore/ChangeLog 2022-03-17 07:41:49 UTC (rev 291392)
@@ -1,3 +1,22 @@
+2022-03-17 Zan Dobersek <[email protected]>
+
+ [GTK][WPE] Guard libgbm and libdrm code, make them conditional dependencies for GTK
+ https://bugs.webkit.org/show_bug.cgi?id=237974
+
+ Reviewed by Alejandro G. Castro.
+
+ Add USE(LIBGBM) guards around GBMDevice and GBMBufferSwapchain code,
+ and compile against the libgbm and libdrm dependencies only when
+ USE_LIBGBM is defined. This makes the two dependencies optional if
+ desired.
+
+ * PlatformGTK.cmake:
+ * PlatformWPE.cmake:
+ * platform/graphics/gbm/GBMBufferSwapchain.cpp:
+ * platform/graphics/gbm/GBMBufferSwapchain.h:
+ * platform/graphics/gbm/GBMDevice.cpp:
+ * platform/graphics/gbm/GBMDevice.h:
+
2022-03-17 Youenn Fablet <[email protected]>
AudioContext is suspended on iOS when page is backgrounded
Modified: trunk/Source/WebCore/PlatformGTK.cmake (291391 => 291392)
--- trunk/Source/WebCore/PlatformGTK.cmake 2022-03-17 07:31:54 UTC (rev 291391)
+++ trunk/Source/WebCore/PlatformGTK.cmake 2022-03-17 07:41:49 UTC (rev 291392)
@@ -90,12 +90,10 @@
list(APPEND WebCore_LIBRARIES
${ATK_LIBRARIES}
${ENCHANT_LIBRARIES}
- ${GBM_LIBRARIES}
${GLIB_GIO_LIBRARIES}
${GLIB_GMODULE_LIBRARIES}
${GLIB_GOBJECT_LIBRARIES}
${GLIB_LIBRARIES}
- ${LIBDRM_LIBRARIES}
${LIBSECRET_LIBRARIES}
${LIBTASN1_LIBRARIES}
${HYPHEN_LIBRARIES}
@@ -117,10 +115,8 @@
list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
${ATK_INCLUDE_DIRS}
${ENCHANT_INCLUDE_DIRS}
- ${GBM_INCLUDE_DIR}
${GIO_UNIX_INCLUDE_DIRS}
${GLIB_INCLUDE_DIRS}
- ${LIBDRM_INCLUDE_DIR}
${LIBSECRET_INCLUDE_DIRS}
${LIBTASN1_INCLUDE_DIRS}
${UPOWERGLIB_INCLUDE_DIRS}
@@ -209,3 +205,14 @@
${WebCore_DERIVED_SOURCES_DIR}/AccessibilityAtspiInterfaces.c
)
endif ()
+
+if (USE_LIBGBM)
+ list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
+ ${GBM_INCLUDE_DIR}
+ ${LIBDRM_INCLUDE_DIR}
+ )
+ list(APPEND WebCore_LIBRARIES
+ ${GBM_LIBRARIES}
+ ${LIBDRM_LIBRARIES}
+ )
+endif ()
Modified: trunk/Source/WebCore/PlatformWPE.cmake (291391 => 291392)
--- trunk/Source/WebCore/PlatformWPE.cmake 2022-03-17 07:31:54 UTC (rev 291391)
+++ trunk/Source/WebCore/PlatformWPE.cmake 2022-03-17 07:41:49 UTC (rev 291392)
@@ -67,12 +67,10 @@
list(APPEND WebCore_LIBRARIES
WPE::libwpe
${ATK_LIBRARIES}
- ${GBM_LIBRARIES}
${GLIB_GIO_LIBRARIES}
${GLIB_GMODULE_LIBRARIES}
${GLIB_GOBJECT_LIBRARIES}
${GLIB_LIBRARIES}
- ${LIBDRM_LIBRARIES}
${LIBTASN1_LIBRARIES}
${UPOWERGLIB_LIBRARIES}
)
@@ -79,10 +77,8 @@
list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
${ATK_INCLUDE_DIRS}
- ${GBM_INCLUDE_DIR}
${GIO_UNIX_INCLUDE_DIRS}
${GLIB_INCLUDE_DIRS}
- ${LIBDRM_INCLUDE_DIR}
${LIBTASN1_INCLUDE_DIRS}
${UPOWERGLIB_INCLUDE_DIRS}
)
@@ -135,3 +131,14 @@
${WebCore_DERIVED_SOURCES_DIR}/AccessibilityAtspiInterfaces.c
)
endif ()
+
+if (USE_LIBGBM)
+ list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
+ ${GBM_INCLUDE_DIR}
+ ${LIBDRM_INCLUDE_DIR}
+ )
+ list(APPEND WebCore_LIBRARIES
+ ${GBM_LIBRARIES}
+ ${LIBDRM_LIBRARIES}
+ )
+endif ()
Modified: trunk/Source/WebCore/platform/graphics/gbm/GBMBufferSwapchain.cpp (291391 => 291392)
--- trunk/Source/WebCore/platform/graphics/gbm/GBMBufferSwapchain.cpp 2022-03-17 07:31:54 UTC (rev 291391)
+++ trunk/Source/WebCore/platform/graphics/gbm/GBMBufferSwapchain.cpp 2022-03-17 07:41:49 UTC (rev 291392)
@@ -27,6 +27,8 @@
#include "config.h"
#include "GBMBufferSwapchain.h"
+#if USE(LIBGBM)
+
#include "GBMDevice.h"
#include <gbm.h>
@@ -170,3 +172,5 @@
}
} // namespace WebCore
+
+#endif // USE(LIBGBM)
Modified: trunk/Source/WebCore/platform/graphics/gbm/GBMBufferSwapchain.h (291391 => 291392)
--- trunk/Source/WebCore/platform/graphics/gbm/GBMBufferSwapchain.h 2022-03-17 07:31:54 UTC (rev 291391)
+++ trunk/Source/WebCore/platform/graphics/gbm/GBMBufferSwapchain.h 2022-03-17 07:41:49 UTC (rev 291392)
@@ -26,6 +26,8 @@
#pragma once
+#if USE(LIBGBM)
+
#include "DMABufFormat.h"
#include "DMABufObject.h"
#include "DMABufReleaseFlag.h"
@@ -125,3 +127,5 @@
};
} // namespace WebCore
+
+#endif // USE(LIBGBM)
Modified: trunk/Source/WebCore/platform/graphics/gbm/GBMDevice.cpp (291391 => 291392)
--- trunk/Source/WebCore/platform/graphics/gbm/GBMDevice.cpp 2022-03-17 07:31:54 UTC (rev 291391)
+++ trunk/Source/WebCore/platform/graphics/gbm/GBMDevice.cpp 2022-03-17 07:41:49 UTC (rev 291392)
@@ -27,6 +27,8 @@
#include "config.h"
#include "GBMDevice.h"
+#if USE(LIBGBM)
+
#include <fcntl.h>
#include <gbm.h>
#include <mutex>
@@ -89,3 +91,5 @@
}
} // namespace WebCore
+
+#endif // USE(LIBGBM)
Modified: trunk/Source/WebCore/platform/graphics/gbm/GBMDevice.h (291391 => 291392)
--- trunk/Source/WebCore/platform/graphics/gbm/GBMDevice.h 2022-03-17 07:31:54 UTC (rev 291391)
+++ trunk/Source/WebCore/platform/graphics/gbm/GBMDevice.h 2022-03-17 07:41:49 UTC (rev 291392)
@@ -26,6 +26,8 @@
#pragma once
+#if USE(LIBGBM)
+
#include <wtf/Noncopyable.h>
struct gbm_device;
@@ -48,3 +50,5 @@
};
} // namespace WebCore
+
+#endif // USE(LIBGBM)
Modified: trunk/Source/cmake/OptionsGTK.cmake (291391 => 291392)
--- trunk/Source/cmake/OptionsGTK.cmake 2022-03-17 07:31:54 UTC (rev 291391)
+++ trunk/Source/cmake/OptionsGTK.cmake 2022-03-17 07:41:49 UTC (rev 291392)
@@ -12,12 +12,10 @@
find_package(Fontconfig 2.8.0 REQUIRED)
find_package(Freetype 2.4.2 REQUIRED)
find_package(LibGcrypt 1.6.0 REQUIRED)
-find_package(GBM REQUIRED)
find_package(GLIB 2.56.4 REQUIRED COMPONENTS gio gio-unix gobject gthread gmodule)
find_package(HarfBuzz 0.9.18 REQUIRED COMPONENTS ICU)
find_package(ICU 61.2 REQUIRED COMPONENTS data i18n uc)
find_package(JPEG REQUIRED)
-find_package(LibDRM REQUIRED)
find_package(LibXml2 2.8.0 REQUIRED)
find_package(PNG REQUIRED)
find_package(SQLite3 REQUIRED)
@@ -383,6 +381,12 @@
SET_AND_EXPOSE_TO_BUILD(USE_COORDINATED_GRAPHICS TRUE)
SET_AND_EXPOSE_TO_BUILD(USE_NICOSIA TRUE)
SET_AND_EXPOSE_TO_BUILD(USE_ANGLE ${USE_ANGLE_WEBGL})
+
+ if (USE_ANGLE_WEBGL)
+ find_package(GBM REQUIRED)
+ find_package(LibDRM REQUIRED)
+ SET_AND_EXPOSE_TO_BUILD(USE_LIBGBM TRUE)
+ endif ()
endif ()
if (ENABLE_SPELLCHECK)
Modified: trunk/Source/cmake/OptionsWPE.cmake (291391 => 291392)
--- trunk/Source/cmake/OptionsWPE.cmake 2022-03-17 07:31:54 UTC (rev 291391)
+++ trunk/Source/cmake/OptionsWPE.cmake 2022-03-17 07:41:49 UTC (rev 291392)
@@ -282,6 +282,7 @@
SET_AND_EXPOSE_TO_BUILD(USE_EGL TRUE)
SET_AND_EXPOSE_TO_BUILD(USE_GCRYPT TRUE)
SET_AND_EXPOSE_TO_BUILD(USE_LIBEPOXY TRUE)
+SET_AND_EXPOSE_TO_BUILD(USE_LIBGBM TRUE)
SET_AND_EXPOSE_TO_BUILD(USE_LIBWPE TRUE)
SET_AND_EXPOSE_TO_BUILD(USE_OPENGL_ES TRUE)
SET_AND_EXPOSE_TO_BUILD(HAVE_OPENGL_ES_3 TRUE)