summaryrefslogtreecommitdiffstats
path: root/src/buildtools/configure_host.pro
blob: 217fad7752b508fc6a484216e5de14f732d4a682 (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
# Prevent generating a makefile that attempts to create a lib
TEMPLATE = aux

# Pick up the host toolchain
option(host_build)

GN_TARGET_CPU = $$gnArch($$QT_ARCH)
GN_CPU = $$gnArch($$QMAKE_HOST.arch)
GN_OS = $$gnOS()

clang: GN_CLANG = true
else: GN_CLANG = false

# We always use the gcc_toolchain, because clang_toolchain is just
# a broken wrapper around it for Google's custom clang binaries.
GN_CONTENTS = \
"import(\"//build/config/sysroot.gni\")" \
"import(\"//build/toolchain/gcc_toolchain.gni\")" \
"gcc_toolchain(\"host\") {" \
"  cc = \"$$which($$QMAKE_CC)\" " \
"  cxx = \"$$which($$QMAKE_CXX)\" " \
"  ld = \"$$which($$QMAKE_LINK)\" " \
"  ar = \"$$which(ar)\" " \
"  nm = \"$$which(nm)\" " \
"  toolchain_args = { " \
"    current_os = \"$$GN_OS\" " \
"    current_cpu = \"$$GN_CPU\" " \
"  } " \
"}" \
"gcc_toolchain(\"v8_snapshot\") {" \
"  cc = \"$$which($$QMAKE_CC)\" " \
"  cxx = \"$$which($$QMAKE_CXX)\" " \
"  ld = \"$$which($$QMAKE_LINK)\" " \
"  ar = \"$$which(ar)\" " \
"  nm = \"$$which(nm)\" " \
"  toolchain_args = { " \
"    current_os = \"$$GN_OS\" " \
"    current_cpu = \"$$GN_CPU\" " \
"    v8_current_cpu = \"$$GN_TARGET_CPU\" " \
"  } " \
"}"



GN_FILE = $$OUT_PWD/../toolchain/BUILD.gn
!build_pass {
    write_file($$GN_FILE, GN_CONTENTS)
}