The test input-paste-undo.html needs update to work properly
[WebKit-https.git] / Source / WebKit.pri
1 # Include file to make it easy to include WebKit into Qt projects
2
3 contains(QT_CONFIG, qpa)|contains(QT_CONFIG, embedded): CONFIG += embedded
4
5 # For convenience
6 greaterThan(QT_MAJOR_VERSION, 4): CONFIG += qt5
7
8 !CONFIG(release, debug|release) {
9     OBJECTS_DIR = obj/debug
10 } else { # Release
11     OBJECTS_DIR = obj/release
12     DEFINES *= NDEBUG
13 }
14
15 # Make sure that build_all follows the build_all config in WebCore
16 mac:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework):!build_pass:CONFIG += build_all
17
18 #We don't want verify and other platform macros to pollute the namespace
19 mac: DEFINES += __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0
20
21 CONFIG += depend_includepath
22 DEPENDPATH += $$OUT_PWD
23
24 DEFINES += BUILDING_QT__=1
25 building-libs {
26     win32-msvc*|win32-icc: INCLUDEPATH += $$PWD/JavaScriptCore/os-win32
27 } else {
28     QMAKE_LIBDIR = $$OUTPUT_DIR/lib $$QMAKE_LIBDIR
29     QTWEBKITLIBNAME = QtWebKit
30     mac:!static:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework) {
31         LIBS += -framework $$QTWEBKITLIBNAME
32         QMAKE_FRAMEWORKPATH = $$OUTPUT_DIR/lib $$QMAKE_FRAMEWORKPATH
33     } else {
34         build_pass: win32-*|wince* {
35             !CONFIG(release, debug|release): QTWEBKITLIBNAME = $${QTWEBKITLIBNAME}d
36             QTWEBKITLIBNAME = $${QTWEBKITLIBNAME}$${QT_MAJOR_VERSION}
37             win32-g++*: LIBS += -l$$QTWEBKITLIBNAME
38             else: LIBS += $${QTWEBKITLIBNAME}.lib
39         } else {
40             LIBS += -lQtWebKit
41         }
42     }
43     DEPENDPATH += $$PWD/WebKit/qt/Api
44 }
45
46 CONFIG(release, debug|release) {
47     DEFINES += NDEBUG
48 }
49
50 INCLUDEPATH += \
51     $$PWD \
52     $$OUTPUT_DIR/include/QtWebKit \
53     $$OUTPUT_DIR/include \
54     $$QT.script.includes
55
56 DEFINES += QT_ASCII_CAST_WARNINGS
57
58 webkit2:INCLUDEPATH *= $$OUTPUT_DIR/include/WebKit2
59
60 # Pick up 3rdparty libraries from INCLUDE/LIB just like with MSVC
61 win32-g++* {
62     TMPPATH            = $$quote($$(INCLUDE))
63     QMAKE_INCDIR_POST += $$split(TMPPATH,";")
64     TMPPATH            = $$quote($$(LIB))
65     QMAKE_LIBDIR_POST += $$split(TMPPATH,";")
66 }
67
68 CONFIG -= warn_on
69 *-g++*:QMAKE_CXXFLAGS += -Wall -Wextra -Wreturn-type -fno-strict-aliasing -Wchar-subscripts -Wformat-security -Wreturn-type -Wno-unused-parameter -Wno-sign-compare -Wno-switch -Wno-switch-enum -Wundef -Wmissing-noreturn -Winit-self
70
71 # Treat warnings as errors on x86/Linux/GCC
72 linux-g++* {
73     isEqual(QT_ARCH,x86_64)|isEqual(QT_ARCH,i386): QMAKE_CXXFLAGS += -Werror
74
75     greaterThan(QT_GCC_MAJOR_VERSION, 3):greaterThan(QT_GCC_MINOR_VERSION, 5) {
76         if (!contains(QMAKE_CXXFLAGS, -std=c++0x) && !contains(QMAKE_CXXFLAGS, -std=gnu++0x)) {
77             # We need to deactivate those warnings because some names conflicts with upcoming c++0x types (e.g.nullptr).
78             QMAKE_CFLAGS_WARN_ON += -Wno-c++0x-compat
79             QMAKE_CXXFLAGS_WARN_ON += -Wno-c++0x-compat
80             QMAKE_CFLAGS += -Wno-c++0x-compat
81             QMAKE_CXXFLAGS += -Wno-c++0x-compat
82         }
83     }
84 }
85
86 valgrind {
87     contains(JAVASCRIPTCORE_JIT,yes): error("'JAVASCRIPTCORE_JIT=yes' not supported with valgrind")
88     QMAKE_CXXFLAGS += -g
89     QMAKE_LFLAGS += -g
90     DEFINES += USE_SYSTEM_MALLOC=1
91     DEFINES += ENABLE_JIT=0
92     JAVASCRIPTCORE_JIT = no
93 }
94
95 contains(JAVASCRIPTCORE_JIT,yes): DEFINES+=ENABLE_JIT=1
96 contains(JAVASCRIPTCORE_JIT,no): DEFINES+=ENABLE_JIT=0
97
98 linux-g++ {
99 isEmpty($$(SBOX_DPKG_INST_ARCH)):exists(/usr/bin/ld.gold) {
100     message(Using gold linker)
101     QMAKE_LFLAGS+=-fuse-ld=gold
102 }
103 }
104
105
106 ##### Defaults for some mobile platforms
107 maemo5|maemo6 {
108     CONFIG += disable_uitools
109     CONFIG += enable_fast_mobile_scrolling
110     CONFIG += use_qt_mobile_theme
111     maemo6: CONFIG += include_webinspector
112 } else {
113     CONFIG += include_webinspector
114 }
115
116 *sh4* {
117     CONFIG += disable_uitools
118 }
119 ####
120
121 disable_uitools: DEFINES *= QT_NO_UITOOLS
122
123 # Disable a few warnings on Windows. The warnings are also
124 # disabled in WebKitLibraries/win/tools/vsprops/common.vsprops
125 win32-msvc*|wince*: QMAKE_CXXFLAGS += -wd4291 -wd4344 -wd4396 -wd4503 -wd4800 -wd4819 -wd4996
126 win32-icc: QMAKE_CXXFLAGS += -wd873
127
128 CONFIG(qt_minimal) {
129     DEFINES *= QT_NO_ANIMATION
130     DEFINES *= QT_NO_BEARERMANAGEMENT
131     DEFINES *= QT_NO_CLIPBOARD
132     DEFINES *= QT_NO_COMBOBOX
133     DEFINES *= QT_NO_CONCURRENT
134     DEFINES *= QT_NO_CRASHHANDLER
135     DEFINES *= QT_NO_CURSOR
136     DEFINES *= QT_NO_DESKTOPSERVICES
137     DEFINES *= QT_NO_FILEDIALOG
138     DEFINES *= QT_NO_GRAPHICSEFFECT
139     DEFINES *= QT_NO_IM
140     DEFINES *= QT_NO_INPUTDIALOG
141     DEFINES *= QT_NO_LINEEDIT
142     DEFINES *= QT_NO_MESSAGEBOX
143     DEFINES *= QT_NO_OPENSSL
144     DEFINES *= QT_NO_PRINTER
145     DEFINES *= QT_NO_QUUID_STRING
146     DEFINES *= QT_NO_SHORTCUT
147     DEFINES *= QT_NO_STYLE_STYLESHEET
148     DEFINES *= QT_NO_SYSTEMTRAYICON
149     DEFINES *= QT_NO_TEMPORARYFILE
150     DEFINES *= QT_NO_TOOLTIP
151     DEFINES *= QT_NO_UITOOLS
152     DEFINES *= QT_NO_UNDOCOMMAND
153     DEFINES *= QT_NO_UNDOSTACK
154     DEFINES *= QT_NO_XRENDER
155 }
156
157 contains(DEFINES, QT_NO_UITOOLS): CONFIG -= uitools