Unreviewed build correction after http://trac.webkit.org/changeset/46978
[webbrowser.git] / WebKit.pri
blob6e721d68e712f92202ee19f90798048926160fcc
1 # Include file to make it easy to include WebKit into Qt projects
4 isEmpty(OUTPUT_DIR) {
5     CONFIG(debug, debug|release) {
6         OUTPUT_DIR=$$PWD/WebKitBuild/Debug
7     } else { # Release
8         OUTPUT_DIR=$$PWD/WebKitBuild/Release
9     }
12 DEFINES += BUILDING_QT__=1
13 building-libs {
14     win32-msvc*: INCLUDEPATH += $$PWD/JavaScriptCore/os-win32
15 } else {
16     CONFIG(QTDIR_build) {
17         QT += webkit
18     } else {
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
23         } else {
24             win32-*|wince* {
25                 LIBS += -lQtWebKit$${QT_MAJOR_VERSION}
26             } else {
27                 LIBS += -lQtWebKit
28             }
29         }
30     }
31     DEPENDPATH += $$PWD/WebKit/qt/Api
34 DEFINES += USE_SYSTEM_MALLOC
35 CONFIG(release, debug|release) {
36     DEFINES += NDEBUG
39 BASE_DIR = $$PWD
40 INCLUDEPATH += $$PWD/WebKit/qt/Api
42 CONFIG -= warn_on
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
47 *-armcc {
48     QMAKE_CFLAGS += --gnu
49     QMAKE_CXXFLAGS += --gnu --no_parse_templates
50
52 symbian {
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) {
72     CONFIG(QTDIR_build) {
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)
80         for(file,input) {
81             base = $$basename(file)
82             base ~= s/\..+//
83             newfile=$$replace(outputRule,\\$\\{QMAKE_FILE_BASE\\},$$base)
84             SOURCES += $$newfile
85         }
87         export(SOURCES)
88     } else {
89         QMAKE_EXTRA_COMPILERS += $$1
90         generated_files.depends += compiler_$${1}_make_all
91         export(QMAKE_EXTRA_COMPILERS)
92         export(generated_files.depends)
93     }
94     return(true)
97 defineTest(addExtraCompilerWithHeader) {
98     addExtraCompiler($$1)
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/)
105     } else {
106         eval($${1}_header.output = $$headerFile)
107     }
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)
124     export(SOURCES)
126     return(true)