llvm-toolchain/debian/tests/cmake-test
2021-01-27 15:57:38 +01:00

40 lines
716 B
Bash
Executable File

#!/bin/sh
set -e
LLVM_VERSION=13
# this is taken from libjsoncpp package
# Presence of $AUTOPKGTEST_TMP implies that someone will handle cleanup for us, so we
# can avoid duplicating the effort (signal handling, etc.) here.
if [ -z "$AUTOPKGTEST_TMP" ]
then
echo "Required envvar AUTOPKGTEST_TMP \"$AUTOPKGTEST_TMP\" is not set" >&2
exit 1
fi
# the idea was taken from spirv-llvm-translator package
cd "$AUTOPKGTEST_TMP"
cat <<EOF > CMakeLists.txt
cmake_minimum_required(VERSION 2.6.2)
project(cmake-test)
find_package(LLVM $LLVM_VERSION REQUIRED
COMPONENTS
Analysis
BitReader
BitWriter
Core
Support
TransformUtils
llvm-as
llvm-dis
)
EOF
mkdir build && cd build
cmake ..