-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·56 lines (43 loc) · 1.12 KB
/
build.sh
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
#!/bin/bash
# Display all commands before executing them.
set -o errexit
set -o errtrace
V8_REPO_URL=${2:-https://github.com/laper32/v8-cmake.git}
LLVM_CROSS="$3"
if [[ -z "$V8_REPO_URL" ]]
then
echo "Usage: $0 <v8-repository-url>"
echo
echo "# Arguments"
echo " v8-repository-url The URL used to clone v8-cmake sources (default: $V8_REPO_URL)"
exit 1
fi
if [ ! -d v8-cmake ]
then
git clone -b "msvc" --single-branch --depth=1 "$V8_REPO_URL" v8-cmake
fi
cd v8-cmake
# Create a directory to build the project.
mkdir -p build
cd build
# Create a directory to receive the complete installation.
mkdir -p install
# Adjust compilation based on the OS.
CMAKE_ARGUMENTS=""
case "${OSTYPE}" in
darwin*) ;;
linux*) ;;
*) ;;
esac
## Adjust cross compilation
#CROSS_COMPILE=""
#
#case "${LLVM_CROSS}" in
# aarch64*) CROSS_COMPILE="-DLLVM_HOST_TRIPLE=aarch64-linux-gnu" ;;
# riscv64*) CROSS_COMPILE="-DLLVM_HOST_TRIPLE=riscv64-linux-gnu" ;;
# *) ;;
#esac
# Run `cmake` to configure the project.
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=MinSizeRel ..
# Showtime!
cmake --build . --config MinSizeRel --target wee8