Unreviewed, rolling out r142112.
[WebKit-https.git] / Source / WebCore / WebCore.pri
1 # -------------------------------------------------------------------
2 # This file contains shared rules used both when building WebCore
3 # itself, and by targets that use WebCore.
4 #
5 # See 'Tools/qmake/README' for an overview of the build system
6 # -------------------------------------------------------------------
7
8 SOURCE_DIR = $${ROOT_WEBKIT_DIR}/Source/WebCore
9
10 QT *= network sql core-private gui-private
11
12 WEBCORE_GENERATED_SOURCES_DIR = $${ROOT_BUILD_DIR}/Source/WebCore/$${GENERATED_SOURCES_DESTDIR}
13
14 INCLUDEPATH += \
15     $$SOURCE_DIR \
16     $$SOURCE_DIR/Modules/filesystem \
17     $$SOURCE_DIR/Modules/geolocation \
18     $$SOURCE_DIR/Modules/indexeddb \
19     $$SOURCE_DIR/Modules/navigatorcontentutils \
20     $$SOURCE_DIR/Modules/notifications \
21     $$SOURCE_DIR/Modules/proximity \
22     $$SOURCE_DIR/Modules/quota \
23     $$SOURCE_DIR/Modules/webaudio \
24     $$SOURCE_DIR/Modules/webdatabase \
25     $$SOURCE_DIR/Modules/websockets \
26     $$SOURCE_DIR/accessibility \
27     $$SOURCE_DIR/bindings \
28     $$SOURCE_DIR/bindings/generic \
29     $$SOURCE_DIR/bridge \
30     $$SOURCE_DIR/bridge/qt \
31     $$SOURCE_DIR/css \
32     $$SOURCE_DIR/dom \
33     $$SOURCE_DIR/dom/default \
34     $$SOURCE_DIR/editing \
35     $$SOURCE_DIR/fileapi \
36     $$SOURCE_DIR/history \
37     $$SOURCE_DIR/html \
38     $$SOURCE_DIR/html/canvas \
39     $$SOURCE_DIR/html/parser \
40     $$SOURCE_DIR/html/shadow \
41     $$SOURCE_DIR/html/track \
42     $$SOURCE_DIR/inspector \
43     $$SOURCE_DIR/loader \
44     $$SOURCE_DIR/loader/appcache \
45     $$SOURCE_DIR/loader/archive \
46     $$SOURCE_DIR/loader/cache \
47     $$SOURCE_DIR/loader/icon \
48     $$SOURCE_DIR/mathml \
49     $$SOURCE_DIR/page \
50     $$SOURCE_DIR/page/animation \
51     $$SOURCE_DIR/page/qt \
52     $$SOURCE_DIR/page/scrolling \
53     $$SOURCE_DIR/platform \
54     $$SOURCE_DIR/platform/animation \
55     $$SOURCE_DIR/platform/audio \
56     $$SOURCE_DIR/platform/graphics \
57     $$SOURCE_DIR/platform/graphics/cpu/arm \
58     $$SOURCE_DIR/platform/graphics/cpu/arm/filters \
59     $$SOURCE_DIR/platform/graphics/filters \
60     $$SOURCE_DIR/platform/graphics/filters/texmap \
61     $$SOURCE_DIR/platform/graphics/opengl \
62     $$SOURCE_DIR/platform/graphics/opentype \
63     $$SOURCE_DIR/platform/graphics/qt \
64     $$SOURCE_DIR/platform/graphics/surfaces \
65     $$SOURCE_DIR/platform/graphics/texmap \
66     $$SOURCE_DIR/platform/graphics/transforms \
67     $$SOURCE_DIR/platform/image-decoders \
68     $$SOURCE_DIR/platform/image-decoders/bmp \
69     $$SOURCE_DIR/platform/image-decoders/ico \
70     $$SOURCE_DIR/platform/image-decoders/gif \
71     $$SOURCE_DIR/platform/image-decoders/jpeg \
72     $$SOURCE_DIR/platform/image-decoders/png \
73     $$SOURCE_DIR/platform/image-decoders/webp \
74     $$SOURCE_DIR/platform/leveldb \
75     $$SOURCE_DIR/platform/mock \
76     $$SOURCE_DIR/platform/network \
77     $$SOURCE_DIR/platform/network/qt \
78     $$SOURCE_DIR/platform/qt \
79     $$SOURCE_DIR/platform/sql \
80     $$SOURCE_DIR/platform/text \
81     $$SOURCE_DIR/platform/text/transcoder \
82     $$SOURCE_DIR/plugins \
83     $$SOURCE_DIR/rendering \
84     $$SOURCE_DIR/rendering/mathml \
85     $$SOURCE_DIR/rendering/style \
86     $$SOURCE_DIR/rendering/svg \
87     $$SOURCE_DIR/storage \
88     $$SOURCE_DIR/svg \
89     $$SOURCE_DIR/svg/animation \
90     $$SOURCE_DIR/svg/graphics \
91     $$SOURCE_DIR/svg/graphics/filters \
92     $$SOURCE_DIR/svg/properties \
93     $$SOURCE_DIR/testing \
94     $$SOURCE_DIR/websockets \
95     $$SOURCE_DIR/workers \
96     $$SOURCE_DIR/xml \
97     $$SOURCE_DIR/xml/parser \
98     $$SOURCE_DIR/../ThirdParty
99
100 INCLUDEPATH += \
101     $$SOURCE_DIR/bridge/jsc \
102     $$SOURCE_DIR/bindings/js \
103     $$SOURCE_DIR/bridge/c \
104     $$SOURCE_DIR/testing/js
105
106 INCLUDEPATH += $$WEBCORE_GENERATED_SOURCES_DIR
107
108 enable?(XSLT) {
109     use?(LIBXML2) {
110         mac {
111             INCLUDEPATH += /usr/include/libxslt /usr/include/libxml2
112             LIBS += -lxml2 -lxslt
113         } else {
114             PKGCONFIG += libxslt libxml-2.0
115         }
116     } else {
117         QT *= xmlpatterns
118     }
119 } else:!mac:use?(LIBXML2) {
120     PKGCONFIG += libxml-2.0
121 }
122
123 use?(ZLIB) {
124     LIBS += -lz
125 }
126
127 enable?(NETSCAPE_PLUGIN_API) {
128     unix {
129         mac {
130             INCLUDEPATH += platform/mac
131             # Note: XP_MACOSX is defined in npapi.h
132         } else {
133             xlibAvailable() {
134                 CONFIG *= x11
135                 LIBS += -lXrender
136                 DEFINES += MOZ_X11
137             }
138             DEFINES += XP_UNIX
139             DEFINES += ENABLE_NETSCAPE_PLUGIN_METADATA_CACHE=1
140         }
141     }
142     win32-* {
143         LIBS += \
144             -ladvapi32 \
145             -lgdi32 \
146             -lshell32 \
147             -lshlwapi \
148             -luser32 \
149             -lversion
150     }
151 }
152
153 enable?(ORIENTATION_EVENTS)|enable?(DEVICE_ORIENTATION) {
154     QT += sensors
155 }
156
157 use?(QT_MOBILITY_SYSTEMINFO) {
158      CONFIG *= mobility
159      MOBILITY *= systeminfo
160 }
161
162 enable?(GAMEPAD) {
163     INCLUDEPATH += \
164         $$SOURCE_DIR/platform/linux \
165         $$SOURCE_DIR/Modules/gamepad
166     PKGCONFIG += libudev
167 }
168
169 use?(GSTREAMER) {
170     DEFINES += ENABLE_GLIB_SUPPORT=1
171     PKGCONFIG += glib-2.0 gio-2.0 gstreamer-0.10 gstreamer-app-0.10 gstreamer-base-0.10 gstreamer-interfaces-0.10 gstreamer-pbutils-0.10 gstreamer-plugins-base-0.10 gstreamer-video-0.10
172 }
173
174 enable?(VIDEO) {
175     use?(QTKIT) {
176         INCLUDEPATH += $$SOURCE_DIR/platform/graphics/mac
177
178         LIBS += -framework AppKit -framework AudioUnit \
179                 -framework AudioToolbox -framework CoreAudio \
180                 -framework QuartzCore -framework QTKit \
181                 -framework Security -framework IOKit
182
183         DARWIN_VERSION = $$split(QMAKE_HOST.version, ".")
184         DARWIN_MAJOR_VERSION = $$first(DARWIN_VERSION)
185
186         # We first check if a specific SDK is set to be used for the build.
187         contains(QMAKE_MAC_SDK, ".*MacOSX10.7.sdk.*") {
188             SYSTEM_LIBRARY_PATH = $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceLion.a
189         } else:contains(QMAKE_MAC_SDK, ".*MacOSX10.8.sdk.*") {
190             SYSTEM_LIBRARY_PATH = $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceMountainLion.a
191         }
192
193         # If the previous check did not yield a result, we resort to the Darwin version.
194         isEmpty(SYSTEM_LIBRARY_PATH) {
195             equals(DARWIN_MAJOR_VERSION, "11") {
196                 SYSTEM_LIBRARY_PATH = $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceLion.a
197             } else:equals(DARWIN_MAJOR_VERSION, "12") {
198                 SYSTEM_LIBRARY_PATH = $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceMountainLion.a
199             }
200         }
201         LIBS += $$SYSTEM_LIBRARY_PATH
202     } else:use?(GSTREAMER) {
203         INCLUDEPATH += $$SOURCE_DIR/platform/graphics/gstreamer
204     } else:use?(QT_MULTIMEDIA) {
205         QT *= multimedia
206     }
207 }
208
209 enable?(WEB_AUDIO) {
210     use?(GSTREAMER) {
211         DEFINES += WTF_USE_WEBAUDIO_GSTREAMER=1
212         INCLUDEPATH += $$SOURCE_DIR/platform/audio/gstreamer
213         PKGCONFIG += gstreamer-audio-0.10 gstreamer-fft-0.10
214     }
215 }
216
217 use?(3D_GRAPHICS) {
218     win32: {
219         win32-g++: {
220             # Make sure OpenGL libs are after the webcore lib so MinGW can resolve symbols
221             contains(QT_CONFIG, opengles2) {
222                 CONFIG(debug, debug|release):contains(QT_CONFIG, angle) {
223                     LIBS += $$QMAKE_LIBS_OPENGL_ES2_DEBUG
224                 } else {
225                     LIBS += $$QMAKE_LIBS_OPENGL_ES2
226                 }
227             } else {
228                 LIBS += $$QMAKE_LIBS_OPENGL
229             }
230         }
231     } else {
232         contains(QT_CONFIG, opengles2): LIBS += -lEGL
233     }
234 }
235
236 use?(GRAPHICS_SURFACE) {
237     mac: LIBS += -framework IOSurface -framework CoreFoundation
238     linux-*: {
239         LIBS += -lXcomposite -lXrender
240         CONFIG *= x11
241     }
242 }
243
244 have?(sqlite3) {
245     mac {
246         LIBS += -lsqlite3
247     } else {
248         PKGCONFIG += sqlite3
249     }
250 } else {
251     SQLITE3SRCDIR = $$(SQLITE3SRCDIR)
252     isEmpty(SQLITE3SRCDIR): SQLITE3SRCDIR = ../../../qtbase/src/3rdparty/sqlite/
253     exists($${SQLITE3SRCDIR}/sqlite3.c) {
254         INCLUDEPATH += $${SQLITE3SRCDIR}
255         DEFINES += SQLITE_CORE SQLITE_OMIT_LOAD_EXTENSION SQLITE_OMIT_COMPLETE
256     } else {
257         INCLUDEPATH += $${SQLITE3SRCDIR}
258         LIBS += -lsqlite3
259     }
260 }
261
262 use?(libjpeg): LIBS += -ljpeg
263 use?(libpng): LIBS += -lpng
264 use?(webp): LIBS += -lwebp
265
266 mac {
267     LIBS += -framework Carbon -framework AppKit -framework IOKit
268 }
269
270 win32 {
271     INCLUDEPATH += $$SOURCE_DIR/platform/win
272
273     wince* {
274         # see https://bugs.webkit.org/show_bug.cgi?id=43442
275         DEFINES += HAVE_LOCALTIME_S=0
276
277         LIBS += -lmmtimer
278         LIBS += -lole32
279     }
280     else {
281         LIBS += -lgdi32
282         LIBS += -lole32
283         LIBS += -luser32
284     }
285 }
286
287 # Remove whole program optimizations due to miscompilations
288 win32-msvc2005|win32-msvc2008|win32-msvc2010|wince*:{
289     QMAKE_CFLAGS_LTCG -= -GL
290     QMAKE_CXXFLAGS_LTCG -= -GL
291
292     # Disable incremental linking for windows 32bit OS debug build as WebKit is so big
293     # that linker failes to link incrementally in debug mode.
294     ARCH = $$(PROCESSOR_ARCHITECTURE)
295     WOW64ARCH = $$(PROCESSOR_ARCHITEW6432)
296     equals(ARCH, x86):{
297         isEmpty(WOW64ARCH): QMAKE_LFLAGS_DEBUG += /INCREMENTAL:NO
298     }
299 }
300
301 mac {
302     LIBS_PRIVATE += -framework Carbon -framework AppKit
303 }
304
305 # -ffunction-section conflicts with -pg option
306 !contains(CONFIG, gprof) {
307     unix:!mac:*-g++*:QMAKE_CXXFLAGS += -ffunction-sections
308 }
309 unix:!mac:*-g++*:QMAKE_CXXFLAGS += -fdata-sections
310 unix:!mac:*-g++*:QMAKE_LFLAGS += -Wl,--gc-sections
311 linux*-g++*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
312
313 unix|win32-g++* {
314     QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtNetwork QtWidgets
315 }
316
317 contains(DEFINES, ENABLE_OPENCL=1) {
318     LIBS += -lOpenCL
319
320     INCLUDEPATH += $$SOURCE_DIR/platform/graphics/gpu/opencl
321 }
322
323 # Disable C++0x mode in WebCore for those who enabled it in their Qt's mkspec
324 *-g++*:QMAKE_CXXFLAGS -= -std=c++0x -std=gnu++0x
325
326 enable_fast_mobile_scrolling: DEFINES += ENABLE_FAST_MOBILE_SCROLLING=1
327
328 !production_build:have?(FONTCONFIG): PKGCONFIG += fontconfig
329