Title: [101089] trunk
Revision
101089
Author
ves...@webkit.org
Date
2011-11-23 10:19:18 -0800 (Wed, 23 Nov 2011)

Log Message

[Qt] Re-generate QtWebKit API forwarding headers when API changes

The forwarding headers are generated by syncqt, and syncqt is run by qmake,
so we need sync.profile to live in the same directory as the project file
that will be touched when adding/removing API (api.pri in our case).

Since the WebKit2 APIs live in a separate static library, we have to
add the project file for WebKit2 as a dependency of the api.pri file
as well, so that any changes to the WebKit2 API will still trigger a
run of qmake (and then syncqt).

Lastly, we use the new QMAKE_SYNCQT_OUTDIR variable in Qt 5 to ensure
that the forwarding headers are still generated in the root build dir,
not in the Source dir along with the internal forwarding headers.

Reviewed by Andreas Kling.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/ChangeLog (101088 => 101089)


--- trunk/ChangeLog	2011-11-23 18:12:59 UTC (rev 101088)
+++ trunk/ChangeLog	2011-11-23 18:19:18 UTC (rev 101089)
@@ -1,3 +1,26 @@
+2011-11-23  Tor Arne Vestbø  <tor.arne.ves...@nokia.com>
+
+        [Qt] Re-generate QtWebKit API forwarding headers when API changes
+
+        The forwarding headers are generated by syncqt, and syncqt is run by qmake,
+        so we need sync.profile to live in the same directory as the project file
+        that will be touched when adding/removing API (api.pri in our case).
+
+        Since the WebKit2 APIs live in a separate static library, we have to
+        add the project file for WebKit2 as a dependency of the api.pri file
+        as well, so that any changes to the WebKit2 API will still trigger a
+        run of qmake (and then syncqt).
+
+        Lastly, we use the new QMAKE_SYNCQT_OUTDIR variable in Qt 5 to ensure
+        that the forwarding headers are still generated in the root build dir,
+        not in the Source dir along with the internal forwarding headers.
+
+        Reviewed by Andreas Kling.
+
+        * Source/QtWebKit.pro:
+        * Source/api.pri:
+        * Source/sync.profile: Renamed from sync.profile.
+
 2011-11-23  Halton Huo  <halton....@intel.com>
 
         [EFL] Add zlib depend when freetype is used.

Modified: trunk/Source/QtWebKit.pro (101088 => 101089)


--- trunk/Source/QtWebKit.pro	2011-11-23 18:12:59 UTC (rev 101088)
+++ trunk/Source/QtWebKit.pro	2011-11-23 18:19:18 UTC (rev 101089)
@@ -29,30 +29,3 @@
 examples.makefile = Makefile
 SUBDIRS += examples
 
-haveQt(4):!build_pass {
-    # Use our own copy of syncqt from Qt 4.8 to generate forwarding headers
-    syncqt = $$toSystemPath($${ROOT_WEBKIT_DIR}/Tools/qmake/syncqt-4.8)
-    command = $$syncqt
-    win32-msvc*: command = $$command -windows
-
-    outdir = $$toSystemPath($${ROOT_BUILD_DIR})
-
-    # The module root has to be the same as directory of the pro-file that generates
-    # the install rules (api.pri), otherwise the relative paths in the generated
-    # headers.pri will be incorrect.
-    module_rootdir = $$toSystemPath($${_PRO_FILE_PWD_})
-
-    module = $${TARGET}$${DIRLIST_SEPARATOR}$${module_rootdir}$${DIRLIST_SEPARATOR}$$toSystemPath(WebKit/qt/Api)
-    fwheader_generator.commands = perl $${command} -outdir $${outdir} -separate-module $${module}
-    fwheader_generator.depends = $${syncqt}
-
-    variables = $$computeSubdirVariables(api)
-
-    api_qmake.target = $$eval($${variables}.target)-qmake_all
-    api_qmake.depends = fwheader_generator
-
-    api_makefile.target = $$eval($${variables}.makefile)
-    api_makefile.depends = fwheader_generator
-
-    QMAKE_EXTRA_TARGETS += fwheader_generator api_qmake api_makefile
-}

Modified: trunk/Source/api.pri (101088 => 101089)


--- trunk/Source/api.pri	2011-11-23 18:12:59 UTC (rev 101088)
+++ trunk/Source/api.pri	2011-11-23 18:19:18 UTC (rev 101089)
@@ -9,6 +9,8 @@
 
 DESTDIR = $${ROOT_BUILD_DIR}/lib
 
+runSyncQt() # Generate forwarding headers for the QtWebKit API
+
 load(features)
 
 include(WebKit/WebKit.pri)
@@ -20,6 +22,10 @@
 !no_webkit2 {
     CONFIG += webkit2
     QT += declarative
+
+    # Ensure that changes to the WebKit2 API will trigger a qmake of this
+    # file, which in turn runs syncqt to update the forwarding headers.
+    QMAKE_INTERNAL_INCLUDED_FILES *= WebKit2/Target.pri
 }
 
 v8:linux-* {

Copied: trunk/Source/sync.profile (from rev 101088, trunk/sync.profile) (0 => 101089)


--- trunk/Source/sync.profile	                        (rev 0)
+++ trunk/Source/sync.profile	2011-11-23 18:19:18 UTC (rev 101089)
@@ -0,0 +1,18 @@
+%modules = ( # path to module name map
+    "QtWebKit" => "$basedir"
+);
+%moduleheaders = ( # restrict the module headers to those found in relative path
+    "QtWebKit" => "WebKit/qt/Api;WebKit2/UIProcess/API/qt",
+);
+%classnames = (
+);
+%mastercontent = (
+    "core" => "#include <QtCore/QtCore>\n",
+    "gui" => "#include <QtGui/QtGui>\n",
+    "network" => "#include <QtNetwork/QtNetwork>\n",
+    "script" => "#include <QtScript/QtScript>\n",
+);
+%modulepris = (
+    "QtWebKit" => "$basedir/../Tools/qmake/mkspecs/modules/qt_webkit.pri",
+);
+@ignore_for_master_contents = ( "qwebscriptworld.h" );

Modified: trunk/Tools/ChangeLog (101088 => 101089)


--- trunk/Tools/ChangeLog	2011-11-23 18:12:59 UTC (rev 101088)
+++ trunk/Tools/ChangeLog	2011-11-23 18:19:18 UTC (rev 101089)
@@ -1,3 +1,25 @@
+2011-11-23  Tor Arne Vestbø  <tor.arne.ves...@nokia.com>
+
+        [Qt] Re-generate QtWebKit API forwarding headers when API changes
+
+        The forwarding headers are generated by syncqt, and syncqt is run by qmake,
+        so we need sync.profile to live in the same directory as the project file
+        that will be touched when adding/removing API (api.pri in our case).
+
+        Since the WebKit2 APIs live in a separate static library, we have to
+        add the project file for WebKit2 as a dependency of the api.pri file
+        as well, so that any changes to the WebKit2 API will still trigger a
+        run of qmake (and then syncqt).
+
+        Lastly, we use the new QMAKE_SYNCQT_OUTDIR variable in Qt 5 to ensure
+        that the forwarding headers are still generated in the root build dir,
+        not in the Source dir along with the internal forwarding headers.
+
+        Reviewed by Andreas Kling.
+
+        * qmake/mkspecs/features/default_pre.prf:
+        * qmake/mkspecs/features/functions.prf:
+
 2011-11-23  Johnny Ding  <j...@chromium.org>
 
         Set right default value to baseURL in LayoutTestController::queueLoadHTMLString.

Modified: trunk/Tools/qmake/mkspecs/features/default_pre.prf (101088 => 101089)


--- trunk/Tools/qmake/mkspecs/features/default_pre.prf	2011-11-23 18:12:59 UTC (rev 101088)
+++ trunk/Tools/qmake/mkspecs/features/default_pre.prf	2011-11-23 18:19:18 UTC (rev 101089)
@@ -5,7 +5,6 @@
 # See 'Tools/qmake/README' for an overview of the build system
 # -------------------------------------------------------------------
 
-load(default_pre) # Load Qt's defaults
 load(functions)
 
 # FIXME: In this case we probably want to exit early so that we
@@ -45,6 +44,13 @@
 
 BUILD_SUBDIR = $$join(BUILD_SUBDIR, $${QMAKE_DIR_SEP})
 
+# We want the QtWebKit API forwarding includes to live in the root build dir,
+# except when we are running the config.tests in Tools/qmake.
+pro_file_name = $$basename(_PRO_FILE_)
+!equals(pro_file_name, configure.pro): QMAKE_SYNCQT_OUTDIR = $$ROOT_BUILD_DIR
+
+load(default_pre) # Load Qt's defaults after we've resolved the build directory
+
 equals(OUT_PWD, $${ROOT_BUILD_DIR}) {
     !recursive_include:CONFIG += root_project_file
     BUILD_ROOT_RELATIVE_TO_OUT_PWD = .

Modified: trunk/Tools/qmake/mkspecs/features/functions.prf (101088 => 101089)


--- trunk/Tools/qmake/mkspecs/features/functions.prf	2011-11-23 18:12:59 UTC (rev 101088)
+++ trunk/Tools/qmake/mkspecs/features/functions.prf	2011-11-23 18:19:18 UTC (rev 101089)
@@ -280,3 +280,33 @@
     export(CONFIG)
     return(true)
 }
+
+defineTest(runSyncQt) {
+
+    build_pass:return(true)
+
+    haveQt(5) {
+        # Qt 5 will run synqt as part of defaults_pre, so no need to do anything
+    } else {
+        # Use our own copy of syncqt from Qt 4.8 to generate forwarding headers
+        syncqt = $$toSystemPath($${ROOT_WEBKIT_DIR}/Tools/qmake/syncqt-4.8)
+        command = $$syncqt
+        win32-msvc*: command = $$command -windows
+
+        outdir = $$toSystemPath($${ROOT_BUILD_DIR})
+
+        # The module root has to be the same as directory of the pro-file that generates
+        # the install rules (api.pri), otherwise the relative paths in the generated
+        # headers.pri will be incorrect.
+        module_rootdir = $$toSystemPath($${_PRO_FILE_PWD_})
+
+        module = $${TARGET}$${DIRLIST_SEPARATOR}$${module_rootdir}$${DIRLIST_SEPARATOR}$$toSystemPath(WebKit/qt/Api)
+        command = perl $${command} -outdir $${outdir} -separate-module $${module}
+        message(Running $$command)
+        !system($$command) {
+            error(Failed to run $${command})
+        }
+    }
+
+    return(true)
+}

Deleted: trunk/sync.profile (101088 => 101089)


--- trunk/sync.profile	2011-11-23 18:12:59 UTC (rev 101088)
+++ trunk/sync.profile	2011-11-23 18:19:18 UTC (rev 101089)
@@ -1,20 +0,0 @@
-%modules = ( # path to module name map
-    # Has to be the same directory as the pro file that generates install rules,
-    # otherwise the relative paths in headers.pri will not be correct.
-    "QtWebKit" => "$basedir/Source"
-);
-%moduleheaders = ( # restrict the module headers to those found in relative path
-    "QtWebKit" => "WebKit/qt/Api;WebKit2/UIProcess/API/qt",
-);
-%classnames = (
-);
-%mastercontent = (
-    "core" => "#include <QtCore/QtCore>\n",
-    "gui" => "#include <QtGui/QtGui>\n",
-    "network" => "#include <QtNetwork/QtNetwork>\n",
-    "script" => "#include <QtScript/QtScript>\n",
-);
-%modulepris = (
-    "QtWebKit" => "$basedir/Tools/qmake/mkspecs/modules/qt_webkit.pri",
-);
-@ignore_for_master_contents = ( "qwebscriptworld.h" );
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to