[PATCH] D51256: [test-suite, CUDA] Fix some CMake problems

Jonas Hahnfeld via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 25 06:52:20 PDT 2018


Hahnfeld created this revision.
Hahnfeld added reviewers: tra, jlebar.
Herald added subscribers: llvm-commits, JDevlieghere, mgorny.

1. The regex was matching any number in the path which is a problem if your path to external/ had numbers in it. I think this was because of the wrong string escape.
2. If /thrust does not exist, the variable isn't set at all. Avoid failure on EXIST with empty path by using DEFINED.


Repository:
  rL LLVM

https://reviews.llvm.org/D51256

Files:
  External/CUDA/CMakeLists.txt


Index: External/CUDA/CMakeLists.txt
===================================================================
--- External/CUDA/CMakeLists.txt
+++ External/CUDA/CMakeLists.txt
@@ -36,7 +36,7 @@
 # Output:
 #    Sets Var=x.y.z
 macro(get_version Var Path)
-    string(REGEX MATCH "[0-9]+(\.[0-9]+)+" ${Var} ${Path})
+    string(REGEX MATCH "[0-9]+(\\.[0-9]+)+" ${Var} ${Path})
 endmacro (get_version)
 
 # Helper function to glob CUDA source files and set LANGUAGE property
@@ -180,7 +180,7 @@
   create_local_cuda_tests(${VariantSuffix})
   add_dependencies(cuda-tests-simple cuda-tests-simple-${VariantSuffix})
 
-  if(EXISTS ${THRUST_PATH} AND (NOT ${Std} STREQUAL "c++14"))
+  if(DEFINED THRUST_PATH AND (NOT ${Std} STREQUAL "c++14"))
     create_thrust_tests(${VariantSuffix})
   endif()
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51256.162546.patch
Type: text/x-patch
Size: 788 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180825/f326048e/attachment.bin>


More information about the llvm-commits mailing list