[Openmp-commits] [PATCH] D106247: [OpenMP][CMake] Fix an issue when there is space in the argument LIBOMPTARGET_LIT_ARGS

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sun Jul 18 18:54:24 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG4504e1134c91: [OpenMP][CMake] Fix an issue when there is space in the argument… (authored by tianshilei1992).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106247/new/

https://reviews.llvm.org/D106247

Files:
  openmp/libomptarget/test/CMakeLists.txt


Index: openmp/libomptarget/test/CMakeLists.txt
===================================================================
--- openmp/libomptarget/test/CMakeLists.txt
+++ openmp/libomptarget/test/CMakeLists.txt
@@ -12,6 +12,10 @@
   set(LIBOMPTARGET_DEBUG False)
 endif()
 
+# Replace the space from user's input with ";" in case that CMake add escape
+# char into the lit command.
+string(REPLACE " " ";" LIBOMPTARGET_LIT_ARG_LIST "${LIBOMPTARGET_LIT_ARGS}")
+
 string(REGEX MATCHALL "([^\ ]+\ |[^\ ]+$)" SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}")
 foreach(CURRENT_TARGET IN LISTS SYSTEM_TARGETS)
   string(STRIP "${CURRENT_TARGET}" CURRENT_TARGET)
@@ -19,7 +23,7 @@
     "Running libomptarget tests"
     ${CMAKE_CURRENT_BINARY_DIR}/${CURRENT_TARGET}
     DEPENDS omptarget omp ${LIBOMPTARGET_TESTED_PLUGINS}
-    ARGS ${LIBOMPTARGET_LIT_ARGS})
+    ARGS ${LIBOMPTARGET_LIT_ARG_LIST})
   list(APPEND LIBOMPTARGET_LIT_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CURRENT_TARGET})
 
   # Configure the lit.site.cfg.in file
@@ -33,4 +37,4 @@
   ${LIBOMPTARGET_LIT_TESTSUITES}
   EXCLUDE_FROM_CHECK_ALL
   DEPENDS omptarget omp ${LIBOMPTARGET_TESTED_PLUGINS}
-  ARGS ${LIBOMPTARGET_LIT_ARGS})
+  ARGS ${LIBOMPTARGET_LIT_ARG_LIST})


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106247.359661.patch
Type: text/x-patch
Size: 1223 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210719/f1ce8599/attachment.bin>


More information about the Openmp-commits mailing list