| 1 | # Include file to make it easy to include WebKit into Qt projects
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 | isEmpty(OUTPUT_DIR) {
|
|---|
| 5 | CONFIG(release):OUTPUT_DIR=$$PWD/WebKitBuild/Release
|
|---|
| 6 | CONFIG(debug):OUTPUT_DIR=$$PWD/WebKitBuild/Debug
|
|---|
| 7 | }
|
|---|
| 8 |
|
|---|
| 9 | DEFINES += BUILDING_QT__=1
|
|---|
| 10 | building-libs {
|
|---|
| 11 | win32-msvc*: INCLUDEPATH += $$PWD/JavaScriptCore/os-win32
|
|---|
| 12 | } else {
|
|---|
| 13 | CONFIG(QTDIR_build) {
|
|---|
| 14 | QT += webkit
|
|---|
| 15 | } else {
|
|---|
| 16 | QMAKE_LIBDIR = $$OUTPUT_DIR/lib $$QMAKE_LIBDIR
|
|---|
| 17 | LIBS += -lQtWebKit
|
|---|
| 18 | }
|
|---|
| 19 | DEPENDPATH += $$PWD/WebKit/qt/Api
|
|---|
| 20 | }
|
|---|
| 21 |
|
|---|
| 22 | DEFINES += USE_SYSTEM_MALLOC
|
|---|
| 23 | CONFIG(release) {
|
|---|
| 24 | DEFINES += NDEBUG
|
|---|
| 25 | }
|
|---|
| 26 |
|
|---|
| 27 | BASE_DIR = $$PWD
|
|---|
| 28 | INCLUDEPATH += $$PWD/WebKit/qt/Api
|
|---|
| 29 |
|
|---|
| 30 | #
|
|---|
| 31 | # For builds inside Qt we interpret the output rule and the input of each extra compiler manually
|
|---|
| 32 | # and add the resulting sources to the SOURCES variable, because the build inside Qt contains already
|
|---|
| 33 | # all the generated files. We do not need to generate any extra compiler rules in that case.
|
|---|
| 34 | #
|
|---|
| 35 | # In addition this function adds a new target called 'generated_files' that allows manually calling
|
|---|
| 36 | # all the extra compilers to generate all the necessary files for the build using 'make generated_files'
|
|---|
| 37 | #
|
|---|
| 38 | defineTest(addExtraCompiler) {
|
|---|
| 39 | CONFIG(QTDIR_build) {
|
|---|
| 40 | outputRule = $$eval($${1}.output)
|
|---|
| 41 | outVariable = $$eval($${1}.variable_out)
|
|---|
| 42 | !isEqual(outVariable,GENERATED_SOURCES):return(true)
|
|---|
| 43 |
|
|---|
| 44 | input = $$eval($${1}.input)
|
|---|
| 45 | input = $$eval($$input)
|
|---|
| 46 |
|
|---|
| 47 | for(file,input) {
|
|---|
| 48 | base = $$basename(file)
|
|---|
| 49 | base ~= s/\..+//
|
|---|
| 50 | newfile=$$replace(outputRule,\\$\\{QMAKE_FILE_BASE\\},$$base)
|
|---|
| 51 | SOURCES += $$newfile
|
|---|
| 52 | }
|
|---|
| 53 |
|
|---|
| 54 | export(SOURCES)
|
|---|
| 55 | } else {
|
|---|
| 56 | QMAKE_EXTRA_COMPILERS += $$1
|
|---|
| 57 | generated_files.depends += compiler_$${1}_make_all
|
|---|
| 58 | export(QMAKE_EXTRA_COMPILERS)
|
|---|
| 59 | export(generated_files.depends)
|
|---|
| 60 | }
|
|---|
| 61 | return(true)
|
|---|
| 62 | }
|
|---|
| 63 |
|
|---|
| 64 | defineTest(addExtraCompilerWithHeader) {
|
|---|
| 65 | addExtraCompiler($$1)
|
|---|
| 66 |
|
|---|
| 67 | eval(headerFile = $${2})
|
|---|
| 68 | isEmpty(headerFile) {
|
|---|
| 69 | eval($${1}_header.output = $$eval($${1}.output))
|
|---|
| 70 | eval($${1}_header.output ~= s/\.cpp/.h/)
|
|---|
| 71 | eval($${1}_header.output ~= s/\.c/.h/)
|
|---|
| 72 | } else {
|
|---|
| 73 | eval($${1}_header.output = $$headerFile)
|
|---|
| 74 | }
|
|---|
| 75 |
|
|---|
| 76 | eval($${1}_header.input = $$eval($${1}.input))
|
|---|
| 77 | eval($${1}_header.commands = @echo -n '')
|
|---|
| 78 | eval($${1}_header.depends = compiler_$${1}_make_all)
|
|---|
| 79 | eval($${1}_header.variable_out = GENERATED_FILES)
|
|---|
| 80 |
|
|---|
| 81 | export($${1}_header.output)
|
|---|
| 82 | export($${1}_header.input)
|
|---|
| 83 | export($${1}_header.commands)
|
|---|
| 84 | export($${1}_header.depends)
|
|---|
| 85 | export($${1}_header.variable_out)
|
|---|
| 86 |
|
|---|
| 87 | !CONFIG(QTDIR_build): QMAKE_EXTRA_COMPILERS += $${1}_header
|
|---|
| 88 |
|
|---|
| 89 | export(QMAKE_EXTRA_COMPILERS)
|
|---|
| 90 | export(generated_files.depends)
|
|---|
| 91 | export(SOURCES)
|
|---|
| 92 |
|
|---|
| 93 | return(true)
|
|---|
| 94 | }
|
|---|
| 95 |
|
|---|