[GTK] Be able to disable gtk2 dependency
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Aug 2014 15:01:29 +0000 (15:01 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Aug 2014 15:01:29 +0000 (15:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=135505

Reviewed by Gustavo Noronha Silva.

.:

Add ENABLE_PLUGIN_PROCESS_GTK2 compile option. GTK+2 is only
required when it's enabled. It's enabled by default.

* Source/cmake/OptionsGTK.cmake:

Source/WebCore:

Do not build WebCorePlatformGTK2 when ENABLE_PLUGIN_PROCESS_GTK2
is OFF.

* PlatformGTK.cmake:

Source/WebKit2:

* PlatformGTK.cmake: Only build WebKitPluginProcess2 when
ENABLE_PLUGIN_PROCESS_GTK2 is ON.
* UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
(WebKit::ProcessLauncher::launchProcess): Do not try to launch
WebKitPluginProcess2 executable when ENABLE_PLUGIN_PROCESS_GTK2 is OFF.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@172144 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
Source/WebCore/ChangeLog
Source/WebCore/PlatformGTK.cmake
Source/WebKit2/ChangeLog
Source/WebKit2/PlatformGTK.cmake
Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp
Source/cmake/OptionsGTK.cmake

index 76a867d..ffeb1e5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2014-08-06  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Be able to disable gtk2 dependency
+        https://bugs.webkit.org/show_bug.cgi?id=135505
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Add ENABLE_PLUGIN_PROCESS_GTK2 compile option. GTK+2 is only
+        required when it's enabled. It's enabled by default.
+
+        * Source/cmake/OptionsGTK.cmake:
+
 2014-08-05  Alex Christensen  <achristensen@webkit.org>
 
         More work on CMake.
index 9a555d1..7db5586 100644 (file)
@@ -1,3 +1,15 @@
+2014-08-06  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Be able to disable gtk2 dependency
+        https://bugs.webkit.org/show_bug.cgi?id=135505
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Do not build WebCorePlatformGTK2 when ENABLE_PLUGIN_PROCESS_GTK2
+        is OFF.
+
+        * PlatformGTK.cmake:
+
 2014-08-06  Mark Lam  <mark.lam@apple.com>
 
         Gardening: fix bindings test breakage for for r170564 merged in r172129.
index 886c791..e30b7c3 100644 (file)
@@ -382,8 +382,8 @@ if (WTF_USE_EGL)
     )
 endif ()
 
-if (ENABLE_WEBKIT2)
-    # WebKit2 needs a version of WebCore compiled against GTK+2, so we've isolated all the GTK+
+if (ENABLE_PLUGIN_PROCESS_GTK2)
+    # WebKitPluginProcess2 needs a version of WebCore compiled against GTK+2, so we've isolated all the GTK+
     # dependent files into a separate library which can be used to construct a GTK+2 WebCore
     # for the plugin process.
     add_library(WebCorePlatformGTK2 ${WebCore_LIBRARY_TYPE} ${WebCorePlatformGTK_SOURCES})
index aef8f81..0ee8e5b 100644 (file)
@@ -1,3 +1,16 @@
+2014-08-06  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Be able to disable gtk2 dependency
+        https://bugs.webkit.org/show_bug.cgi?id=135505
+
+        Reviewed by Gustavo Noronha Silva.
+
+        * PlatformGTK.cmake: Only build WebKitPluginProcess2 when
+        ENABLE_PLUGIN_PROCESS_GTK2 is ON.
+        * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
+        (WebKit::ProcessLauncher::launchProcess): Do not try to launch
+        WebKitPluginProcess2 executable when ENABLE_PLUGIN_PROCESS_GTK2 is OFF.
+
 2014-08-05  Tim Horton  <timothy_horton@apple.com>
 
         REGRESSION (r164337): Pages are sometimes cut off/oriented incorrectly after using WKThumbnailView
index 3a20d13..07f1bc0 100644 (file)
@@ -397,6 +397,7 @@ list(INSERT WebKit2_INCLUDE_DIRECTORIES 0
 )
 
 list(APPEND WebKit2_INCLUDE_DIRECTORIES
+    "${WEBKIT2_DIR}/PluginProcess/unix"
     "${WEBCORE_DIR}/platform/cairo"
     "${WEBCORE_DIR}/platform/gtk"
     "${WEBCORE_DIR}/platform/graphics/cairo"
@@ -571,13 +572,8 @@ set(WEBKIT2_EXTRA_DEPENDENCIES
      webkit2gtk-forwarding-headers
 )
 
-if (ENABLE_PLUGIN_PROCESS)
+if (ENABLE_PLUGIN_PROCESS_GTK2)
     set(PluginProcessGTK2_EXECUTABLE_NAME WebKitPluginProcess2)
-    list(APPEND PluginProcessGTK2_INCLUDE_DIRECTORIES
-        "${WEBKIT2_DIR}/PluginProcess/unix"
-    )
-
-    include_directories(${PluginProcessGTK2_INCLUDE_DIRECTORIES})
 
     # FIXME: We should figure out a way to avoid compiling files that are common between the plugin
     # process and WebKit2 only once instead of recompiling them for the plugin process.
@@ -710,13 +706,12 @@ if (ENABLE_PLUGIN_PROCESS)
     add_dependencies(WebKitPluginProcess2 WebKit2)
 
     install(TARGETS WebKitPluginProcess2 DESTINATION "${LIBEXEC_INSTALL_DIR}")
+endif () # ENABLE_PLUGIN_PROCESS_GTK2
 
-    # GTK3 PluginProcess
-    list(APPEND PluginProcess_SOURCES
-        PluginProcess/EntryPoint/unix/PluginProcessMain.cpp
-    )
-
-endif () # ENABLE_PLUGIN_PROCESS
+# GTK3 PluginProcess
+list(APPEND PluginProcess_SOURCES
+    PluginProcess/EntryPoint/unix/PluginProcessMain.cpp
+)
 
 # Commands for building the built-in injected bundle.
 include_directories(
index eaf9ea2..362365c 100644 (file)
@@ -67,8 +67,10 @@ void ProcessLauncher::launchProcess()
         break;
     case PluginProcess:
         executablePath = executablePathOfPluginProcess();
+#if ENABLE(PLUGIN_PROCESS_GTK2)
         if (m_launchOptions.extraInitializationData.contains("requires-gtk2"))
             executablePath.append('2');
+#endif
         pluginPath = m_launchOptions.extraInitializationData.get("plugin-path");
         realPluginPath = fileSystemRepresentation(pluginPath);
         break;
index 9765b07..4f2bc5a 100644 (file)
@@ -29,8 +29,6 @@ set(WEBKITGTK_HEADER_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/webkitgtk-${WEBKIT
 find_package(Cairo 1.10.2 REQUIRED)
 find_package(Fontconfig 2.8.0 REQUIRED)
 find_package(Freetype2 2.4.2 REQUIRED)
-find_package(GTK2 2.24.10 REQUIRED)
-find_package(GDK2 2.24.10 REQUIRED)
 find_package(HarfBuzz 0.9.2 REQUIRED)
 find_package(ICU REQUIRED)
 find_package(JPEG REQUIRED)
@@ -59,6 +57,8 @@ if (ENABLE_X11_TARGET)
 endif ()
 
 WEBKIT_OPTION_BEGIN()
+WEBKIT_OPTION_DEFINE(ENABLE_PLUGIN_PROCESS_GTK2 "Whether to build WebKitPluginProcess2 to load GTK2 based plugins." ON)
+
 if (OPENGL_FOUND AND (GLX_FOUND OR EGL_FOUND))
     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBGL ON)
 
@@ -152,6 +152,12 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETWORK_PROCESS ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(WTF_USE_TILED_BACKING_STORE OFF)
 WEBKIT_OPTION_END()
 
+if (ENABLE_PLUGIN_PROCESS_GTK2)
+    find_package(GTK2 2.24.10 REQUIRED)
+    find_package(GDK2 2.24.10 REQUIRED)
+    add_definitions(-DENABLE_PLUGIN_PROCESS_GTK2=1)
+endif ()
+
 if (ENABLE_X11_TARGET)
     add_definitions(-DWTF_PLATFORM_X11=1)
     add_definitions(-DMOZ_X11=1)