2010-08-11 James Hawkins <jhawkins@chromium.org>
[WebKit-https.git] / WebKit.pri
index ce32d28..21404dd 100644 (file)
 # Include file to make it easy to include WebKit into Qt projects
 
-
-isEmpty(OUTPUT_DIR) {
-    CONFIG(release):OUTPUT_DIR=$$PWD/WebKitBuild/Release
-    CONFIG(debug):OUTPUT_DIR=$$PWD/WebKitBuild/Debug
-}
-
-!gtk-port:CONFIG += qt-port
-qt-port:DEFINES += BUILDING_QT__=1
-qt-port:!building-libs {
-    QMAKE_LIBDIR = $$OUTPUT_DIR/lib $$QMAKE_LIBDIR
-    LIBS += -lQtWebKit
+# Detect that we are building as a standalone package by the presence of
+# either the generated files directory or as part of the Qt package through
+# QTDIR_build
+CONFIG(QTDIR_build): CONFIG += standalone_package
+else:exists($$PWD/WebCore/generated): CONFIG += standalone_package
+
+CONFIG += depend_includepath
+
+DEFINES += BUILDING_QT__=1
+building-libs {
+    win32-msvc*|win32-icc: INCLUDEPATH += $$PWD/JavaScriptCore/os-win32
+} else {
+    CONFIG(QTDIR_build) {
+        QT += webkit
+    } else {
+        QMAKE_LIBDIR = $$OUTPUT_DIR/lib $$QMAKE_LIBDIR
+        QTWEBKITLIBNAME = QtWebKit
+        mac:!static:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework) {
+            LIBS += -framework $$QTWEBKITLIBNAME
+            QMAKE_FRAMEWORKPATH = $$OUTPUT_DIR/lib $$QMAKE_FRAMEWORKPATH
+        } else {
+            build_pass: win32-*|wince* {
+                !CONFIG(release, debug|release): QTWEBKITLIBNAME = $${QTWEBKITLIBNAME}d
+                QTWEBKITLIBNAME = $${QTWEBKITLIBNAME}$${QT_MAJOR_VERSION}
+                win32-g++*: LIBS += -l$$QTWEBKITLIBNAME
+                else: LIBS += $${QTWEBKITLIBNAME}.lib
+            } else {
+                LIBS += -lQtWebKit
+                symbian {
+                    TARGET.EPOCSTACKSIZE = 0x14000 // 80 kB
+                    # For EXEs only: set heap to usable value
+                    TARGET.EPOCHEAPSIZE = 
+                    heapSizeRule = \
+                    "$${LITERAL_HASH}ifdef WINSCW" \
+                        "EPOCHEAPSIZE  0x40000 0x2000000 // Min 256kB, Max 32MB" \
+                    "$${LITERAL_HASH}else" \
+                        "EPOCHEAPSIZE  0x40000 0x6000000 // Min 256kB, Max 96MB" \
+                    "$${LITERAL_HASH}endif"
+                    MMP_RULES += heapSizeRule
+                }
+            }
+        }
+    }
     DEPENDPATH += $$PWD/WebKit/qt/Api
 }
+greaterThan(QT_MINOR_VERSION, 5):DEFINES += WTF_USE_ACCELERATED_COMPOSITING
 
-gtk-port:!building-libs {
-    QMAKE_LIBDIR = $$OUTPUT_DIR/lib $$QMAKE_LIBDIR
-    LIBS += -lWebKitGtk
-    DEPENDPATH += $$PWD/WebKit/gtk/WebView $$PWD/WebKit/gtk/WebCoreSupport
+!mac:!unix|symbian {
+    DEFINES += USE_SYSTEM_MALLOC
 }
 
-gtk-port {
-    CONFIG += link_pkgconfig
-
-    DEFINES += BUILDING_CAIRO__=1 BUILDING_GTK__=1
-
-    # We use FreeType directly with Cairo
-    PKGCONFIG += cairo-ft
-
-    directfb: PKGCONFIG += cairo-directfb gtk+-directfb-2.0
-    else: PKGCONFIG += cairo gtk+-2.0
-
-    # Set a CONFIG flag for the GTK+ target (x11, quartz, win32, directfb)
-    CONFIG += $$system(pkg-config --variable=target $$PKGCONFIG)
-
-    # We use the curl http backend on all platforms
-    PKGCONFIG += libcurl
-
-    LIBS += -lWebKitGtk -ljpeg -lpng
+CONFIG(release, debug|release) {
+    DEFINES += NDEBUG
+}
 
-    QMAKE_CXXFLAGS += $$system(icu-config --cppflags)
-    QMAKE_LIBS += $$system(icu-config --ldflags)
+BASE_DIR = $$PWD
 
-    # This set of warnings is borrowed from the Mac build
-    QMAKE_CXXFLAGS += -Wall -W -Wcast-align -Wchar-subscripts -Wformat-security -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-format-y2k -Wno-unused-parameter -Wundef
+symbian {
+    INCLUDEPATH += $$PWD/include/QtWebKit
+} else {
+    INCLUDEPATH += $$OUTPUT_DIR/include/QtWebKit
+}
 
-    # These flags are based on optimization experience from the Mac port:
-    # Helps code size significantly and speed a little
-    QMAKE_CXXFLAGS += -fno-exceptions -fno-rtti
+CONFIG -= warn_on
+*-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
 
-    DEPENDPATH += $$PWD/JavaScriptCore/API
-    INCLUDEPATH += $$PWD
+# Enable GNU compiler extensions to the ARM compiler for all Qt ports using RVCT
+symbian|*-armcc {
+    RVCT_COMMON_CFLAGS = --gnu --diag_suppress 68,111,177,368,830,1293
+    RVCT_COMMON_CXXFLAGS = $$RVCT_COMMON_CFLAGS --no_parse_templates
 }
 
-DEFINES += USE_SYSTEM_MALLOC
-CONFIG(release) {
-    DEFINES += NDEBUG
+*-armcc {
+    QMAKE_CFLAGS += $$RVCT_COMMON_CFLAGS
+    QMAKE_CXXFLAGS += $$RVCT_COMMON_CXXFLAGS
 }
 
-gtk-port:CONFIG(debug) {
-    DEFINES += G_DISABLE_DEPRECATED GDK_PIXBUF_DISABLE_DEPRECATED GDK_DISABLE_DEPRECATED GTK_DISABLE_DEPRECATED PANGO_DISABLE_DEPRECATED GDK_MULTIHEAD_SAFE GTK_MULTIHEAD_SAFE
+symbian {
+    QMAKE_CXXFLAGS.ARMCC += $$RVCT_COMMON_CXXFLAGS
 }
 
-BASE_DIR = $$PWD
-qt-port:INCLUDEPATH += \
-    $$PWD/WebKit/qt/Api
-gtk-port:INCLUDEPATH += \
-    $$BASE_DIR/WebCore/platform/gtk \
-    $$BASE_DIR/WebCore/platform/network/curl \
-    $$BASE_DIR/WebCore/platform/graphics/cairo \
-    $$BASE_DIR/WebCore/loader/gtk \
-    $$BASE_DIR/WebCore/page/gtk \
-    $$BASE_DIR/WebKit/gtk/WebView \
-    $$BASE_DIR/WebKit/gtk/WebCoreSupport
-INCLUDEPATH += \
-    $$BASE_DIR/JavaScriptCore/ \
-    $$BASE_DIR/JavaScriptCore/kjs \
-    $$BASE_DIR/JavaScriptCore/bindings \
-    $$BASE_DIR/JavaScriptCore/bindings/c \
-    $$BASE_DIR/JavaScriptCore/wtf \
-    $$BASE_DIR/JavaScriptCore/ForwardingHeaders \
-    $$BASE_DIR/WebCore \
-    $$BASE_DIR/WebCore/ForwardingHeaders \
-    $$BASE_DIR/WebCore/platform \
-    $$BASE_DIR/WebCore/platform/network \
-    $$BASE_DIR/WebCore/platform/graphics \
-    $$BASE_DIR/WebCore/loader \
-    $$BASE_DIR/WebCore/page \
-    $$BASE_DIR/WebCore/css \
-    $$BASE_DIR/WebCore/dom \
-    $$BASE_DIR/WebCore/bridge \
-    $$BASE_DIR/WebCore/editing \
-    $$BASE_DIR/WebCore/rendering \
-    $$BASE_DIR/WebCore/history \
-    $$BASE_DIR/WebCore/xml \
-    $$BASE_DIR/WebCore/html
+symbian|maemo5: DEFINES *= QT_NO_UITOOLS
 
+contains(DEFINES, QT_NO_UITOOLS): CONFIG -= uitools
+
+# Disable a few warnings on Windows. The warnings are also
+# disabled in WebKitLibraries/win/tools/vsprops/common.vsprops
+win32-msvc*: QMAKE_CXXFLAGS += -wd4291 -wd4344 -wd4396 -wd4503 -wd4800 -wd4819 -wd4996
 
-macx {
-       INCLUDEPATH += /usr/include/libxml2
-       LIBS += -lxml2 -lxslt
-}