6d8301610049f78e6e09981e970693bb0c39d9d1
[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 DESTDIR = $${ROOT_BUILD_DIR}/lib
11
12 load(features)
13
14 include(WebKit/WebKit.pri)
15
16 !v8:CONFIG += javascriptcore
17
18 CONFIG += webcore
19
20 !no_webkit2 {
21     CONFIG += webkit2
22     QT += declarative
23 }
24
25 v8:linux-* {
26     QMAKE_LIBDIR += $${V8_LIB_DIR}
27     LIBS = -lv8 $$LIBS
28 }
29
30 QT += network
31 haveQt(5): QT += widgets printsupport
32
33 win32*:!win32-msvc* {
34     # Make sure OpenGL libs are after the webcore lib so MinGW can resolve symbols
35     contains(DEFINES, ENABLE_WEBGL=1)|contains(CONFIG, texmap): LIBS += $$QMAKE_LIBS_OPENGL
36 }
37
38 !static: DEFINES += QT_MAKEDLL
39
40 SOURCES += \
41     $$PWD/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp \
42     $$PWD/WebKit/qt/WebCoreSupport/QtWebComboBox.cpp \
43     $$PWD/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp \
44     $$PWD/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp \
45     $$PWD/WebKit/qt/WebCoreSupport/DragClientQt.cpp \
46     $$PWD/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp \
47     $$PWD/WebKit/qt/WebCoreSupport/EditorClientQt.cpp \
48     $$PWD/WebKit/qt/WebCoreSupport/EditCommandQt.cpp \
49     $$PWD/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp \
50     $$PWD/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp \
51     $$PWD/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.cpp \
52     $$PWD/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp \
53     $$PWD/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp \
54     $$PWD/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp \
55     $$PWD/WebKit/qt/WebCoreSupport/PageClientQt.cpp \
56     $$PWD/WebKit/qt/WebCoreSupport/PopupMenuQt.cpp \
57     $$PWD/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp \
58     $$PWD/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.cpp \
59     $$PWD/WebKit/qt/WebCoreSupport/TextCheckerClientQt.cpp \
60     $$PWD/WebKit/qt/WebCoreSupport/PlatformStrategiesQt.cpp
61
62 HEADERS += \
63     $$PWD/WebKit/qt/WebCoreSupport/InspectorServerQt.h \
64     $$PWD/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h \
65     $$PWD/WebKit/qt/WebCoreSupport/QtWebComboBox.h \
66     $$PWD/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h \
67     $$PWD/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.h \
68     $$PWD/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.h \
69     $$PWD/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h \
70     $$PWD/WebKit/qt/WebCoreSupport/PageClientQt.h \
71     $$PWD/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h \
72     $$PWD/WebKit/qt/WebCoreSupport/PopupMenuQt.h \
73     $$PWD/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.h \
74     $$PWD/WebKit/qt/WebCoreSupport/TextCheckerClientQt.h \
75     $$PWD/WebKit/qt/WebCoreSupport/PlatformStrategiesQt.h
76
77 contains(DEFINES, ENABLE_VIDEO=1) {
78     !contains(DEFINES, WTF_USE_QTKIT=1):!contains(DEFINES, WTF_USE_GSTREAMER=1):contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
79         HEADERS += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.h
80         SOURCES += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.cpp
81     }
82
83     contains(DEFINES, WTF_USE_QTKIT=1) | contains(DEFINES, WTF_USE_GSTREAMER=1) | contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
84         HEADERS += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h
85         SOURCES += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp
86     }
87
88     contains(DEFINES, WTF_USE_QTKIT=1) {
89         INCLUDEPATH += \
90             $$PWD/WebCore/platform/qt/ \
91             $$PWD/WebCore/platform/mac/ \
92             $$PWD/../WebKitLibraries/
93
94         DEFINES += NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
95
96         contains(CONFIG, "x86") {
97             DEFINES+=NS_BUILD_32_LIKE_64
98         }
99
100         HEADERS += \
101             $$PWD/WebKit/qt/WebCoreSupport/WebSystemInterface.h \
102             $$PWD/WebKit/qt/WebCoreSupport/QTKitFullScreenVideoHandler.h
103
104         OBJECTIVE_SOURCES += \
105             $$PWD/WebKit/qt/WebCoreSupport/WebSystemInterface.mm \
106             $$PWD/WebKit/qt/WebCoreSupport/QTKitFullScreenVideoHandler.mm
107
108         LIBS += -framework Security -framework IOKit
109
110         # We can know the Mac OS version by using the Darwin major version
111         DARWIN_VERSION = $$split(QMAKE_HOST.version, ".")
112         DARWIN_MAJOR_VERSION = $$first(DARWIN_VERSION)
113         equals(DARWIN_MAJOR_VERSION, "11") {
114             LIBS += $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceLion.a
115         } else:equals(DARWIN_MAJOR_VERSION, "10") {
116             LIBS += $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
117         } else:equals(DARWIN_MAJOR_VERSION, "9") {
118             LIBS += $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceLeopard.a
119         }
120     }
121 }
122
123 contains(DEFINES, ENABLE_ICONDATABASE=1) {
124     HEADERS += \
125         $$PWD/WebCore/loader/icon/IconDatabaseClient.h \
126         $$PWD/WebKit/qt/WebCoreSupport/IconDatabaseClientQt.h
127
128     SOURCES += \
129         $$PWD/WebKit/qt/WebCoreSupport/IconDatabaseClientQt.cpp
130 }
131
132 contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) {
133     HEADERS += \
134         $$PWD/WebKit/qt/WebCoreSupport/DeviceMotionClientQt.h \
135         $$PWD/WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.h \
136         $$PWD/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.h \
137         $$PWD/WebKit/qt/WebCoreSupport/DeviceOrientationClientMockQt.h \
138         $$PWD/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.h
139
140     SOURCES += \
141         $$PWD/WebKit/qt/WebCoreSupport/DeviceMotionClientQt.cpp \
142         $$PWD/WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.cpp \
143         $$PWD/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.cpp \
144         $$PWD/WebKit/qt/WebCoreSupport/DeviceOrientationClientMockQt.cpp \
145         $$PWD/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.cpp
146 }
147
148 contains(DEFINES, ENABLE_GEOLOCATION=1) {
149      haveQt(5): QT += location
150
151      HEADERS += \
152         $$PWD/WebKit/qt/WebCoreSupport/GeolocationClientQt.h
153      SOURCES += \
154         $$PWD/WebKit/qt/WebCoreSupport/GeolocationClientQt.cpp
155 }
156
157 contains(CONFIG, texmap) {
158     DEFINES += WTF_USE_TEXTURE_MAPPER=1
159 }
160
161
162 # ------------- Install rules -------------
163
164 modulefile.files = $$QT.webkit.modulefile
165 mkspecs = $$[QMAKE_MKSPECS]
166 mkspecs = $$split(mkspecs, :)
167 modulefile.path = $$last(mkspecs)/modules
168 INSTALLS += modulefile
169
170 # Syncqt has already run at this point, so we can use headers.pri
171 # as a basis for our install-rules
172 HEADERS_PRI = $${ROOT_BUILD_DIR}/include/$$TARGET/headers.pri
173 !include($$HEADERS_PRI): error(Failed to resolve install headers)
174
175 headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES
176 !isEmpty(INSTALL_HEADERS): headers.path = $$INSTALL_HEADERS/$${TARGET}
177 else: headers.path = $$[QT_INSTALL_HEADERS]/$${TARGET}
178 INSTALLS += headers
179
180 !isEmpty(INSTALL_LIBS): target.path = $$INSTALL_LIBS
181 else: target.path = $$[QT_INSTALL_LIBS]
182 INSTALLS += target
183
184 unix {
185     CONFIG += create_pc create_prl
186     QMAKE_PKGCONFIG_LIBDIR = $$target.path
187     QMAKE_PKGCONFIG_INCDIR = $$headers.path
188     QMAKE_PKGCONFIG_DESTDIR = pkgconfig
189     lib_replace.match = $$re_escape($$DESTDIR)
190     lib_replace.replace = $$[QT_INSTALL_LIBS]
191     QMAKE_PKGCONFIG_INSTALL_REPLACE += lib_replace
192 }
193
194 mac {
195     !static:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework) {
196         !build_pass {
197             message("Building QtWebKit as a framework, as that's how Qt was built. You can")
198             message("override this by passing CONFIG+=webkit_no_framework to build-webkit.")
199         } else {
200             isEmpty(QT_SOURCE_TREE):debug_and_release:TARGET = $$qtLibraryTarget($$TARGET)
201         }
202
203         CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework
204
205         # For debug_and_release configs, only copy headers in release
206         !debug_and_release|if(build_pass:CONFIG(release, debug|release)) {
207             FRAMEWORK_HEADERS.version = Versions
208             FRAMEWORK_HEADERS.files = $${headers.files}
209             FRAMEWORK_HEADERS.path = Headers
210             QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
211         }
212     }
213
214     QMAKE_LFLAGS_SONAME = "$${QMAKE_LFLAGS_SONAME}$${DESTDIR}$${QMAKE_DIR_SEP}"
215 }
216
217 plugin_backend_xlib {
218     CONFIG *= link_pkgconfig
219     PKGCONFIG += x11
220 }
221
222 linux-g++*: {
223     PRE_TARGETDEPS += $$PWD/qtwebkit-export.map
224     QMAKE_LFLAGS += -Wl,--version-script=$$PWD/qtwebkit-export.map
225 }