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