From ff7cf7d85a480ca866dacf3b1f724a37e9a99437 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Mon, 7 May 2018 14:05:04 +0200 Subject: [PATCH] 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. --- debian/qualify-clang.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 34a277c6..ee9e70eb 100644 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -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 " > foo.m clang-$VERSION -c foo.m