[test-suite] r281087 - [test-suite] Skip CUDA tests w/ libc++ if clang can't find it.

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 9 12:55:28 PDT 2016


Author: tra
Date: Fri Sep  9 14:55:28 2016
New Revision: 281087

URL: http://llvm.org/viewvc/llvm-project?rev=281087&view=rev
Log:
[test-suite] Skip CUDA tests w/ libc++ if clang can't find it.

Modified:
    test-suite/trunk/External/CUDA/CMakeLists.txt

Modified: test-suite/trunk/External/CUDA/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/CUDA/CMakeLists.txt?rev=281087&r1=281086&r2=281087&view=diff
==============================================================================
--- test-suite/trunk/External/CUDA/CMakeLists.txt (original)
+++ test-suite/trunk/External/CUDA/CMakeLists.txt Fri Sep  9 14:55:28 2016
@@ -187,9 +187,9 @@ macro(create_cuda_tests)
   if (EXISTS ${_path_to_libcxx})
     add_library(libcxx SHARED IMPORTED)
     set_property(TARGET libcxx PROPERTY IMPORTED_LOCATION ${_path_to_libcxx})
+    set(HAVE_LIBCXX 1)
   else()
-    message(ERROR "Can't find libcxx location.")
-    return()
+    message(WARNING "Can't find libcxx location.")
   endif()
 
   if(EXISTS "${TEST_SUITE_CUDA_ROOT}/thrust")
@@ -251,16 +251,18 @@ macro(create_cuda_tests)
         list(APPEND ALL_CUDA_TESTS ${VARIANT_CUDA_TESTS})
       endforeach()
 
-      # Same as above, but for libc++
-      # Tell clang to use libc++
-      # We also need to add compiler's include path for cxxabi.h
-      get_filename_component(_compiler_path ${CMAKE_CXX_COMPILER} DIRECTORY)
-      set(_Stdlib_CPPFLAGS -stdlib=libc++ -I${_compiler_path}/../include)
-      set(_Stdlib_LDFLAGS  -stdlib=libc++)
-      set(_Stdlib_Libs libcxx)
-      set(VARIANT_CUDA_TESTS)
-      create_cuda_test_variant("${_Cuda_Suffix}-${_Std_Suffix}-libc++")
-      list(APPEND ALL_CUDA_TESTS ${VARIANT_CUDA_TESTS})
+      if (HAVE_LIBCXX)
+	# Same as above, but for libc++
+	# Tell clang to use libc++
+	# We also need to add compiler's include path for cxxabi.h
+	get_filename_component(_compiler_path ${CMAKE_CXX_COMPILER} DIRECTORY)
+	set(_Stdlib_CPPFLAGS -stdlib=libc++ -I${_compiler_path}/../include)
+	set(_Stdlib_LDFLAGS  -stdlib=libc++)
+	set(_Stdlib_Libs libcxx)
+	set(VARIANT_CUDA_TESTS)
+	create_cuda_test_variant("${_Cuda_Suffix}-${_Std_Suffix}-libc++")
+	list(APPEND ALL_CUDA_TESTS ${VARIANT_CUDA_TESTS})
+      endif()
     endforeach()
   endforeach()
 




More information about the llvm-commits mailing list