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