2011-01-17 MORITA Hajime <morrita@google.com>
[WebKit-https.git] / WebKit.pri
1 # Include file to make it easy to include WebKit into Qt projects
2
3 # Detect that we are building as a standalone package by the presence of
4 # either the generated files directory or as part of the Qt package through
5 # QTDIR_build
6 CONFIG(QTDIR_build): CONFIG += standalone_package
7 else:exists($$PWD/Source/WebCore/generated): CONFIG += standalone_package
8
9 CONFIG += depend_includepath
10 DEPENDPATH += $$OUT_PWD
11
12 DEFINES += BUILDING_QT__=1
13 building-libs {
14     win32-msvc*|win32-icc: INCLUDEPATH += $$PWD/Source/JavaScriptCore/os-win32
15 } else {
16     CONFIG(QTDIR_build) {
17         QT += webkit
18     } else {
19         QMAKE_LIBDIR = $$OUTPUT_DIR/lib $$QMAKE_LIBDIR
20         QTWEBKITLIBNAME = QtWebKit
21         mac:!static:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework) {
22             LIBS += -framework $$QTWEBKITLIBNAME
23             QMAKE_FRAMEWORKPATH = $$OUTPUT_DIR/lib $$QMAKE_FRAMEWORKPATH
24         } else {
25             build_pass: win32-*|wince* {
26                 !CONFIG(release, debug|release): QTWEBKITLIBNAME = $${QTWEBKITLIBNAME}d
27                 QTWEBKITLIBNAME = $${QTWEBKITLIBNAME}$${QT_MAJOR_VERSION}
28                 win32-g++*: LIBS += -l$$QTWEBKITLIBNAME
29                 else: LIBS += $${QTWEBKITLIBNAME}.lib
30             } else {
31                 LIBS += -lQtWebKit
32                 symbian {
33                     TARGET.EPOCSTACKSIZE = 0x14000 // 80 kB
34                     # For EXEs only: set heap to usable value
35                     TARGET.EPOCHEAPSIZE = 
36                     heapSizeRule = \
37                     "$${LITERAL_HASH}ifdef WINSCW" \
38                         "EPOCHEAPSIZE  0x40000 0x2000000 // Min 256kB, Max 32MB" \
39                     "$${LITERAL_HASH}else" \
40                         "EPOCHEAPSIZE  0x40000 0x10000000 // Min 256kB, Max 256MB" \
41                     "$${LITERAL_HASH}endif"
42                     MMP_RULES += heapSizeRule
43                 }
44             }
45         }
46     }
47     DEPENDPATH += $$PWD/Source/WebKit/qt/Api
48 }
49
50 !mac:!unix|symbian {
51     DEFINES += USE_SYSTEM_MALLOC=1
52 }
53
54 CONFIG(release, debug|release) {
55     DEFINES += NDEBUG
56 }
57
58 INCLUDEPATH += $$OUTPUT_DIR/Source/include/QtWebKit
59
60 CONFIG -= warn_on
61 *-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
62
63 # Treat warnings as errors on x86/Linux/GCC
64 linux-g++* {
65     isEqual(QT_ARCH,x86_64)|isEqual(QT_ARCH,i386): QMAKE_CXXFLAGS += -Werror
66 }
67
68 # Enable GNU compiler extensions to the ARM compiler for all Qt ports using RVCT
69 symbian|*-armcc {
70     RVCT_COMMON_CFLAGS = --gnu --diag_suppress 68,111,177,368,830,1293
71     RVCT_COMMON_CXXFLAGS = $$RVCT_COMMON_CFLAGS --no_parse_templates
72 }
73
74 *-armcc {
75     QMAKE_CFLAGS += $$RVCT_COMMON_CFLAGS
76     QMAKE_CXXFLAGS += $$RVCT_COMMON_CXXFLAGS
77 }
78
79 symbian {
80     QMAKE_CXXFLAGS.ARMCC += $$RVCT_COMMON_CXXFLAGS
81 }
82
83 valgrind {
84     contains(JAVASCRIPTCORE_JIT,yes): error("'JAVASCRIPTCORE_JIT=yes' not supported with valgrind")
85     QMAKE_CXXFLAGS += -g
86     QMAKE_LFLAGS += -g
87     DEFINES += USE_SYSTEM_MALLOC=1
88     DEFINES += ENABLE_JIT=0
89     JAVASCRIPTCORE_JIT = no
90 }
91
92 ##### Defaults for some mobile platforms
93 symbian|maemo5|maemo6 {
94     CONFIG += disable_uitools
95     CONFIG += enable_fast_mobile_scrolling
96     CONFIG += use_qt_mobile_theme
97     maemo6: CONFIG += include_webinspector
98 } else {
99     CONFIG += include_webinspector
100 }
101
102 ####
103
104 disable_uitools: DEFINES *= QT_NO_UITOOLS
105
106 contains(DEFINES, QT_NO_UITOOLS): CONFIG -= uitools
107
108 # Disable a few warnings on Windows. The warnings are also
109 # disabled in WebKitLibraries/win/tools/vsprops/common.vsprops
110 win32-msvc*|wince*: QMAKE_CXXFLAGS += -wd4291 -wd4344 -wd4396 -wd4503 -wd4800 -wd4819 -wd4996
111
112 CONFIG(qt_minimal) {
113     DEFINES *= QT_NO_ANIMATION
114     DEFINES *= QT_NO_BEARERMANAGEMENT
115     DEFINES *= QT_NO_CLIPBOARD
116     DEFINES *= QT_NO_COMBOBOX
117     DEFINES *= QT_NO_CONCURRENT
118     DEFINES *= QT_NO_CRASHHANDLER
119     DEFINES *= QT_NO_CURSOR
120     DEFINES *= QT_NO_DESKTOPSERVICES
121     DEFINES *= QT_NO_FILEDIALOG
122     DEFINES *= QT_NO_GRAPHICSEFFECT
123     DEFINES *= QT_NO_IM
124     DEFINES *= QT_NO_INPUTDIALOG
125     DEFINES *= QT_NO_LINEEDIT
126     DEFINES *= QT_NO_MESSAGEBOX
127     DEFINES *= QT_NO_OPENSSL
128     DEFINES *= QT_NO_PRINTER
129     DEFINES *= QT_NO_QUUID_STRING
130     DEFINES *= QT_NO_SHORTCUT
131     DEFINES *= QT_NO_STYLE_STYLESHEET
132     DEFINES *= QT_NO_SYSTEMTRAYICON
133     DEFINES *= QT_NO_TEMPORARYFILE
134     DEFINES *= QT_NO_TOOLTIP
135     DEFINES *= QT_NO_UITOOLS
136     DEFINES *= QT_NO_UNDOCOMMAND
137     DEFINES *= QT_NO_UNDOSTACK
138     DEFINES *= QT_NO_XRENDER
139 }