-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
package-unix.sh
executable file
·68 lines (58 loc) · 2.03 KB
/
package-unix.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
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
halide_source="$1"
halide_build_root="$2"
# TODO: this temporary, until release branches for Halide are created.
# Remove as soon as that is done.
[ -z "$Halide_VERSION" ] && echo "Must set specific Halide_VERSION for packaging" && exit
[ -z "$LLVM_DIR" ] && echo "Must set specific LLVM_DIR for packaging" && exit
[ -z "$Clang_DIR" ] && echo "Must set specific Clang_DIR for packaging" && exit
[ -z "$halide_source" ] && echo "Usage: $0 <source-dir> <build-dir>" && exit
[ -z "$halide_build_root" ] && echo "Usage: $0 <source-dir> <build-dir>" && exit
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=YES \
-DLLVM_DIR="$LLVM_DIR" \
-DClang_DIR="$Clang_DIR" \
-DHalide_VERSION="$Halide_VERSION" \
-DWITH_TESTS=NO \
-DWITH_APPS=NO \
-DWITH_TUTORIALS=NO \
-DWITH_DOCS=YES \
-DWITH_UTILS=NO \
-DWITH_PYTHON_BINDINGS=NO \
-DCMAKE_INSTALL_DATADIR="share/Halide" \
-S "$halide_source" \
-B "$halide_build_root/shared-Release"
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=NO \
-DHalide_BUNDLE_LLVM=YES \
-DLLVM_DIR="$LLVM_DIR" \
-DClang_DIR="$Clang_DIR" \
-DHalide_VERSION="$Halide_VERSION" \
-DWITH_TESTS=NO \
-DWITH_APPS=NO \
-DWITH_TUTORIALS=NO \
-DWITH_DOCS=YES \
-DWITH_UTILS=NO \
-DWITH_PYTHON_BINDINGS=NO \
-DCMAKE_INSTALL_DATADIR="share/Halide" \
-S "$halide_source" \
-B "$halide_build_root/static-Release"
cmake --build "$halide_build_root/shared-Release"
cmake --build "$halide_build_root/static-Release"
cd "$halide_build_root" || exit
cat <<EOM >release.cmake
include("shared-Release/CPackConfig.cmake")
set(CPACK_COMPONENTS_HALIDE_RUNTIME Halide_Runtime)
set(CPACK_COMPONENTS_HALIDE_DEVELOPMENT Halide_Development)
set(CPACK_INSTALL_CMAKE_PROJECTS
# We don't package debug binaries on Unix systems. Our developers
# don't use them and LLVM in debug mode is next to unusable, too.
# static-Debug Halide ALL /
# shared-Debug Halide ALL /
static-Release Halide ALL /
shared-Release Halide ALL /
)
EOM
cpack --config release.cmake