src/3rdparty/javascriptcore/WebKit.pri
changeset 30 5dc02b23752f
parent 3 41300fa6a67c
child 33 3e2da88830cd
equal deleted inserted replaced
29:b72c6db6890b 30:5dc02b23752f
     1 # Include file to make it easy to include WebKit into Qt projects
     1 # Include file to make it easy to include WebKit into Qt projects
     2 
     2 
       
     3 # Detect that we are building as a standalone package by the presence of
       
     4 # either the generated files directory or as part of the Qt package through
       
     5 # QTDIR_build
       
     6 CONFIG(QTDIR_build): CONFIG += standalone_package
       
     7 else:exists($$PWD/WebCore/generated): CONFIG += standalone_package
       
     8 
       
     9 CONFIG(standalone_package) {
       
    10     OUTPUT_DIR=$$PWD
       
    11 }
       
    12 
       
    13 CONFIG += depend_includepath
     3 
    14 
     4 isEmpty(OUTPUT_DIR) {
    15 isEmpty(OUTPUT_DIR) {
     5     CONFIG(debug, debug|release) {
    16     CONFIG(debug, debug|release) {
     6         OUTPUT_DIR=$$PWD/WebKitBuild/Debug
    17         OUTPUT_DIR=$$PWD/WebKitBuild/Debug
     7     } else { # Release
    18     } else { # Release
    15 } else {
    26 } else {
    16     CONFIG(QTDIR_build) {
    27     CONFIG(QTDIR_build) {
    17         QT += webkit
    28         QT += webkit
    18     } else {
    29     } else {
    19         QMAKE_LIBDIR = $$OUTPUT_DIR/lib $$QMAKE_LIBDIR
    30         QMAKE_LIBDIR = $$OUTPUT_DIR/lib $$QMAKE_LIBDIR
       
    31         QTWEBKITLIBNAME = QtWebKit
    20         mac:!static:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework) {
    32         mac:!static:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework) {
    21             LIBS += -framework QtWebKit
    33             LIBS += -framework $$QTWEBKITLIBNAME
    22             QMAKE_FRAMEWORKPATH = $$OUTPUT_DIR/lib $$QMAKE_FRAMEWORKPATH
    34             QMAKE_FRAMEWORKPATH = $$OUTPUT_DIR/lib $$QMAKE_FRAMEWORKPATH
    23         } else {
    35         } else {
    24             win32-*|wince* {
    36             win32-*|wince* {
    25                 LIBS += -lQtWebKit$${QT_MAJOR_VERSION}
    37                 CONFIG(debug, debug|release):build_pass: QTWEBKITLIBNAME = $${QTWEBKITLIBNAME}d
       
    38                 QTWEBKITLIBNAME = $${QTWEBKITLIBNAME}$${QT_MAJOR_VERSION}
       
    39                 win32-g++: LIBS += -l$$QTWEBKITLIBNAME
       
    40                 else: LIBS += $${QTWEBKITLIBNAME}.lib
    26             } else {
    41             } else {
    27                 LIBS += -lQtWebKit
    42                 LIBS += -lQtWebKit
       
    43                 symbian {
       
    44                     TARGET.EPOCSTACKSIZE = 0x14000 // 80 kB
       
    45                     TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 // Min 128kB, Max 32MB
       
    46                 }
    28             }
    47             }
    29         }
    48         }
    30     }
    49     }
    31     DEPENDPATH += $$PWD/WebKit/qt/Api
    50     DEPENDPATH += $$PWD/WebKit/qt/Api
    32 }
    51 }
       
    52 greaterThan(QT_MINOR_VERSION, 5):DEFINES += WTF_USE_ACCELERATED_COMPOSITING
    33 
    53 
    34 !mac:!unix|symbian {
    54 !mac:!unix|symbian {
    35     DEFINES += USE_SYSTEM_MALLOC
    55     DEFINES += USE_SYSTEM_MALLOC
    36 }
    56 }
    37 
    57 
    41 
    61 
    42 BASE_DIR = $$PWD
    62 BASE_DIR = $$PWD
    43 INCLUDEPATH += $$PWD/WebKit/qt/Api
    63 INCLUDEPATH += $$PWD/WebKit/qt/Api
    44 
    64 
    45 CONFIG -= warn_on
    65 CONFIG -= warn_on
    46 *-g++*:QMAKE_CXXFLAGS += -Wreturn-type -fno-strict-aliasing
    66 *-g++*:QMAKE_CXXFLAGS += -Wall -Wreturn-type -fno-strict-aliasing -Wcast-align -Wchar-subscripts -Wformat-security -Wreturn-type -Wno-unused-parameter -Wno-sign-compare -Wno-switch -Wno-switch-enum -Wundef -Wmissing-noreturn -Winit-self
    47 #QMAKE_CXXFLAGS += -Wall -Wno-undef -Wno-unused-parameter
       
    48 
    67 
    49 # Enable GNU compiler extensions to the ARM compiler for all Qt ports using RVCT
    68 # Enable GNU compiler extensions to the ARM compiler for all Qt ports using RVCT
    50 symbian|*-armcc {
    69 symbian|*-armcc {
    51     RVCT_COMMON_CFLAGS = --gnu --diag_suppress 68,111,177,368,830,1293
    70     RVCT_COMMON_CFLAGS = --gnu --diag_suppress 68,111,177,368,830,1293
    52     RVCT_COMMON_CXXFLAGS = $$RVCT_COMMON_CFLAGS --no_parse_templates
    71     RVCT_COMMON_CXXFLAGS = $$RVCT_COMMON_CFLAGS --no_parse_templates
    53     DEFINES *= QT_NO_UITOOLS
    72 }
    54 } 
       
    55 
    73 
    56 *-armcc {
    74 *-armcc {
    57     QMAKE_CFLAGS += $$RVCT_COMMON_CFLAGS
    75     QMAKE_CFLAGS += $$RVCT_COMMON_CFLAGS
    58     QMAKE_CXXFLAGS += $$RVCT_COMMON_CXXFLAGS
    76     QMAKE_CXXFLAGS += $$RVCT_COMMON_CXXFLAGS
    59 }
    77 }
    60 
    78 
    61 symbian {
    79 symbian {
    62     QMAKE_CXXFLAGS.ARMCC += $$RVCT_COMMON_CXXFLAGS
    80     QMAKE_CXXFLAGS.ARMCC += $$RVCT_COMMON_CXXFLAGS
    63 }
    81 }
    64 
    82 
       
    83 symbian|maemo5: DEFINES *= QT_NO_UITOOLS
       
    84 
    65 contains(DEFINES, QT_NO_UITOOLS): CONFIG -= uitools
    85 contains(DEFINES, QT_NO_UITOOLS): CONFIG -= uitools
    66 
    86 
    67 # Disable a few warnings on Windows. The warnings are also
    87 # Disable a few warnings on Windows. The warnings are also
    68 # disabled in WebKitLibraries/win/tools/vsprops/common.vsprops
    88 # disabled in WebKitLibraries/win/tools/vsprops/common.vsprops
    69 win32-msvc*: QMAKE_CXXFLAGS += -wd4291 -wd4344 -wd4503 -wd4800 -wd4819 -wd4996
    89 win32-msvc*: QMAKE_CXXFLAGS += -wd4291 -wd4344 -wd4396 -wd4503 -wd4800 -wd4819 -wd4996
    70 
    90 
    71 #
       
    72 # For builds inside Qt we interpret the output rule and the input of each extra compiler manually
       
    73 # and add the resulting sources to the SOURCES variable, because the build inside Qt contains already
       
    74 # all the generated files. We do not need to generate any extra compiler rules in that case.
       
    75 #
       
    76 # In addition this function adds a new target called 'generated_files' that allows manually calling
       
    77 # all the extra compilers to generate all the necessary files for the build using 'make generated_files'
       
    78 #
       
    79 defineTest(addExtraCompiler) {
       
    80     CONFIG(QTDIR_build) {
       
    81         outputRule = $$eval($${1}.output)
       
    82         outVariable = $$eval($${1}.variable_out)
       
    83         !isEqual(outVariable,GENERATED_SOURCES):return(true)
       
    84 
       
    85         input = $$eval($${1}.input)
       
    86         input = $$eval($$input)
       
    87 
       
    88         for(file,input) {
       
    89             base = $$basename(file)
       
    90             base ~= s/\..+//
       
    91             newfile=$$replace(outputRule,\\$\\{QMAKE_FILE_BASE\\},$$base)
       
    92             SOURCES += $$newfile
       
    93         }
       
    94 
       
    95         export(SOURCES)
       
    96     } else {
       
    97         QMAKE_EXTRA_COMPILERS += $$1
       
    98         generated_files.depends += compiler_$${1}_make_all
       
    99         export(QMAKE_EXTRA_COMPILERS)
       
   100         export(generated_files.depends)
       
   101     }
       
   102     return(true)
       
   103 }
       
   104 
       
   105 defineTest(addExtraCompilerWithHeader) {
       
   106     addExtraCompiler($$1)
       
   107 
       
   108     eval(headerFile = $${2})
       
   109     isEmpty(headerFile) {
       
   110         eval($${1}_header.output = $$eval($${1}.output))
       
   111         eval($${1}_header.output ~= s/\.cpp/.h/)
       
   112         eval($${1}_header.output ~= s/\.c/.h/)
       
   113     } else {
       
   114         eval($${1}_header.output = $$headerFile)
       
   115     }
       
   116 
       
   117     eval($${1}_header.input = $$eval($${1}.input))
       
   118     eval($${1}_header.commands = @echo -n '')
       
   119     eval($${1}_header.depends = compiler_$${1}_make_all)
       
   120     eval($${1}_header.variable_out = GENERATED_FILES)
       
   121 
       
   122     export($${1}_header.output)
       
   123     export($${1}_header.input)
       
   124     export($${1}_header.commands)
       
   125     export($${1}_header.depends)
       
   126     export($${1}_header.variable_out)
       
   127 
       
   128     !CONFIG(QTDIR_build): QMAKE_EXTRA_COMPILERS += $${1}_header
       
   129 
       
   130     export(QMAKE_EXTRA_COMPILERS)
       
   131     export(generated_files.depends)
       
   132     export(SOURCES)
       
   133 
       
   134     return(true)
       
   135 }
       
   136