Home | History | Annotate | Download | only in Source
      1 # Include file to make it easy to include WebKit into Qt projects
      2 
      3 contains(QT_CONFIG, qpa):CONFIG += embedded
      4 
      5 # Detect that we are building as a standalone package by the presence of
      6 # either the generated files directory or as part of the Qt package through
      7 # QTDIR_build
      8 CONFIG(QTDIR_build) {
      9     CONFIG += standalone_package
     10     # Make sure we compile both debug and release on mac when inside Qt.
     11     # This line was extracted from qbase.pri instead of including the whole file
     12     win32|mac:!macx-xcode:CONFIG += debug_and_release
     13 } else {
     14     !CONFIG(release, debug|release) {
     15         OBJECTS_DIR = obj/debug
     16     } else { # Release
     17         OBJECTS_DIR = obj/release
     18         DEFINES *= NDEBUG
     19     }
     20     exists($$PWD/WebCore/generated):CONFIG += standalone_package
     21     # Make sure that build_all follows the build_all config in WebCore
     22     mac:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework):!build_pass:CONFIG += build_all
     23 }
     24 
     25 CONFIG(standalone_package): DEFINES *= NDEBUG
     26 
     27 CONFIG += depend_includepath
     28 DEPENDPATH += $$OUT_PWD
     29 
     30 DEFINES += BUILDING_QT__=1
     31 building-libs {
     32     win32-msvc*|win32-icc: INCLUDEPATH += $$PWD/JavaScriptCore/os-win32
     33 } else {
     34     CONFIG(QTDIR_build) {
     35         QT += webkit
     36     } else {
     37         QMAKE_LIBDIR = $$OUTPUT_DIR/lib $$QMAKE_LIBDIR
     38         QTWEBKITLIBNAME = QtWebKit
     39         mac:!static:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework) {
     40             LIBS += -framework $$QTWEBKITLIBNAME
     41             QMAKE_FRAMEWORKPATH = $$OUTPUT_DIR/lib $$QMAKE_FRAMEWORKPATH
     42         } else {
     43             build_pass: win32-*|wince* {
     44                 !CONFIG(release, debug|release): QTWEBKITLIBNAME = $${QTWEBKITLIBNAME}d
     45                 QTWEBKITLIBNAME = $${QTWEBKITLIBNAME}$${QT_MAJOR_VERSION}
     46                 win32-g++*: LIBS += -l$$QTWEBKITLIBNAME
     47                 else: LIBS += $${QTWEBKITLIBNAME}.lib
     48             } else {
     49                 LIBS += -lQtWebKit
     50                 symbian {
     51                     TARGET.EPOCSTACKSIZE = 0x14000 // 80 kB
     52                     # For EXEs only: set heap to usable value
     53                     TARGET.EPOCHEAPSIZE =
     54                     heapSizeRule = \
     55                     "$${LITERAL_HASH}ifdef WINSCW" \
     56                         "EPOCHEAPSIZE  0x40000 0x2000000 // Min 256kB, Max 32MB" \
     57                     "$${LITERAL_HASH}else" \
     58                         "EPOCHEAPSIZE  0x40000 0x10000000 // Min 256kB, Max 256MB" \
     59                     "$${LITERAL_HASH}endif"
     60                     MMP_RULES += heapSizeRule
     61                 }
     62             }
     63         }
     64     }
     65     DEPENDPATH += $$PWD/WebKit/qt/Api
     66 }
     67 
     68 CONFIG(release, debug|release) {
     69     DEFINES += NDEBUG
     70 }
     71 
     72 INCLUDEPATH += \
     73     $$PWD \
     74     $$OUTPUT_DIR/include/QtWebKit \
     75     $$OUTPUT_DIR/include \
     76     $$QT.script.includes
     77 
     78 DEFINES += QT_ASCII_CAST_WARNINGS
     79 
     80 webkit2:INCLUDEPATH *= $$OUTPUT_DIR/include/WebKit2
     81 
     82 # Pick up 3rdparty libraries from INCLUDE/LIB just like with MSVC
     83 win32-g++* {
     84     TMPPATH            = $$quote($$(INCLUDE))
     85     QMAKE_INCDIR_POST += $$split(TMPPATH,";")
     86     TMPPATH            = $$quote($$(LIB))
     87     QMAKE_LIBDIR_POST += $$split(TMPPATH,";")
     88 }
     89 
     90 CONFIG -= warn_on
     91 *-g++*:QMAKE_CXXFLAGS += -Wall -Wextra -Wreturn-type -fno-strict-aliasing -Wcast-align -Wchar-subscripts -Wformat-security -Wreturn-type -Wno-unused-parameter -Wno-sign-compare -Wno-switch -Wno-switch-enum -Wundef -Wmissing-noreturn -Winit-self
     92 
     93 # Treat warnings as errors on x86/Linux/GCC
     94 linux-g++* {
     95     isEqual(QT_ARCH,x86_64)|isEqual(QT_ARCH,i386): QMAKE_CXXFLAGS += -Werror
     96 }
     97 
     98 symbian|*-armcc {
     99     # Enable GNU compiler extensions to the ARM compiler for all Qt ports using RVCT
    100     RVCT_COMMON_CFLAGS = --gnu --diag_suppress 68,111,177,368,830,1293 --signed_bitfields
    101     RVCT_COMMON_CXXFLAGS = $$RVCT_COMMON_CFLAGS --no_parse_templates
    102     # Make debug symbols leaner in RVCT4.x. Ignored by compiler for release builds
    103     QMAKE_CXXFLAGS.ARMCC_4_0 += --remove_unneeded_entities
    104 }
    105 
    106 *-armcc {
    107     QMAKE_CFLAGS += $$RVCT_COMMON_CFLAGS
    108     QMAKE_CXXFLAGS += $$RVCT_COMMON_CXXFLAGS
    109 }
    110 
    111 symbian {
    112     QMAKE_CXXFLAGS.ARMCC += $$RVCT_COMMON_CXXFLAGS
    113 }
    114 
    115 valgrind {
    116     contains(JAVASCRIPTCORE_JIT,yes): error("'JAVASCRIPTCORE_JIT=yes' not supported with valgrind")
    117     QMAKE_CXXFLAGS += -g
    118     QMAKE_LFLAGS += -g
    119     DEFINES += USE_SYSTEM_MALLOC=1
    120     DEFINES += ENABLE_JIT=0
    121     JAVASCRIPTCORE_JIT = no
    122 }
    123 
    124 # Disable dependency to a specific version of a Qt package for non-production builds
    125 symbian:!CONFIG(production):default_deployment.pkg_prerules -= pkg_depends_qt
    126 
    127 ##### Defaults for some mobile platforms
    128 symbian|maemo5|maemo6 {
    129     CONFIG += disable_uitools
    130     CONFIG += enable_fast_mobile_scrolling
    131     CONFIG += use_qt_mobile_theme
    132     maemo6: CONFIG += include_webinspector
    133 } else {
    134     CONFIG += include_webinspector
    135 }
    136 
    137 *sh4* {
    138     CONFIG += disable_uitools
    139 }
    140 ####
    141 
    142 disable_uitools: DEFINES *= QT_NO_UITOOLS
    143 
    144 isEmpty(QT.phonon.includes) {
    145     QT.phonon.includes = $$QMAKE_INCDIR_QT/phonon
    146     QT.phonon.libs = $$QMAKE_LIBDIR_QT
    147 }
    148 
    149 # Disable a few warnings on Windows. The warnings are also
    150 # disabled in WebKitLibraries/win/tools/vsprops/common.vsprops
    151 win32-msvc*|wince*: QMAKE_CXXFLAGS += -wd4291 -wd4344 -wd4396 -wd4503 -wd4800 -wd4819 -wd4996
    152 
    153 CONFIG(qt_minimal) {
    154     DEFINES *= QT_NO_ANIMATION
    155     DEFINES *= QT_NO_BEARERMANAGEMENT
    156     DEFINES *= QT_NO_CLIPBOARD
    157     DEFINES *= QT_NO_COMBOBOX
    158     DEFINES *= QT_NO_CONCURRENT
    159     DEFINES *= QT_NO_CRASHHANDLER
    160     DEFINES *= QT_NO_CURSOR
    161     DEFINES *= QT_NO_DESKTOPSERVICES
    162     DEFINES *= QT_NO_FILEDIALOG
    163     DEFINES *= QT_NO_GRAPHICSEFFECT
    164     DEFINES *= QT_NO_IM
    165     DEFINES *= QT_NO_INPUTDIALOG
    166     DEFINES *= QT_NO_LINEEDIT
    167     DEFINES *= QT_NO_MESSAGEBOX
    168     DEFINES *= QT_NO_OPENSSL
    169     DEFINES *= QT_NO_PRINTER
    170     DEFINES *= QT_NO_QUUID_STRING
    171     DEFINES *= QT_NO_SHORTCUT
    172     DEFINES *= QT_NO_STYLE_STYLESHEET
    173     DEFINES *= QT_NO_SYSTEMTRAYICON
    174     DEFINES *= QT_NO_TEMPORARYFILE
    175     DEFINES *= QT_NO_TOOLTIP
    176     DEFINES *= QT_NO_UITOOLS
    177     DEFINES *= QT_NO_UNDOCOMMAND
    178     DEFINES *= QT_NO_UNDOSTACK
    179     DEFINES *= QT_NO_XRENDER
    180 }
    181 
    182 contains(DEFINES, QT_NO_UITOOLS): CONFIG -= uitools
    183