1 # Include file to make it easy to include WebKit into Qt projects
5 CONFIG(debug, debug|release) {
6 OUTPUT_DIR=$$PWD/WebKitBuild/Debug
8 OUTPUT_DIR=$$PWD/WebKitBuild/Release
12 DEFINES += BUILDING_QT__=1
14 win32-msvc*: INCLUDEPATH += $$PWD/JavaScriptCore/os-win32
19 QMAKE_LIBDIR = $$OUTPUT_DIR/lib $$QMAKE_LIBDIR
20 mac:!static:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework) {
21 LIBS += -framework QtWebKit
22 QMAKE_FRAMEWORKPATH = $$OUTPUT_DIR/lib $$QMAKE_FRAMEWORKPATH
25 LIBS += -lQtWebKit$${QT_MAJOR_VERSION}
31 DEPENDPATH += $$PWD/WebKit/qt/Api
34 DEFINES += USE_SYSTEM_MALLOC
35 CONFIG(release, debug|release) {
40 INCLUDEPATH += $$PWD/WebKit/qt/Api
43 *-g++*:QMAKE_CXXFLAGS += -Wreturn-type -fno-strict-aliasing
44 #QMAKE_CXXFLAGS += -Wall -Wno-undef -Wno-unused-parameter
46 # Enable GNU compiler extensions to the ARM compiler for all Qt ports using RVCT
49 QMAKE_CXXFLAGS += --gnu --no_parse_templates
53 QMAKE_CXXFLAGS.ARMCC += --gnu --no_parse_templates
54 DEFINES *= QT_NO_UITOOLS
57 contains(DEFINES, QT_NO_UITOOLS): CONFIG -= uitools
59 # Disable a few warnings on Windows. The warnings are also
60 # disabled in WebKitLibraries/win/tools/vsprops/common.vsprops
61 win32-msvc*: QMAKE_CXXFLAGS += -wd4291 -wd4344 -wd4503 -wd4800 -wd4819 -wd4996
64 # For builds inside Qt we interpret the output rule and the input of each extra compiler manually
65 # and add the resulting sources to the SOURCES variable, because the build inside Qt contains already
66 # all the generated files. We do not need to generate any extra compiler rules in that case.
68 # In addition this function adds a new target called 'generated_files' that allows manually calling
69 # all the extra compilers to generate all the necessary files for the build using 'make generated_files'
71 defineTest(addExtraCompiler) {
73 outputRule = $$eval($${1}.output)
74 outVariable = $$eval($${1}.variable_out)
75 !isEqual(outVariable,GENERATED_SOURCES):return(true)
77 input = $$eval($${1}.input)
78 input = $$eval($$input)
81 base = $$basename(file)
83 newfile=$$replace(outputRule,\\$\\{QMAKE_FILE_BASE\\},$$base)
89 QMAKE_EXTRA_COMPILERS += $$1
90 generated_files.depends += compiler_$${1}_make_all
91 export(QMAKE_EXTRA_COMPILERS)
92 export(generated_files.depends)
97 defineTest(addExtraCompilerWithHeader) {
100 eval(headerFile = $${2})
101 isEmpty(headerFile) {
102 eval($${1}_header.output = $$eval($${1}.output))
103 eval($${1}_header.output ~= s/\.cpp/.h/)
104 eval($${1}_header.output ~= s/\.c/.h/)
106 eval($${1}_header.output = $$headerFile)
109 eval($${1}_header.input = $$eval($${1}.input))
110 eval($${1}_header.commands = @echo -n '')
111 eval($${1}_header.depends = compiler_$${1}_make_all)
112 eval($${1}_header.variable_out = GENERATED_FILES)
114 export($${1}_header.output)
115 export($${1}_header.input)
116 export($${1}_header.commands)
117 export($${1}_header.depends)
118 export($${1}_header.variable_out)
120 !CONFIG(QTDIR_build): QMAKE_EXTRA_COMPILERS += $${1}_header
122 export(QMAKE_EXTRA_COMPILERS)
123 export(generated_files.depends)