summaryrefslogtreecommitdiff
path: root/Tools/qmake/mkspecs/features/default_pre.prf
blob: 5c36e93131f5bac03e4e17443f2c4046e9b1a6f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# -------------------------------------------------------------------
# QtWebKit defaults for qmake. These rules are parsed before the
# actual project file.
#
# See 'Tools/qmake/README' for an overview of the build system
# -------------------------------------------------------------------

# Allow environment tweaks to pre-loaded .qmake.cache content
env_cache = $$(QMAKE_CACHE_EVAL)
eval($$env_cache)

load(functions)

# FIXME: In this case we probably want to exit early so that we
# don't load all of the custom build tweaks needlessly.
pro_file = $$_PRO_FILE_ # Checking the variable directly does not work
isEmpty(pro_file): CONFIG += recursive_include

# Resolve root directories for source and build
ROOT_WEBKIT_DIR = $$replace(PWD, /Tools/qmake/mkspecs/features$,)
WEBKIT_SUBDIR = $$replace(_PRO_FILE_PWD_, $$re_escape($${ROOT_WEBKIT_DIR}),)
ROOT_BUILD_DIR = $$replace(OUT_PWD, $$re_escape($${WEBKIT_SUBDIR})$,)

# Now we're ready to load default_pre from Qt
load(default_pre)

equals(OUT_PWD, $${ROOT_BUILD_DIR}) {
    !recursive_include:CONFIG += root_project_file
    BUILD_ROOT_RELATIVE_TO_OUT_PWD = .
} else {
    subdir_parts = $$replace(OUT_PWD, ^$$re_escape($${ROOT_BUILD_DIR})/,)
    subdir_parts = $$split(subdir_parts, /)
    for(subdir, subdir_parts) {
        BUILD_ROOT_RELATIVE_TO_OUT_PWD += ..
    }
    BUILD_ROOT_RELATIVE_TO_OUT_PWD = $$join(BUILD_ROOT_RELATIVE_TO_OUT_PWD, /)
}

# Try to detect if we're running under Windows cmd.exe or not
equals(QMAKE_DIR_SEP, \\): CONFIG += win_cmd_shell

# Default location of generated sources
GENERATED_SOURCES_DESTDIR = generated

QUOTE = ""
DOUBLE_ESCAPED_QUOTE = ""
ESCAPE = ""
win_cmd_shell {
    ESCAPE = "^"
} else {
    QUOTE = "\'"
    DOUBLE_ESCAPED_QUOTE = "\\\'"
}
EOL = $$escape_expand(\\n)
EOC = $$escape_expand(\\n\\t)
TAB = $$escape_expand(\\t)

MAKEFILE_NOOP_COMMAND = @echo -n
win32-msvc*: MAKEFILE_NOOP_COMMAND = @echo >NUL

# Set up a default python version
scratchbox: PYTHON = python2.6
else: PYTHON = python

# By default we enable "production build", and build-webkit, which is
# used by bots and developers, will disable it, to enable warnings etc.
CONFIG += production_build

# Run configure before making decisions that depend on the result
root_project_file {
    load(configure)
    runConfigure()
}

unix:config_gccdepends {
    # We have a compiler that supports the -MD option (and neither
    # teambuilder nor icecream is messing up the .d file output).
    CONFIG += GNUmake gcc_MD_depends
}

# Set some defaults for specific platforms
CONFIG += include_webinspector

# Make sure we process the PKGCONFIG variable if applicable
!mac: CONFIG += link_pkgconfig

# Make sure the static libraries are compiled with the same C++11 setting
# as the module will be linked with. This is particular important on mac
# since otherwise the libraries can be compiled against libstdc++, but
# linked against libc++.
qtConfig(c++11): CONFIG += c++11

# Limit the creation of thin archives to Linux, since only GNU's ar supports it.
!debug_and_release:linux: CONFIG += gnu_thin_archives

# The Gold linker breaks transition between JIT and LLInt due to thumb-state mismatch.
gcc:isEqual(QT_ARCH, "arm"): CONFIG -= use_gold_linker

# Pick up Qt's defaults for debug/release/debug_and_release
if(win32|mac):!macx-xcode {
    qtConfig(debug_and_release): CONFIG += debug_and_release build_all
}

FLEX = flex

BIN_EXTENSION =
win32: BIN_EXTENSION = .exe