991fe9ec7afbff1684d66e8267ff45af9bee829c
[WebKit-https.git] / Source / WebKit / qt / QtWebKit.pro
1 # QtWebKit - qmake build info
2 CONFIG += building-libs
3 CONFIG += depend_includepath
4
5 TARGET = QtWebKit
6 TEMPLATE = lib
7
8 DEFINES += BUILDING_WEBKIT
9
10 webkit2: QT += declarative
11
12 RESOURCES += \
13     $$PWD/../../WebCore/WebCore.qrc
14
15 CONFIG(debug, debug|release) : CONFIG_DIR = debug
16 else: CONFIG_DIR = release
17
18 SOURCE_DIR = $$replace(PWD, /WebKit/qt, "")
19
20 include($$PWD/Api/headers.pri)
21 include($$SOURCE_DIR/WebKit.pri)
22 include($$SOURCE_DIR/JavaScriptCore/JavaScriptCore.pri)
23 webkit2 {
24     include($$SOURCE_DIR/WebKit2/WebKit2.pri)
25     include($$SOURCE_DIR/WebKit2/WebKit2API.pri)
26 }
27 include($$SOURCE_DIR/WebCore/WebCore.pri)
28
29 v8 {
30     linux-* {
31         QMAKE_LIBDIR += $${V8_LIB_DIR}
32         LIBS = -lv8 $$LIBS
33     }
34 }
35
36 !v8:prependJavaScriptCoreLib(../../JavaScriptCore)
37 prependWebCoreLib(../../WebCore)
38 webkit2:prependWebKit2Lib(../../WebKit2)
39
40 # This is needed for syncqt when it parses the dependencies on module's main pro file so
41 # the generated includes are containing the dependencies.
42 # It used to be in WebCore.pro but now that this is the main pro file it has to be here.
43 QT += network
44
45 isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../..
46
47 contains(QT_CONFIG, embedded):CONFIG += embedded
48
49 win32*:!win32-msvc* {
50     # Make sure OpenGL libs are after the webcore lib so MinGW can resolve symbols
51     contains(DEFINES, ENABLE_WEBGL=1)|contains(CONFIG, texmap): LIBS += $$QMAKE_LIBS_OPENGL
52 }
53
54 include_webinspector: RESOURCES += $$SOURCE_DIR/WebCore/inspector/front-end/WebKit.qrc $$WC_GENERATED_SOURCES_DIR/InspectorBackendStub.qrc
55
56 # Extract sources to build from the generator definitions
57 defineTest(addExtraCompiler) {
58     isEqual($${1}.wkAddOutputToSources, false): return(true)
59
60     outputRule = $$eval($${1}.output)
61     input = $$eval($${1}.input)
62     input = $$eval($$input)
63
64     for(file,input) {
65         base = $$basename(file)
66         base ~= s/\\..+//
67         newfile=$$replace(outputRule,\\$\\{QMAKE_FILE_BASE\\},$$base)
68         SOURCES += $$newfile
69     }
70     SOURCES += $$eval($${1}.wkExtraSources)
71     export(SOURCES)
72
73     return(true)
74 }
75
76 include($$SOURCE_DIR/WebCore/CodeGenerators.pri)
77
78 CONFIG(release):!CONFIG(standalone_package) {
79     contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
80     unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions
81 }
82
83 CONFIG(QTDIR_build) {
84     include($$QT_SOURCE_TREE/src/qbase.pri)
85     # The following lines are to prevent qmake from adding the jscore, webcore and webkit2 libs to libQtWebKit's prl dependencies.
86     # The compromise we have to accept by disabling explicitlib is to drop support to link QtWebKit and QtScript
87     # statically in applications (which isn't used often because, among other things, of licensing obstacles).
88     CONFIG -= explicitlib
89     CONFIG -= staticlib
90 } else {
91     DESTDIR = $$OUTPUT_DIR/lib
92     symbian: TARGET =$$TARGET$${QT_LIBINFIX}
93 }
94
95 moduleFile=$$PWD/qt_webkit_version.pri
96 isEmpty(QT_BUILD_TREE):include($$moduleFile)
97 VERSION = $${QT_WEBKIT_MAJOR_VERSION}.$${QT_WEBKIT_MINOR_VERSION}.$${QT_WEBKIT_PATCH_VERSION}
98
99 symbian {
100     TARGET.EPOCALLOWDLLDATA=1
101     # DRM and Allfiles capabilites need to be audited to be signed on Symbian
102     # For regular users that is not possible, so use the CONFIG(production) flag is added
103     # To use all capabilies add CONFIG+=production
104     # If building from QT source tree, also add CONFIG-=QTDIR_build as qbase.pri defaults capabilities to All -Tcb.    
105     CONFIG(production) {
106         TARGET.CAPABILITY = All -Tcb
107     } else {
108         TARGET.CAPABILITY = All -Tcb -DRM -AllFiles
109     }
110     isEmpty(QT_LIBINFIX) {
111         TARGET.UID3 = 0x200267C2
112     } else {
113         TARGET.UID3 = 0xE00267C2
114     }
115     
116     sisheader = "; SIS header: name, uid, version" \
117                 "$${LITERAL_HASH}{\"$$TARGET\"},($$TARGET.UID3),$$QT_WEBKIT_MAJOR_VERSION,$$QT_WEBKIT_MINOR_VERSION,$$QT_WEBKIT_PATCH_VERSION,TYPE=SA,RU"
118     webkitsisheader.pkg_prerules = sisheader
119
120     webkitlibs.sources = QtWebKit$${QT_LIBINFIX}.dll
121     v8:webkitlibs.sources += v8.dll
122
123     CONFIG(QTDIR_build): webkitlibs.sources = $$QMAKE_LIBDIR_QT/$$webkitlibs.sources
124     webkitlibs.path = /sys/bin
125     vendorinfo = \
126         "; Localised Vendor name" \
127         "%{\"Nokia\"}" \
128         " " \
129         "; Unique Vendor name" \
130         ":\"Nokia, Qt\"" \
131         " "
132     webkitlibs.pkg_prerules = vendorinfo
133
134     webkitbackup.sources = symbian/backup_registration.xml
135     webkitbackup.path = /private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,)
136
137     contains(QT_CONFIG, declarative) {
138          declarativeImport.sources = $$QT_BUILD_TREE/imports/QtWebKit/qmlwebkitplugin$${QT_LIBINFIX}.dll
139          declarativeImport.sources += declarative/qmldir
140          declarativeImport.path = c:$$QT_IMPORTS_BASE_DIR/QtWebKit
141          DEPLOYMENT += declarativeImport
142     }
143
144     platformplugin.sources = $$OUTPUT_DIR/plugins/QtWebKit/platformplugin$${QT_LIBINFIX}.dll
145     platformplugin.path = c:$$QT_PLUGINS_BASE_DIR/QtWebKit
146
147     DEPLOYMENT += webkitsisheader webkitlibs webkitbackup platformplugin
148     !CONFIG(production):CONFIG-=def_files
149
150     # Need to build these sources here because of exported symbols
151     SOURCES += \
152         $$SOURCE_DIR/WebCore/plugins/symbian/PluginViewSymbian.cpp \
153         $$SOURCE_DIR/WebCore/plugins/symbian/PluginContainerSymbian.cpp
154
155     HEADERS += \
156         $$SOURCE_DIR/WebCore/plugins/symbian/PluginContainerSymbian.h \
157         $$SOURCE_DIR/WebCore/plugins/symbian/npinterface.h
158 }
159
160 !static: DEFINES += QT_MAKEDLL
161
162 SOURCES += \
163     $$PWD/Api/qwebframe.cpp \
164     $$PWD/Api/qgraphicswebview.cpp \
165     $$PWD/Api/qwebpage.cpp \
166     $$PWD/Api/qwebview.cpp \
167     $$PWD/Api/qwebelement.cpp \
168     $$PWD/Api/qwebhistory.cpp \
169     $$PWD/Api/qwebsettings.cpp \
170     $$PWD/Api/qwebhistoryinterface.cpp \
171     $$PWD/Api/qwebplugindatabase.cpp \
172     $$PWD/Api/qwebpluginfactory.cpp \
173     $$PWD/Api/qwebsecurityorigin.cpp \
174     $$PWD/Api/qwebscriptworld.cpp \
175     $$PWD/Api/qwebdatabase.cpp \
176     $$PWD/Api/qwebinspector.cpp \
177     $$PWD/Api/qwebkitversion.cpp \
178     \
179     $$PWD/WebCoreSupport/QtFallbackWebPopup.cpp \
180     $$PWD/WebCoreSupport/ChromeClientQt.cpp \
181     $$PWD/WebCoreSupport/ContextMenuClientQt.cpp \
182     $$PWD/WebCoreSupport/DragClientQt.cpp \
183     $$PWD/WebCoreSupport/DumpRenderTreeSupportQt.cpp \
184     $$PWD/WebCoreSupport/EditorClientQt.cpp \
185     $$PWD/WebCoreSupport/EditCommandQt.cpp \
186     $$PWD/WebCoreSupport/FrameLoaderClientQt.cpp \
187     $$PWD/WebCoreSupport/FrameNetworkingContextQt.cpp \
188     $$PWD/WebCoreSupport/GeolocationPermissionClientQt.cpp \
189     $$PWD/WebCoreSupport/InspectorClientQt.cpp \
190     $$PWD/WebCoreSupport/InspectorServerQt.cpp \
191     $$PWD/WebCoreSupport/NotificationPresenterClientQt.cpp \
192     $$PWD/WebCoreSupport/PageClientQt.cpp \
193     $$PWD/WebCoreSupport/PopupMenuQt.cpp \
194     $$PWD/WebCoreSupport/QtPlatformPlugin.cpp \
195     $$PWD/WebCoreSupport/SearchPopupMenuQt.cpp \
196     $$PWD/WebCoreSupport/TextCheckerClientQt.cpp \
197     $$PWD/WebCoreSupport/WebPlatformStrategies.cpp
198
199 HEADERS += \
200     $$WEBKIT_API_HEADERS \
201     $$PWD/Api/qwebplugindatabase_p.h \
202     \
203     $$PWD/WebCoreSupport/InspectorServerQt.h \
204     $$PWD/WebCoreSupport/QtFallbackWebPopup.h \
205     $$PWD/WebCoreSupport/FrameLoaderClientQt.h \
206     $$PWD/WebCoreSupport/FrameNetworkingContextQt.h \
207     $$PWD/WebCoreSupport/GeolocationPermissionClientQt.h \
208     $$PWD/WebCoreSupport/NotificationPresenterClientQt.h \
209     $$PWD/WebCoreSupport/PageClientQt.h \
210     $$PWD/WebCoreSupport/QtPlatformPlugin.h \
211     $$PWD/WebCoreSupport/PopupMenuQt.h \
212     $$PWD/WebCoreSupport/SearchPopupMenuQt.h \
213     $$PWD/WebCoreSupport/TextCheckerClientQt.h \
214     $$PWD/WebCoreSupport/WebPlatformStrategies.h
215
216 webkit2 {
217     HEADERS += $$WEBKIT2_API_HEADERS
218     SOURCES += $$WEBKIT2_API_SOURCES
219 }
220
221 contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) {
222     unix:!symbian {
223         maemo5 {
224             HEADERS += $$PWD/WebCoreSupport/QtMaemoWebPopup.h
225             SOURCES += $$PWD/WebCoreSupport/QtMaemoWebPopup.cpp
226         }
227     }
228 }
229
230 contains(DEFINES, ENABLE_VIDEO=1) {
231     !contains(DEFINES, WTF_USE_QTKIT=1):!contains(DEFINES, WTF_USE_GSTREAMER=1):contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
232         HEADERS += $$PWD/WebCoreSupport/FullScreenVideoWidget.h
233         SOURCES += $$PWD/WebCoreSupport/FullScreenVideoWidget.cpp
234     }
235
236     contains(DEFINES, WTF_USE_QTKIT=1) | contains(DEFINES, WTF_USE_GSTREAMER=1) | contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
237         HEADERS += $$PWD/WebCoreSupport/FullScreenVideoQt.h
238         SOURCES += $$PWD/WebCoreSupport/FullScreenVideoQt.cpp
239     }
240
241     contains(DEFINES, WTF_USE_QTKIT=1) {
242         INCLUDEPATH += $$SOURCE_DIR/WebCore/platform/qt/ \
243                        $$SOURCE_DIR/WebCore/platform/mac/ \
244                        $$SOURCE_DIR/../WebKitLibraries/
245
246         DEFINES+=NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
247
248         HEADERS += $$PWD/WebCoreSupport/WebSystemInterface.h \
249                    $$PWD/WebCoreSupport/QTKitFullScreenVideoHandler.h
250
251         OBJECTIVE_SOURCES += $$PWD/WebCoreSupport/WebSystemInterface.mm \
252                    $$PWD/WebCoreSupport/QTKitFullScreenVideoHandler.mm
253
254         LIBS+= -framework Security -framework IOKit
255         # We can know the Mac OS version by using the Darwin major version
256         DARWIN_VERSION = $$split(QMAKE_HOST.version, ".")
257         DARWIN_MAJOR_VERSION = $$first(DARWIN_VERSION)
258         equals(DARWIN_MAJOR_VERSION, "11") {
259             LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceLion.a
260         } else:equals(DARWIN_MAJOR_VERSION, "10") {
261             LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
262         } else:equals(DARWIN_MAJOR_VERSION, "9") {
263             LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceLeopard.a
264         }
265     }
266 }
267
268 contains(DEFINES, ENABLE_ICONDATABASE=1) {
269     HEADERS += \
270         $$SOURCE_DIR/WebCore/loader/icon/IconDatabaseClient.h \
271         $$PWD/WebCoreSupport/IconDatabaseClientQt.h
272
273     SOURCES += \
274         $$PWD/WebCoreSupport/IconDatabaseClientQt.cpp
275 }
276
277 contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) {
278     HEADERS += \
279         $$PWD/WebCoreSupport/DeviceMotionClientQt.h \
280         $$PWD/WebCoreSupport/DeviceMotionProviderQt.h \
281         $$PWD/WebCoreSupport/DeviceOrientationClientQt.h \
282         $$PWD/WebCoreSupport/DeviceOrientationClientMockQt.h \
283         $$PWD/WebCoreSupport/DeviceOrientationProviderQt.h
284
285     SOURCES += \
286         $$PWD/WebCoreSupport/DeviceMotionClientQt.cpp \
287         $$PWD/WebCoreSupport/DeviceMotionProviderQt.cpp \
288         $$PWD/WebCoreSupport/DeviceOrientationClientQt.cpp \
289         $$PWD/WebCoreSupport/DeviceOrientationClientMockQt.cpp \
290         $$PWD/WebCoreSupport/DeviceOrientationProviderQt.cpp
291 }
292
293 contains(DEFINES, ENABLE_GEOLOCATION=1) {
294      HEADERS += \
295         $$PWD/WebCoreSupport/GeolocationClientQt.h
296      SOURCES += \
297         $$PWD/WebCoreSupport/GeolocationClientQt.cpp
298 }
299
300 contains(CONFIG, texmap) {
301     DEFINES += WTF_USE_TEXTURE_MAPPER=1
302 }
303
304 !symbian-abld:!symbian-sbsv2 {
305     modfile.files = $$moduleFile
306     modfile.path = $$[QMAKE_MKSPECS]/modules
307
308     INSTALLS += modfile
309 } else {
310     # INSTALLS is not implemented in qmake's mmp generators, copy headers manually
311
312     inst_modfile.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
313     inst_modfile.input = moduleFile
314     inst_modfile.output = $$[QMAKE_MKSPECS]/modules
315     inst_modfile.CONFIG = no_clean
316
317     QMAKE_EXTRA_COMPILERS += inst_modfile
318
319     install.depends += compiler_inst_modfile_make_all
320     QMAKE_EXTRA_TARGETS += install
321 }
322
323 !CONFIG(QTDIR_build) {
324     exists($$OUTPUT_DIR/include/QtWebKit/classheaders.pri): include($$OUTPUT_DIR/include/QtWebKit/classheaders.pri)
325     WEBKIT_INSTALL_HEADERS = $$WEBKIT_API_HEADERS $$WEBKIT_CLASS_HEADERS
326
327     !symbian-abld:!symbian-sbsv2 {
328         headers.files = $$WEBKIT_INSTALL_HEADERS
329
330         !isEmpty(INSTALL_HEADERS): headers.path = $$INSTALL_HEADERS/QtWebKit
331         else: headers.path = $$[QT_INSTALL_HEADERS]/QtWebKit
332
333         !isEmpty(INSTALL_LIBS): target.path = $$INSTALL_LIBS
334         else: target.path = $$[QT_INSTALL_LIBS]
335
336         INSTALLS += target headers
337     } else {
338         # INSTALLS is not implemented in qmake's mmp generators, copy headers manually
339         inst_headers.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
340         inst_headers.input = WEBKIT_INSTALL_HEADERS
341         inst_headers.CONFIG = no_clean no_link target_predeps
342
343         !isEmpty(INSTALL_HEADERS): inst_headers.output = $$INSTALL_HEADERS/QtWebKit/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
344         else: inst_headers.output = $$[QT_INSTALL_HEADERS]/QtWebKit/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
345
346         QMAKE_EXTRA_COMPILERS += inst_headers
347
348         install.depends += compiler_inst_headers_make_all
349     }
350
351     unix {
352         CONFIG += create_pc create_prl
353         QMAKE_PKGCONFIG_LIBDIR = $$target.path
354         QMAKE_PKGCONFIG_INCDIR = $$headers.path
355         QMAKE_PKGCONFIG_DESTDIR = pkgconfig
356         lib_replace.match = $$re_escape($$DESTDIR)
357         lib_replace.replace = $$[QT_INSTALL_LIBS]
358         QMAKE_PKGCONFIG_INSTALL_REPLACE += lib_replace
359     }
360
361     mac {
362         !static:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework) {
363             !build_pass {
364                 message("Building QtWebKit as a framework, as that's how Qt was built. You can")
365                 message("override this by passing CONFIG+=webkit_no_framework to build-webkit.")
366
367                 CONFIG += build_all
368             } else {
369                 isEmpty(QT_SOURCE_TREE):debug_and_release:TARGET = $$qtLibraryTarget($$TARGET)
370             }
371
372             CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework
373             FRAMEWORK_HEADERS.version = Versions
374             FRAMEWORK_HEADERS.files = $${headers.files}
375             FRAMEWORK_HEADERS.path = Headers
376             QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
377         }
378
379         QMAKE_LFLAGS_SONAME = "$${QMAKE_LFLAGS_SONAME}$${DESTDIR}$${QMAKE_DIR_SEP}"
380     }
381 }
382
383 symbian {
384     shared {
385         contains(CONFIG, def_files) {
386             DEF_FILE=symbian
387             # defFilePath is for Qt4.6 compatibility
388             defFilePath=symbian
389         } else {
390             MMP_RULES += EXPORTUNFROZEN
391         }
392     }
393 }