Changeset 101089 in webkit


Ignore:
Timestamp:
Nov 23, 2011, 10:19:18 AM (13 years ago)
Author:
vestbo@webkit.org
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.

Location:
trunk
Files:
6 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r101079 r101089  
     12011-11-23  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     2
     3        [Qt] Re-generate QtWebKit API forwarding headers when API changes
     4
     5        The forwarding headers are generated by syncqt, and syncqt is run by qmake,
     6        so we need sync.profile to live in the same directory as the project file
     7        that will be touched when adding/removing API (api.pri in our case).
     8
     9        Since the WebKit2 APIs live in a separate static library, we have to
     10        add the project file for WebKit2 as a dependency of the api.pri file
     11        as well, so that any changes to the WebKit2 API will still trigger a
     12        run of qmake (and then syncqt).
     13
     14        Lastly, we use the new QMAKE_SYNCQT_OUTDIR variable in Qt 5 to ensure
     15        that the forwarding headers are still generated in the root build dir,
     16        not in the Source dir along with the internal forwarding headers.
     17
     18        Reviewed by Andreas Kling.
     19
     20        * Source/QtWebKit.pro:
     21        * Source/api.pri:
     22        * Source/sync.profile: Renamed from sync.profile.
     23
    1242011-11-23  Halton Huo  <halton.huo@intel.com>
    225
  • trunk/Source/QtWebKit.pro

    r100602 r101089  
    3030SUBDIRS += examples
    3131
    32 haveQt(4):!build_pass {
    33     # Use our own copy of syncqt from Qt 4.8 to generate forwarding headers
    34     syncqt = $$toSystemPath($${ROOT_WEBKIT_DIR}/Tools/qmake/syncqt-4.8)
    35     command = $$syncqt
    36     win32-msvc*: command = $$command -windows
    37 
    38     outdir = $$toSystemPath($${ROOT_BUILD_DIR})
    39 
    40     # The module root has to be the same as directory of the pro-file that generates
    41     # the install rules (api.pri), otherwise the relative paths in the generated
    42     # headers.pri will be incorrect.
    43     module_rootdir = $$toSystemPath($${_PRO_FILE_PWD_})
    44 
    45     module = $${TARGET}$${DIRLIST_SEPARATOR}$${module_rootdir}$${DIRLIST_SEPARATOR}$$toSystemPath(WebKit/qt/Api)
    46     fwheader_generator.commands = perl $${command} -outdir $${outdir} -separate-module $${module}
    47     fwheader_generator.depends = $${syncqt}
    48 
    49     variables = $$computeSubdirVariables(api)
    50 
    51     api_qmake.target = $$eval($${variables}.target)-qmake_all
    52     api_qmake.depends = fwheader_generator
    53 
    54     api_makefile.target = $$eval($${variables}.makefile)
    55     api_makefile.depends = fwheader_generator
    56 
    57     QMAKE_EXTRA_TARGETS += fwheader_generator api_qmake api_makefile
    58 }
  • trunk/Source/api.pri

    r100853 r101089  
    1010DESTDIR = $${ROOT_BUILD_DIR}/lib
    1111
     12runSyncQt() # Generate forwarding headers for the QtWebKit API
     13
    1214load(features)
    1315
     
    2123    CONFIG += webkit2
    2224    QT += declarative
     25
     26    # Ensure that changes to the WebKit2 API will trigger a qmake of this
     27    # file, which in turn runs syncqt to update the forwarding headers.
     28    QMAKE_INTERNAL_INCLUDED_FILES *= WebKit2/Target.pri
    2329}
    2430
  • trunk/Source/sync.profile

    r101088 r101089  
    11%modules = ( # path to module name map
    2     # Has to be the same directory as the pro file that generates install rules,
    3     # otherwise the relative paths in headers.pri will not be correct.
    4     "QtWebKit" => "$basedir/Source"
     2    "QtWebKit" => "$basedir"
    53);
    64%moduleheaders = ( # restrict the module headers to those found in relative path
     
    1614);
    1715%modulepris = (
    18     "QtWebKit" => "$basedir/Tools/qmake/mkspecs/modules/qt_webkit.pri",
     16    "QtWebKit" => "$basedir/../Tools/qmake/mkspecs/modules/qt_webkit.pri",
    1917);
    2018@ignore_for_master_contents = ( "qwebscriptworld.h" );
  • trunk/Tools/ChangeLog

    r101076 r101089  
     12011-11-23  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     2
     3        [Qt] Re-generate QtWebKit API forwarding headers when API changes
     4
     5        The forwarding headers are generated by syncqt, and syncqt is run by qmake,
     6        so we need sync.profile to live in the same directory as the project file
     7        that will be touched when adding/removing API (api.pri in our case).
     8
     9        Since the WebKit2 APIs live in a separate static library, we have to
     10        add the project file for WebKit2 as a dependency of the api.pri file
     11        as well, so that any changes to the WebKit2 API will still trigger a
     12        run of qmake (and then syncqt).
     13
     14        Lastly, we use the new QMAKE_SYNCQT_OUTDIR variable in Qt 5 to ensure
     15        that the forwarding headers are still generated in the root build dir,
     16        not in the Source dir along with the internal forwarding headers.
     17
     18        Reviewed by Andreas Kling.
     19
     20        * qmake/mkspecs/features/default_pre.prf:
     21        * qmake/mkspecs/features/functions.prf:
     22
    1232011-11-23  Johnny Ding  <jnd@chromium.org>
    224
  • trunk/Tools/qmake/mkspecs/features/default_pre.prf

    r100602 r101089  
    66# -------------------------------------------------------------------
    77
    8 load(default_pre) # Load Qt's defaults
    98load(functions)
    109
     
    4544
    4645BUILD_SUBDIR = $$join(BUILD_SUBDIR, $${QMAKE_DIR_SEP})
     46
     47# We want the QtWebKit API forwarding includes to live in the root build dir,
     48# except when we are running the config.tests in Tools/qmake.
     49pro_file_name = $$basename(_PRO_FILE_)
     50!equals(pro_file_name, configure.pro): QMAKE_SYNCQT_OUTDIR = $$ROOT_BUILD_DIR
     51
     52load(default_pre) # Load Qt's defaults after we've resolved the build directory
    4753
    4854equals(OUT_PWD, $${ROOT_BUILD_DIR}) {
  • trunk/Tools/qmake/mkspecs/features/functions.prf

    r100952 r101089  
    281281    return(true)
    282282}
     283
     284defineTest(runSyncQt) {
     285
     286    build_pass:return(true)
     287
     288    haveQt(5) {
     289        # Qt 5 will run synqt as part of defaults_pre, so no need to do anything
     290    } else {
     291        # Use our own copy of syncqt from Qt 4.8 to generate forwarding headers
     292        syncqt = $$toSystemPath($${ROOT_WEBKIT_DIR}/Tools/qmake/syncqt-4.8)
     293        command = $$syncqt
     294        win32-msvc*: command = $$command -windows
     295
     296        outdir = $$toSystemPath($${ROOT_BUILD_DIR})
     297
     298        # The module root has to be the same as directory of the pro-file that generates
     299        # the install rules (api.pri), otherwise the relative paths in the generated
     300        # headers.pri will be incorrect.
     301        module_rootdir = $$toSystemPath($${_PRO_FILE_PWD_})
     302
     303        module = $${TARGET}$${DIRLIST_SEPARATOR}$${module_rootdir}$${DIRLIST_SEPARATOR}$$toSystemPath(WebKit/qt/Api)
     304        command = perl $${command} -outdir $${outdir} -separate-module $${module}
     305        message(Running $$command)
     306        !system($$command) {
     307            error(Failed to run $${command})
     308        }
     309    }
     310
     311    return(true)
     312}
Note: See TracChangeset for help on using the changeset viewer.