llvm-toolchain/debian/tests/cmake-test
2022-07-27 09:03:59 +02:00

40 lines
714 B
Bash
Executable File

#!/bin/sh
set -e
LLVM_VERSION=16
# 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 3.7)
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 ..