summaryrefslogtreecommitdiff
path: root/data/lldb/make.sh
blob: c5bc810aef945922ca648a3398a11330b165956a (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
pkg:setup

# http://releases.llvm.org/download.html
cd tools
tar xf ${PKG_DATA}/sources/cfe*
tar xf ${PKG_DATA}/sources/lldb*
mv cfe* clang
mv lldb* lldb
cd ..

# Build for the host.
mkdir host
cd host
cmake DCMAKE_BUILD_TYPE=RELEASE -DLLVM_INCLUDE_TESTS=OFF ..
make -j16 llvm-tblgen clang-tblgen
cd ..

# Build for the target.
mkdir target
cd target

cat > iphoneos_toolchain.cmake <<EOF
set(CMAKE_SYSTEM_NAME Darwin)  # Tell CMake we're cross-compiling
set(CMAKE_CROSSCOMPILING true)
#include(CMakeForceCompiler)
# Prefix detection only works with compiler id "GNU"
# CMake will look for prefixed g++, cpp, ld, etc. automatically
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(triple ${PKG_TARG})
set(CMAKE_FIND_ROOT_PATH $(echo ${PKG_PATH} | sed -e s/:/' '/g))
set(CMAKE_LIBRARY_PATH $(echo ${LIBRARY_PATH} | sed -e s/:/' '/g))
set(CMAKE_INCLUDE_PATH $(echo ${INCLUDE_PATH} | sed -e s/:/' '/g))
set(CMAKE_C_COMPILER ${PKG_TARG}-gcc)
set(CMAKE_CXX_COMPILER ${PKG_TARG}-g++)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
EOF