1 # -------------------------------------------------------------------
2 # This file contains shared rules used both when building WebCore
3 # itself, and by targets that use WebCore.
5 # See 'Tools/qmake/README' for an overview of the build system
6 # -------------------------------------------------------------------
8 SOURCE_DIR = $${ROOT_WEBKIT_DIR}/Source/WebCore
11 haveQt(5): QT *= core-private gui-private
13 WEBCORE_GENERATED_SOURCES_DIR = $${ROOT_BUILD_DIR}/Source/WebCore/$${GENERATED_SOURCES_DESTDIR}
17 $$SOURCE_DIR/Modules/filesystem \
18 $$SOURCE_DIR/Modules/geolocation \
19 $$SOURCE_DIR/Modules/indexeddb \
20 $$SOURCE_DIR/Modules/notifications \
21 $$SOURCE_DIR/Modules/protocolhandler \
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 \
30 $$SOURCE_DIR/bridge/qt \
33 $$SOURCE_DIR/dom/default \
34 $$SOURCE_DIR/editing \
35 $$SOURCE_DIR/fileapi \
36 $$SOURCE_DIR/history \
38 $$SOURCE_DIR/html/canvas \
39 $$SOURCE_DIR/html/parser \
40 $$SOURCE_DIR/html/shadow \
41 $$SOURCE_DIR/html/track \
42 $$SOURCE_DIR/inspector \
44 $$SOURCE_DIR/loader/appcache \
45 $$SOURCE_DIR/loader/archive \
46 $$SOURCE_DIR/loader/cache \
47 $$SOURCE_DIR/loader/icon \
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/filters \
58 $$SOURCE_DIR/platform/graphics/filters/arm \
59 $$SOURCE_DIR/platform/graphics/opengl \
60 $$SOURCE_DIR/platform/graphics/qt \
61 $$SOURCE_DIR/platform/graphics/surfaces \
62 $$SOURCE_DIR/platform/graphics/texmap \
63 $$SOURCE_DIR/platform/graphics/transforms \
64 $$SOURCE_DIR/platform/image-decoders \
65 $$SOURCE_DIR/platform/image-decoders/bmp \
66 $$SOURCE_DIR/platform/image-decoders/ico \
67 $$SOURCE_DIR/platform/image-decoders/gif \
68 $$SOURCE_DIR/platform/image-decoders/jpeg \
69 $$SOURCE_DIR/platform/image-decoders/png \
70 $$SOURCE_DIR/platform/image-decoders/webp \
71 $$SOURCE_DIR/platform/leveldb \
72 $$SOURCE_DIR/platform/mock \
73 $$SOURCE_DIR/platform/network \
74 $$SOURCE_DIR/platform/network/qt \
75 $$SOURCE_DIR/platform/qt \
76 $$SOURCE_DIR/platform/sql \
77 $$SOURCE_DIR/platform/text \
78 $$SOURCE_DIR/platform/text/transcoder \
79 $$SOURCE_DIR/plugins \
80 $$SOURCE_DIR/rendering \
81 $$SOURCE_DIR/rendering/mathml \
82 $$SOURCE_DIR/rendering/style \
83 $$SOURCE_DIR/rendering/svg \
84 $$SOURCE_DIR/storage \
86 $$SOURCE_DIR/svg/animation \
87 $$SOURCE_DIR/svg/graphics \
88 $$SOURCE_DIR/svg/graphics/filters \
89 $$SOURCE_DIR/svg/properties \
90 $$SOURCE_DIR/testing \
91 $$SOURCE_DIR/websockets \
92 $$SOURCE_DIR/workers \
94 $$SOURCE_DIR/xml/parser \
95 $$SOURCE_DIR/../ThirdParty
98 $$SOURCE_DIR/bridge/jsc \
99 $$SOURCE_DIR/bindings/js \
100 $$SOURCE_DIR/bindings/js/specialization \
101 $$SOURCE_DIR/bridge/c \
102 $$SOURCE_DIR/testing/js
104 INCLUDEPATH += $$WEBCORE_GENERATED_SOURCES_DIR
106 contains(DEFINES, ENABLE_XSLT=1) {
107 contains(DEFINES, WTF_USE_LIBXML2=1) {
109 INCLUDEPATH += /usr/include/libxml2
110 LIBS += -lxml2 -lxslt
119 contains(DEFINES, WTF_USE_LIBXML2=1) {
120 PKGCONFIG += libxml-2.0
123 contains(DEFINES, WTF_USE_ZLIB=1) {
127 contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) {
130 INCLUDEPATH += platform/mac
131 # Note: XP_MACOSX is defined in npapi.h
139 DEFINES += ENABLE_NETSCAPE_PLUGIN_METADATA_CACHE=1
153 contains(DEFINES, ENABLE_GEOLOCATION=1) {
158 contains(DEFINES, ENABLE_ORIENTATION_EVENTS=1)|contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) {
167 contains(DEFINES, WTF_USE_QT_MOBILITY_SYSTEMINFO=1) {
169 MOBILITY *= systeminfo
172 contains(DEFINES, ENABLE_VIDEO=1) {
173 contains(DEFINES, WTF_USE_QTKIT=1) {
174 INCLUDEPATH += $$SOURCE_DIR/platform/graphics/mac
176 LIBS += -framework AppKit -framework AudioUnit \
177 -framework AudioToolbox -framework CoreAudio \
178 -framework QuartzCore -framework QTKit
180 } else:contains(DEFINES, WTF_USE_GSTREAMER=1) {
181 DEFINES += ENABLE_GLIB_SUPPORT=1
183 INCLUDEPATH += $$SOURCE_DIR/platform/graphics/gstreamer
185 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
186 } else:contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
188 MOBILITY *= multimedia
192 contains(DEFINES, WTF_USE_3D_GRAPHICS=1) {
193 contains(QT_CONFIG, opengles2): LIBS += -lEGL
194 mac: LIBS += -framework IOSurface -framework CoreFoundation
195 linux-*:contains(DEFINES, HAVE_XCOMPOSITE=1): LIBS += -lXcomposite
196 haveQt(4): QT *= opengl
199 !system-sqlite:exists( $${SQLITE3SRCDIR}/sqlite3.c ) {
200 INCLUDEPATH += $${SQLITE3SRCDIR}
201 DEFINES += SQLITE_CORE SQLITE_OMIT_LOAD_EXTENSION SQLITE_OMIT_COMPLETE
203 INCLUDEPATH += $${SQLITE3SRCDIR}
208 # Qt5 allows us to use config tests to check for the presence of these libraries
210 DEFINES += WTF_USE_LIBJPEG=1
213 warning("JPEG library not found! QImageDecoder will decode JPEG images.")
216 DEFINES += WTF_USE_LIBPNG=1
219 warning("PNG library not found! QImageDecoder will decode PNG images.")
222 DEFINES += WTF_USE_WEBP=1
227 DEFINES += WTF_USE_LIBJPEG=1 WTF_USE_LIBPNG=1
233 DLLDESTDIR = $${ROOT_BUILD_DIR}/bin
235 dlltarget.commands = $(COPY_FILE) $(DESTDIR_TARGET) $$[QT_INSTALL_BINS]
236 dlltarget.CONFIG = no_path
237 INSTALLS += dlltarget
240 LIBS += -framework Carbon -framework AppKit
244 INCLUDEPATH += $$SOURCE_DIR/platform/win
250 # Remove whole program optimizations due to miscompilations
251 win32-msvc2005|win32-msvc2008|win32-msvc2010|wince*:{
252 QMAKE_CFLAGS_LTCG -= -GL
253 QMAKE_CXXFLAGS_LTCG -= -GL
255 # Disable incremental linking for windows 32bit OS debug build as WebKit is so big
256 # that linker failes to link incrementally in debug mode.
257 ARCH = $$(PROCESSOR_ARCHITECTURE)
258 WOW64ARCH = $$(PROCESSOR_ARCHITEW6432)
260 isEmpty(WOW64ARCH): QMAKE_LFLAGS_DEBUG += /INCREMENTAL:NO
265 DEFINES += HAVE_LOCALTIME_S=0
271 LIBS_PRIVATE += -framework Carbon -framework AppKit
274 unix:!mac:*-g++*:QMAKE_CXXFLAGS += -ffunction-sections -fdata-sections
275 unix:!mac:*-g++*:QMAKE_LFLAGS += -Wl,--gc-sections
276 linux*-g++*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
279 QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtNetwork
280 haveQt(5): QMAKE_PKGCONFIG_REQUIRES += QtWidgets
283 # Disable C++0x mode in WebCore for those who enabled it in their Qt's mkspec
284 *-g++*:QMAKE_CXXFLAGS -= -std=c++0x -std=gnu++0x
286 enable_fast_mobile_scrolling: DEFINES += ENABLE_FAST_MOBILE_SCROLLING=1