DFG should be able to set watchpoints on global variables
[WebKit-https.git] / Source / api.pri
1 # -------------------------------------------------------------------
2 # Project file for the QtWebKit C++ APIs
3 #
4 # See 'Tools/qmake/README' for an overview of the build system
5 # -------------------------------------------------------------------
6
7 TEMPLATE = lib
8 TARGET = QtWebKit
9
10 WEBKIT_DESTDIR = $${ROOT_BUILD_DIR}/lib
11
12 haveQt(5) {
13     # Use Qt5's module system
14     load(qt_module)
15     MODULE = webkit
16     MODULE_PRI = $$QT.webkit.module_pri
17     CONFIG += module
18
19     BASE_TARGET = $$TARGET
20
21     load(qt_module_config)
22
23     # Make sure the module config doesn't override our preferred build config
24     debug_and_release:if(!debug|!release): CONFIG -= debug_and_release
25
26     # Allow doing a debug-only build of WebKit (not supported by Qt)
27     macx:!debug_and_release:debug: TARGET = $$BASE_TARGET
28
29     # ---------------- Custom developer-build handling -------------------
30     #
31     # The assumption for Qt developer builds is that the module file
32     # will be put into qtbase/mkspecs/modules, and the libraries into
33     # qtbase/lib, with rpath/install_name set to the Qt lib dir.
34     #
35     # For WebKit we don't want that behavior for the libraries, as we want
36     # them to be self-contained in the WebKit build dir. To achive that we
37     # trick Qt into thinking it's not a developer build, but setting QTDIR
38     # to a bogus path in default_pre.prf.
39     #
40     # We still want the module file to live in the Qt dir so the module can
41     # be used by setting QT += webkit, so we copy the file manually. We also
42     # have to make sure the rpath/install_name of the libraries are relative
43     # to the webkit build dir.
44
45     !build_pass {
46         # Make a more accessible copy of the module forward file
47         # in the WebKit build directory.
48         convenience_module_path = $${ROOT_BUILD_DIR}/modules
49         module_filename = $$basename(QT.webkit.module_pri)
50
51         # The QMAKE_EXTRA_MODULE_FORWARDS might contain more than one path,
52         # so we iterate the paths and find one that matches our build dir.
53         for(module_forward, QMAKE_EXTRA_MODULE_FORWARDS) {
54             in_build_dir = $$find(module_forward, ^$${ROOT_BUILD_DIR})
55             !isEmpty(in_build_dir) {
56                 webkit_module_forward = $$module_forward
57                 break()
58             }
59         }
60
61         isEmpty(webkit_module_forward) {
62             warning(Could not resolve QMAKE_EXTRA_MODULE_FORWARDS path!)
63         } else {
64             make_module_fwd_convenience.target = $$convenience_module_path/$$module_filename
65             make_module_fwd_convenience.commands = $$QMAKE_MKDIR $$convenience_module_path \
66                 && echo \"include($$webkit_module_forward/$$module_filename)\" > $$convenience_module_path/$$module_filename
67             make_module_fwd_convenience.depends = $$webkit_module_forward/$$module_filename
68
69             QMAKE_EXTRA_TARGETS += make_module_fwd_convenience
70             DEFAULT_TARGETS += make_module_fwd_convenience
71         }
72
73         qt_developer_build {
74             # Copy the module forward file into Qt so that the module
75             # is immediately accessible.
76             qt_modules_path = $$[QT_INSTALL_PREFIX]/mkspecs/modules
77
78             copy_module_fwd_file.target = $$qt_modules_path/$$module_filename
79             copy_module_fwd_file.commands = $$QMAKE_COPY $$QMAKE_EXTRA_MODULE_FORWARDS/$$module_filename $$qt_modules_path
80             # FIXME: Add dependendy that ensures we copy the forward file if the target is updated
81             copy_module_fwd_file.depends = $$QMAKE_EXTRA_MODULE_FORWARDS/$$module_filename
82
83             QMAKE_EXTRA_TARGETS += copy_module_fwd_file
84             DEFAULT_TARGETS += copy_module_fwd_file
85         }
86     }
87
88     # Make sure the install_name of the QtWebKit library point to webkit
89     macx {
90         # We do our own absolute path so that we can trick qmake into
91         # using the webkit build path instead of the Qt install path.
92         CONFIG -= absolute_library_soname
93         QMAKE_LFLAGS_SONAME = $$QMAKE_LFLAGS_SONAME$$WEBKIT_DESTDIR/
94
95         !debug_and_release|build_pass {
96             # We also have to make sure the install_name is correct when
97             # the library is installed.
98             change_install_name.depends = install_target
99
100             # The install rules generated by qmake for frameworks are busted in
101             # that both the debug and the release makefile copy QtWebKit.framework
102             # into the install dir, so whatever changes we did to the release library
103             # will get overwritten when the debug library is installed. We work around
104             # that by running install_name on both, for both configs.
105             change_install_name.commands = framework_dir=\$\$(dirname $(TARGETD)); \
106                 for file in \$\$(ls $$[QT_INSTALL_LIBS]/\$\$framework_dir/$$BASE_TARGET*); do \
107                     install_name_tool -id \$\$file \$\$file; \
108                 done
109             default_install_target.target = install
110             default_install_target.depends += change_install_name
111
112             QMAKE_EXTRA_TARGETS += change_install_name default_install_target
113         }
114     }
115 } else {
116     VERSION = $$QT_VERSION
117     DESTDIR = $$WEBKIT_DESTDIR
118 }
119
120 runSyncQt() # Generate forwarding headers for the QtWebKit API
121
122 load(features)
123
124 include(WebKit/WebKit.pri)
125
126 WEBKIT += wtf
127
128 !v8:WEBKIT += javascriptcore
129
130 WEBKIT += webcore
131
132 !no_webkit2 {
133     WEBKIT += webkit2
134     QT += declarative
135
136     # Ensure that changes to the WebKit2 API will trigger a qmake of this
137     # file, which in turn runs syncqt to update the forwarding headers.
138     QMAKE_INTERNAL_INCLUDED_FILES *= WebKit2/Target.pri
139 }
140
141 QT += network
142 haveQt(5): QT += widgets printsupport quick
143
144 contains(DEFINES, WTF_USE_TEXTURE_MAPPER_GL=1)|contains(DEFINES, ENABLE_WEBGL=1) {
145     QT *= opengl
146     # Make sure OpenGL libs are after the webcore lib so MinGW can resolve symbols
147     win32*:!win32-msvc*: LIBS += $$QMAKE_LIBS_OPENGL
148 }
149
150 !static: DEFINES += QT_MAKEDLL
151
152 SOURCES += \
153     $$PWD/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp \
154     $$PWD/WebKit/qt/WebCoreSupport/QtWebComboBox.cpp \
155     $$PWD/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp \
156     $$PWD/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp \
157     $$PWD/WebKit/qt/WebCoreSupport/DragClientQt.cpp \
158     $$PWD/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp \
159     $$PWD/WebKit/qt/WebCoreSupport/EditorClientQt.cpp \
160     $$PWD/WebKit/qt/WebCoreSupport/UndoStepQt.cpp \
161     $$PWD/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp \
162     $$PWD/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp \
163     $$PWD/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.cpp \
164     $$PWD/WebKit/qt/WebCoreSupport/InitWebCoreQt.cpp \
165     $$PWD/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp \
166     $$PWD/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp \
167     $$PWD/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp \
168     $$PWD/WebKit/qt/WebCoreSupport/PageClientQt.cpp \
169     $$PWD/WebKit/qt/WebCoreSupport/PopupMenuQt.cpp \
170     $$PWD/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp \
171     $$PWD/WebKit/qt/WebCoreSupport/RenderThemeQStyle.cpp \
172     $$PWD/WebKit/qt/WebCoreSupport/ScrollbarThemeQStyle.cpp \
173     $$PWD/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.cpp \
174     $$PWD/WebKit/qt/WebCoreSupport/TextCheckerClientQt.cpp \
175     $$PWD/WebKit/qt/WebCoreSupport/PlatformStrategiesQt.cpp \
176     $$PWD/WebKit/qt/WebCoreSupport/WebEventConversion.cpp
177
178 HEADERS += \
179     $$PWD/WebKit/qt/WebCoreSupport/InitWebCoreQt.h \
180     $$PWD/WebKit/qt/WebCoreSupport/InspectorServerQt.h \
181     $$PWD/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h \
182     $$PWD/WebKit/qt/WebCoreSupport/QtWebComboBox.h \
183     $$PWD/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h \
184     $$PWD/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.h \
185     $$PWD/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.h \
186     $$PWD/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h \
187     $$PWD/WebKit/qt/WebCoreSupport/PageClientQt.h \
188     $$PWD/WebKit/qt/WebCoreSupport/PopupMenuQt.h \
189     $$PWD/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h \
190     $$PWD/WebKit/qt/WebCoreSupport/RenderThemeQStyle.h \
191     $$PWD/WebKit/qt/WebCoreSupport/ScrollbarThemeQStyle.h \
192     $$PWD/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.h \
193     $$PWD/WebKit/qt/WebCoreSupport/TextCheckerClientQt.h \
194     $$PWD/WebKit/qt/WebCoreSupport/PlatformStrategiesQt.h \
195     $$PWD/WebKit/qt/WebCoreSupport/WebEventConversion.h
196
197 INCLUDEPATH += \
198     $$PWD/WebKit/qt/Api \
199     $$PWD/WebKit/qt/WebCoreSupport \
200     $$PWD/WTF/wtf/qt
201
202 contains(DEFINES, ENABLE_VIDEO=1) {
203     !contains(DEFINES, WTF_USE_QTKIT=1):!contains(DEFINES, WTF_USE_GSTREAMER=1):contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
204         HEADERS += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.h
205         SOURCES += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.cpp
206     }
207
208     contains(DEFINES, WTF_USE_QTKIT=1) | contains(DEFINES, WTF_USE_GSTREAMER=1) | contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
209         HEADERS += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h
210         SOURCES += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp
211     }
212
213     contains(DEFINES, WTF_USE_QTKIT=1) {
214         INCLUDEPATH += \
215             $$PWD/WebCore/platform/qt/ \
216             $$PWD/WebCore/platform/mac/ \
217             $$PWD/../WebKitLibraries/
218
219         DEFINES += NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
220
221         contains(CONFIG, "x86") {
222             DEFINES+=NS_BUILD_32_LIKE_64
223         }
224
225         HEADERS += \
226             $$PWD/WebKit/qt/WebCoreSupport/WebSystemInterface.h \
227             $$PWD/WebKit/qt/WebCoreSupport/QTKitFullScreenVideoHandler.h
228
229         OBJECTIVE_SOURCES += \
230             $$PWD/WebKit/qt/WebCoreSupport/WebSystemInterface.mm \
231             $$PWD/WebKit/qt/WebCoreSupport/QTKitFullScreenVideoHandler.mm
232
233         LIBS += -framework Security -framework IOKit
234
235         # We can know the Mac OS version by using the Darwin major version
236         DARWIN_VERSION = $$split(QMAKE_HOST.version, ".")
237         DARWIN_MAJOR_VERSION = $$first(DARWIN_VERSION)
238         equals(DARWIN_MAJOR_VERSION, "11") {
239             LIBS += $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceLion.a
240         } else:equals(DARWIN_MAJOR_VERSION, "10") {
241             LIBS += $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
242         } else:equals(DARWIN_MAJOR_VERSION, "9") {
243             LIBS += $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceLeopard.a
244         }
245     }
246 }
247
248 contains(DEFINES, ENABLE_ICONDATABASE=1) {
249     HEADERS += \
250         $$PWD/WebCore/loader/icon/IconDatabaseClient.h \
251         $$PWD/WebKit/qt/WebCoreSupport/IconDatabaseClientQt.h
252
253     SOURCES += \
254         $$PWD/WebKit/qt/WebCoreSupport/IconDatabaseClientQt.cpp
255 }
256
257 contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) || contains(DEFINES, ENABLE_ORIENTATION_EVENTS=1) {
258     haveQt(5) {
259         QT += sensors
260     } else {
261         CONFIG *= mobility
262         MOBILITY *= sensors
263     }
264 }
265
266 contains(DEFINES, ENABLE_GEOLOCATION=1) {
267      haveQt(5): QT += location
268
269      HEADERS += \
270         $$PWD/WebKit/qt/WebCoreSupport/GeolocationClientQt.h
271      SOURCES += \
272         $$PWD/WebKit/qt/WebCoreSupport/GeolocationClientQt.cpp
273 }
274
275 contains(CONFIG, texmap) {
276     DEFINES += WTF_USE_TEXTURE_MAPPER=1
277 }
278
279 plugin_backend_xlib: PKGCONFIG += x11
280
281 # ------------- Install rules -------------
282
283 haveQt(5) {
284     # Install rules handled by Qt's module system
285 } else {
286     # For Qt4 we have to set up install rules manually
287
288     # Syncqt has already run at this point, so we can use headers.pri
289     # as a basis for our install-rules
290     HEADERS_PRI = $${ROOT_BUILD_DIR}/include/$${QT.webkit.name}/headers.pri
291     !include($$HEADERS_PRI): error(Failed to resolve install headers)
292
293     headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES
294     !isEmpty(INSTALL_HEADERS): headers.path = $$INSTALL_HEADERS/$${TARGET}
295     else: headers.path = $$[QT_INSTALL_HEADERS]/$${TARGET}
296     INSTALLS += headers
297
298     !isEmpty(INSTALL_LIBS): target.path = $$INSTALL_LIBS
299     else: target.path = $$[QT_INSTALL_LIBS]
300     INSTALLS += target
301
302     unix {
303         CONFIG += create_pc create_prl
304         QMAKE_PKGCONFIG_LIBDIR = $$target.path
305         QMAKE_PKGCONFIG_INCDIR = $$headers.path
306         QMAKE_PKGCONFIG_DESTDIR = pkgconfig
307         lib_replace.match = $$re_escape($$DESTDIR)
308         lib_replace.replace = $$[QT_INSTALL_LIBS]
309         QMAKE_PKGCONFIG_INSTALL_REPLACE += lib_replace
310     }
311
312     mac {
313         !static:contains(QT_CONFIG, qt_framework) {
314             # Build QtWebKit as a framework, to match how Qt was built
315             CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework
316
317             # For debug_and_release configs, only copy headers in release
318             !debug_and_release|if(build_pass:CONFIG(release, debug|release)) {
319                 FRAMEWORK_HEADERS.version = Versions
320                 FRAMEWORK_HEADERS.files = $${headers.files}
321                 FRAMEWORK_HEADERS.path = Headers
322                 QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
323             }
324         }
325
326         QMAKE_LFLAGS_SONAME = "$${QMAKE_LFLAGS_SONAME}$${DESTDIR}$${QMAKE_DIR_SEP}"
327     }
328 }