Skip to content

Commit

Permalink
fixing up Linux packaging script
Browse files Browse the repository at this point in the history
  • Loading branch information
alexreinking committed Jul 23, 2020
1 parent b3b793f commit 34c7d14
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 21 deletions.
11 changes: 11 additions & 0 deletions packaging/Linux.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
include("shared-Release/CPackConfig.cmake")

set(CPACK_COMPONENTS_HALIDE_RUNTIME Halide_Runtime)
set(CPACK_COMPONENTS_HALIDE_DEVELOPMENT Halide_Development)

set(CPACK_INSTALL_CMAKE_PROJECTS
static-Debug Halide ALL /
shared-Debug Halide ALL /
static-Release Halide ALL /
shared-Release Halide ALL /
)
37 changes: 16 additions & 21 deletions tools/package-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,22 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
DIR="$(readlink -f $DIR/..)"

cmake -G "Ninja Multi-Config" \
-DLLVM_DIR=$LLVM_DIR -DClang_DIR=$Clang_DIR \
-DBUILD_SHARED_LIBS=NO \
-DWITH_TESTS=NO -DWITH_APPS=NO -DWITH_TUTORIALS=NO \
-DWITH_DOCS=YES -DWITH_UTILS=NO -DWITH_PYTHON_BINDINGS=NO \
-S "$DIR" -B "$DIR/build/static"
flag_shared="-DBUILD_SHARED_LIBS=YES"
flag_static="-DBUILD_SHARED_LIBS=NO"

cmake -G "Ninja Multi-Config" \
-DLLVM_DIR=$LLVM_DIR -DClang_DIR=$Clang_DIR \
-DBUILD_SHARED_LIBS=YES \
-DWITH_TESTS=NO -DWITH_APPS=NO -DWITH_TUTORIALS=NO \
-DWITH_DOCS=YES -DWITH_UTILS=NO -DWITH_PYTHON_BINDINGS=NO \
-S "$DIR" -B "$DIR/build/shared"
for ty in shared static
do
for cfg in Debug Release
do
flag_name=flag_$ty
cmake -G Ninja -DCMAKE_BUILD_TYPE=$cfg ${!flag_name}\
-DLLVM_DIR=$LLVM_DIR -DClang_DIR=$Clang_DIR \
-DWITH_TESTS=NO -DWITH_APPS=NO -DWITH_TUTORIALS=NO \
-DWITH_DOCS=YES -DWITH_UTILS=NO -DWITH_PYTHON_BINDINGS=NO \
-S "$DIR" -B "$DIR/build/$ty-$cfg"
cmake --build "$DIR/build/$ty-$cfg"
done
done

cmake --build "$DIR/build/shared" --config Debug
cmake --build "$DIR/build/shared" --config Release
cmake --build "$DIR/build/static" --config Debug
cmake --build "$DIR/build/static" --config Release

cmake --install "$DIR/build/shared" --prefix "$DIR/build/install" --config Debug
cmake --install "$DIR/build/shared" --prefix "$DIR/build/install" --config Release
cmake --install "$DIR/build/static" --prefix "$DIR/build/install" --config Debug
cmake --install "$DIR/build/static" --prefix "$DIR/build/install" --config Release
(cd "$DIR/build"; cpack --config "$DIR/packaging/Linux.cmake")

0 comments on commit 34c7d14

Please sign in to comment.