2010-08-11 James Hawkins <jhawkins@chromium.org>
[WebKit-https.git] / WebKit.pri
index 6e20393..21404dd 100644 (file)
@@ -1,37 +1,53 @@
 # Include file to make it easy to include WebKit into Qt projects
 
+# 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
 
-isEmpty(OUTPUT_DIR) {
-    CONFIG(debug, debug|release) {
-        OUTPUT_DIR=$$PWD/WebKitBuild/Debug
-    } else { # Release
-        OUTPUT_DIR=$$PWD/WebKitBuild/Release
-    }
-}
+CONFIG += depend_includepath
 
 DEFINES += BUILDING_QT__=1
 building-libs {
-    win32-msvc*: INCLUDEPATH += $$PWD/JavaScriptCore/os-win32
+    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 QtWebKit
+            LIBS += -framework $$QTWEBKITLIBNAME
             QMAKE_FRAMEWORKPATH = $$OUTPUT_DIR/lib $$QMAKE_FRAMEWORKPATH
         } else {
-            win32-*|wince* {
-                LIBS += -lQtWebKit$${QT_MAJOR_VERSION}
+            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
 
-!win32:!mac:!unix|symbian {
+!mac:!unix|symbian {
     DEFINES += USE_SYSTEM_MALLOC
 }
 
@@ -40,17 +56,20 @@ CONFIG(release, debug|release) {
 }
 
 BASE_DIR = $$PWD
-INCLUDEPATH += $$PWD/WebKit/qt/Api
+
+symbian {
+    INCLUDEPATH += $$PWD/include/QtWebKit
+} else {
+    INCLUDEPATH += $$OUTPUT_DIR/include/QtWebKit
+}
 
 CONFIG -= warn_on
-*-g++*:QMAKE_CXXFLAGS += -Wreturn-type -fno-strict-aliasing
-#QMAKE_CXXFLAGS += -Wall -Wno-undef -Wno-unused-parameter
+*-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
 
 # 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 *= QT_NO_UITOOLS
 }
 
 *-armcc {
@@ -62,75 +81,11 @@ symbian {
     QMAKE_CXXFLAGS.ARMCC += $$RVCT_COMMON_CXXFLAGS
 }
 
+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
 
-#
-# For builds inside Qt we interpret the output rule and the input of each extra compiler manually
-# and add the resulting sources to the SOURCES variable, because the build inside Qt contains already
-# all the generated files. We do not need to generate any extra compiler rules in that case.
-#
-# In addition this function adds a new target called 'generated_files' that allows manually calling
-# all the extra compilers to generate all the necessary files for the build using 'make generated_files'
-#
-defineTest(addExtraCompiler) {
-    CONFIG(QTDIR_build) {
-        outputRule = $$eval($${1}.output)
-        outVariable = $$eval($${1}.variable_out)
-        !isEqual(outVariable,GENERATED_SOURCES):return(true)
-
-        input = $$eval($${1}.input)
-        input = $$eval($$input)
-
-        for(file,input) {
-            base = $$basename(file)
-            base ~= s/\..+//
-            newfile=$$replace(outputRule,\\$\\{QMAKE_FILE_BASE\\},$$base)
-            SOURCES += $$newfile
-        }
-
-        export(SOURCES)
-    } else {
-        QMAKE_EXTRA_COMPILERS += $$1
-        generated_files.depends += compiler_$${1}_make_all
-        export(QMAKE_EXTRA_COMPILERS)
-        export(generated_files.depends)
-    }
-    return(true)
-}
-
-defineTest(addExtraCompilerWithHeader) {
-    addExtraCompiler($$1)
-
-    eval(headerFile = $${2})
-    isEmpty(headerFile) {
-        eval($${1}_header.output = $$eval($${1}.output))
-        eval($${1}_header.output ~= s/\.cpp/.h/)
-        eval($${1}_header.output ~= s/\.c/.h/)
-    } else {
-        eval($${1}_header.output = $$headerFile)
-    }
-
-    eval($${1}_header.input = $$eval($${1}.input))
-    eval($${1}_header.commands = @echo -n '')
-    eval($${1}_header.depends = compiler_$${1}_make_all)
-    eval($${1}_header.variable_out = GENERATED_FILES)
-
-    export($${1}_header.output)
-    export($${1}_header.input)
-    export($${1}_header.commands)
-    export($${1}_header.depends)
-    export($${1}_header.variable_out)
-
-    !CONFIG(QTDIR_build): QMAKE_EXTRA_COMPILERS += $${1}_header
-
-    export(QMAKE_EXTRA_COMPILERS)
-    export(generated_files.depends)
-    export(SOURCES)
-
-    return(true)
-}
-