[GTK] [CMake] Fix the build after r162835
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Jan 2014 19:51:24 +0000 (19:51 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Jan 2014 19:51:24 +0000 (19:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=127753

Reviewed by Gustavo Noronha Silva.

* CMakeLists.txt: Add support for using the prefix header (GCC / clang only for now)
when WebKit2_USE_PREFIX_HEADER is set to true.
* PlatformGTK.cmake: Set WebKit2_USE_PREFIX_HEADER support and no longer process some message.in files.
* WebKit2Prefix.h: Add support for the CMake GTK+ build.

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

Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/WebKit2/PlatformGTK.cmake
Source/WebKit2/WebKit2Prefix.h

index 9503f47..67181c8 100644 (file)
@@ -690,6 +690,16 @@ if (LIBRT_LIBRARIES)
     list(APPEND WebKit2_LIBRARIES ${LIBRT_LIBRARIES})
 endif ()
 
+macro(ADD_WEBKIT2_PREFIX_HEADER _target)
+    if (WebKit2_USE_PREFIX_HEADER)
+        get_target_property(OLD_COMPILE_FLAGS ${_target} COMPILE_FLAGS)
+        if (${OLD_COMPILE_FLAGS} STREQUAL "OLD_COMPILE_FLAGS-NOTFOUND")
+            set(OLD_COMPILE_FLAGS "")
+        endif ()
+        set_target_properties(${_target} PROPERTIES COMPILE_FLAGS "${OLD_COMPILE_FLAGS} -include ${WEBKIT2_DIR}/WebKit2Prefix.h")
+    endif ()
+endmacro()
+
 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
 
 GENERATE_WEBKIT2_MESSAGE_SOURCES(WebKit2_SOURCES "${WebKit2_MESSAGES_IN_FILES}")
@@ -700,6 +710,7 @@ add_library(WebKit2 ${WebKit2_LIBRARY_TYPE} ${WebKit2_SOURCES})
 
 add_dependencies(WebKit2 WebCore)
 add_dependencies(WebKit2 ${WEBKIT2_EXTRA_DEPENDENCIES})
+add_webkit2_prefix_header(WebKit2)
 target_link_libraries(WebKit2 ${WebKit2_LIBRARIES})
 set_target_properties(WebKit2 PROPERTIES FOLDER "WebKit")
 set_target_properties(WebKit2 PROPERTIES LINK_INTERFACE_LIBRARIES "")
@@ -709,6 +720,7 @@ if (WebKit2_OUTPUT_NAME)
 endif ()
 
 add_executable(WebProcess ${WebProcess_SOURCES})
+add_webkit2_prefix_header(WebProcess)
 target_link_libraries(WebProcess ${WebProcess_LIBRARIES})
 set_target_properties(WebProcess PROPERTIES FOLDER "WebKit")
 
@@ -718,6 +730,7 @@ endif ()
 
 if (ENABLE_NETWORK_PROCESS)
     add_executable(NetworkProcess ${NetworkProcess_SOURCES})
+    add_webkit2_prefix_header(NetworkProcess)
     target_link_libraries(NetworkProcess ${NetworkProcess_LIBRARIES})
     set_target_properties(NetworkProcess PROPERTIES FOLDER "WebKit")
     install(TARGETS NetworkProcess DESTINATION "${LIBEXEC_INSTALL_DIR}")
index 9610832..feb55c5 100644 (file)
@@ -1,3 +1,15 @@
+2014-01-29  Martin Robinson  <mrobinson@igalia.com>
+
+        [GTK] [CMake] Fix the build after r162835
+        https://bugs.webkit.org/show_bug.cgi?id=127753
+
+        Reviewed by Gustavo Noronha Silva.
+
+        * CMakeLists.txt: Add support for using the prefix header (GCC / clang only for now)
+        when WebKit2_USE_PREFIX_HEADER is set to true.
+        * PlatformGTK.cmake: Set WebKit2_USE_PREFIX_HEADER support and no longer process some message.in files.
+        * WebKit2Prefix.h: Add support for the CMake GTK+ build.
+
 2014-01-29  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         Remove ENABLE(JAVASCRIPT_DEBUGGER) guards
index 3c7b8dc..5044ccc 100644 (file)
@@ -11,6 +11,8 @@ add_definitions(-DLIBEXECDIR="${CMAKE_INSTALL_FULL_LIBEXECDIR}")
 add_definitions(-DPACKAGE_LOCALE_DIR="${CMAKE_INSTALL_FULL_LOCALEDIR}")
 add_definitions(-DLIBDIR="${CMAKE_INSTALL_FULL_LIBDIR}")
 
+set(WebKit2_USE_PREFIX_HEADER ON)
+
 list(APPEND WebKit2_SOURCES
     ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2InspectorGResourceBundle.c
     ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.c
@@ -374,12 +376,6 @@ file(GLOB InspectorFiles
     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/*.js
 )
 
-list(APPEND WebKit2_MESSAGES_IN_FILES
-    UIProcess/soup/WebSoupRequestManagerProxy.messages.in
-
-    WebProcess/soup/WebSoupRequestManager.messages.in
-)
-
 # This is necessary because of a conflict between the GTK+ API WebKitVersion.h and one generated by WebCore.
 list(INSERT WebKit2_INCLUDE_DIRECTORIES 0
     "${FORWARDING_HEADERS_WEBKIT2GTK_DIR}"
@@ -396,6 +392,7 @@ list(APPEND WebKit2_INCLUDE_DIRECTORIES
     "${WEBCORE_DIR}/platform/network/soup"
     "${WEBCORE_DIR}/platform/text/enchant"
     "${WEBKIT2_DIR}/Shared/API/c/gtk"
+    "${WEBKIT2_DIR}/Shared/Network/CustomProtocols/soup"
     "${WEBKIT2_DIR}/Shared/Downloads/soup"
     "${WEBKIT2_DIR}/Shared/gtk"
     "${WEBKIT2_DIR}/Shared/soup"
@@ -621,6 +618,7 @@ if (ENABLE_PLUGIN_PROCESS)
     GENERATE_WEBKIT2_MESSAGE_SOURCES(PluginProcess_SOURCES "${PluginProcess_MESSAGES_IN_FILES}")
 
     add_executable(WebKitPluginProcess ${PluginProcess_SOURCES})
+    add_webkit2_prefix_header(WebKitPluginProcess)
 
     # We need ENABLE_PLUGIN_PROCESS for all targets in this directory, but
     # we only want GTK_API_VERSION_2 for the plugin process target.
@@ -665,10 +663,9 @@ include_directories(
     "${FORWARDING_HEADERS_WEBKIT2GTK_DIR}"
 )
 
-add_library(webkit2gtkinjectedbundle MODULE
-    "${WEBKIT2_DIR}/WebProcess/gtk/WebGtkInjectedBundleMain.cpp"
-)
+add_library(webkit2gtkinjectedbundle MODULE "${WEBKIT2_DIR}/WebProcess/gtk/WebGtkInjectedBundleMain.cpp")
 add_dependencies(webkit2gtkinjectedbundle GObjectDOMBindings)
+add_webkit2_prefix_header(webkit2gtkinjectedbundle)
 
 add_custom_command(
     OUTPUT ${CMAKE_BINARY_DIR}/WebKit2-3.0.gir
index 3c17708..9ae33e4 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#if defined (BUILDING_GTK__)
+#if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H
+#ifdef BUILDING_WITH_CMAKE
+#include "cmakeconfig.h"
+#else
 #include "autotoolsconfig.h"
-#endif /* defined (BUILDING_GTK__) */
+#endif
+#endif
 
 #include <wtf/Platform.h>