2010-06-17 Shu Chang <chang.shu@nokia.com>
[WebKit-https.git] / JavaScriptCore / JavaScriptCore.pri
1 # JavaScriptCore - Qt4 build info
2
3 include(../common.pri)
4
5 VPATH += $$PWD
6 !CONFIG(release, debug|release) {
7     # Output in JavaScriptCore/<config>
8     JAVASCRIPTCORE_DESTDIR = debug
9     # Use a config-specific target to prevent parallel builds file clashes on Mac
10     JAVASCRIPTCORE_TARGET = jscored
11 } else {
12     JAVASCRIPTCORE_DESTDIR = release
13     JAVASCRIPTCORE_TARGET = jscore
14 }
15 CONFIG(standalone_package) {
16     isEmpty(JSC_GENERATED_SOURCES_DIR):JSC_GENERATED_SOURCES_DIR = $$PWD/generated
17 } else {
18     isEmpty(JSC_GENERATED_SOURCES_DIR):JSC_GENERATED_SOURCES_DIR = generated
19 }
20
21 CONFIG(standalone_package): DEFINES *= NDEBUG
22
23 symbian: {
24     # Need to guarantee this comes before system includes of /epoc32/include
25     MMP_RULES += "USERINCLUDE ../JavaScriptCore/profiler"
26     LIBS += -lhal
27     # For hal.h
28     INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE
29 }
30
31 INCLUDEPATH = \
32     $$PWD \
33     $$PWD/.. \
34     $$PWD/assembler \
35     $$PWD/bytecode \
36     $$PWD/bytecompiler \
37     $$PWD/debugger \
38     $$PWD/interpreter \
39     $$PWD/jit \
40     $$PWD/parser \
41     $$PWD/pcre \
42     $$PWD/profiler \
43     $$PWD/runtime \
44     $$PWD/wtf \
45     $$PWD/wtf/symbian \
46     $$PWD/wtf/unicode \
47     $$PWD/yarr \
48     $$PWD/API \
49     $$PWD/ForwardingHeaders \
50     $$JSC_GENERATED_SOURCES_DIR \
51     $$INCLUDEPATH
52
53 win32-*: DEFINES += _HAS_TR1=0
54
55 DEFINES += BUILDING_QT__ BUILDING_JavaScriptCore BUILDING_WTF
56
57 wince* {
58     INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/ce-compat
59     DEFINES += WINCEBASIC
60
61     INCLUDEPATH += $$PWD/../JavaScriptCore/os-wince
62     INCLUDEPATH += $$PWD/../JavaScriptCore/os-win32
63 }
64
65
66 defineTest(addJavaScriptCoreLib) {
67     # Argument is the relative path to JavaScriptCore.pro's qmake output
68     pathToJavaScriptCoreOutput = $$ARGS/$$JAVASCRIPTCORE_DESTDIR
69
70     win32-msvc*|wince* {
71         LIBS += -L$$pathToJavaScriptCoreOutput
72         LIBS += -l$$JAVASCRIPTCORE_TARGET
73         POST_TARGETDEPS += $${pathToJavaScriptCoreOutput}$${QMAKE_DIR_SEP}$${JAVASCRIPTCORE_TARGET}.lib
74     } else:symbian {
75         LIBS += -l$${JAVASCRIPTCORE_TARGET}.lib
76         # The default symbian build system does not use library paths at all. However when building with
77         # qmake's symbian makespec that uses Makefiles
78         QMAKE_LIBDIR += $$pathToJavaScriptCoreOutput
79         POST_TARGETDEPS += $${pathToJavaScriptCoreOutput}$${QMAKE_DIR_SEP}$${JAVASCRIPTCORE_TARGET}.lib
80     } else {
81         # Make sure jscore will be early in the list of libraries to workaround a bug in MinGW
82         # that can't resolve symbols from QtCore if libjscore comes after.
83         QMAKE_LIBDIR = $$pathToJavaScriptCoreOutput $$QMAKE_LIBDIR
84         LIBS += -l$$JAVASCRIPTCORE_TARGET
85         POST_TARGETDEPS += $${pathToJavaScriptCoreOutput}$${QMAKE_DIR_SEP}lib$${JAVASCRIPTCORE_TARGET}.a
86     }
87
88     win32-* {
89         LIBS += -lwinmm
90     }
91
92     # The following line is to prevent qmake from adding jscore to libQtWebKit's prl dependencies.
93     # The compromise we have to accept by disabling explicitlib is to drop support to link QtWebKit and QtScript
94     # statically in applications (which isn't used often because, among other things, of licensing obstacles).
95     CONFIG -= explicitlib
96
97     export(QMAKE_LIBDIR)
98     export(LIBS)
99     export(POST_TARGETDEPS)
100     export(CONFIG)
101
102     return(true)
103 }