Commit ff7cf7d8 authored by Peter Wu's avatar Peter Wu

qualify-clang: improve CMake test

* Explicitly check that both the default CMake find_package and the
  explicit version-specific check works as intended.
* Set CC/CXX to avoid requiring an additional compiler to be installed.
* Add comment to workaround objc test failure on Ubuntu 14.04 and 16.04.
parent be57a2aa
......@@ -195,8 +195,11 @@ if(NOT H)
message(FATAL_ERROR "Invalid Clang header path: \${CLANG_INCLUDE_DIRS}")
endif()
EOF
(cd cmaketest && cmake .)
rm -rf cmaketest
mkdir cmaketest/standard cmaketest/explicit
echo "Test: CMake find LLVM and Clang in default path"
(cd cmaketest/standard && CC=clang-$VERSION CXX=clang++-$VERSION cmake ..)
echo "Test: CMake find LLVM and Clang in explicit prefix path"
(cd cmaketest/explicit && CC=clang-$VERSION CXX=clang++-$VERSION CMAKE_PREFIX_PATH=/usr/lib/llvm-$VERSION cmake ..)
CLANG=clang-$VERSION
#command -v "$CLANG" 1>/dev/null 2>/dev/null || { printf "Usage:\n%s CLANGEXE [ARGS]\n" "$0" 1>&2; exit 1; }
......@@ -266,6 +269,8 @@ for SYSTEM in ""; do
done
done
echo "If the following fails, try setting an environment variable such as:"
echo "OBJC_INCLUDE_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/include"
echo "#include <objc/objc.h>" > foo.m
clang-$VERSION -c foo.m
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment