[PATCH] Upgrade libc++'s test's CMakeLists.txt to be in sync with libc++abi's

Jonathan Roelofs jonathan at codesourcery.com
Thu Jan 22 15:17:16 PST 2015


Address @danalbert's comment about the default lit args.


http://reviews.llvm.org/D7110

Files:
  CMakeLists.txt

Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -6,47 +6,40 @@
   endif()
 endmacro()
 
-include(FindPythonInterp)
-if(PYTHONINTERP_FOUND)
-  if(LIBCXX_BUILT_STANDALONE)
-    set(LIT_EXECUTABLE "" CACHE FILEPATH "Path to LLVM's lit.py.")
-  else()
-    set(LIT_EXECUTABLE "${CMAKE_SOURCE_DIR}/utils/lit/lit.py")
-  endif()
-
-  set(LIT_ARGS_DEFAULT "-sv --show-unsupported --show-xfail")
-  if (MSVC OR XCODE)
-    set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
-  endif()
-  set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}"
-      CACHE STRING "Default options for lit")
-  set(LIT_ARGS "${LLVM_LIT_ARGS}")
-  separate_arguments(LIT_ARGS)
-
-  set(LIBCXX_LIT_VARIANT "libcxx" CACHE STRING
-      "Configuration variant to use for LIT.")
-
-  pythonize_bool(LIBCXX_ENABLE_EXCEPTIONS)
-  pythonize_bool(LIBCXX_ENABLE_RTTI)
-  pythonize_bool(LIBCXX_ENABLE_SHARED)
-  pythonize_bool(LIBCXX_BUILD_32_BITS)
-  pythonize_bool(LIBCXX_ENABLE_THREADS)
-  pythonize_bool(LIBCXX_ENABLE_MONOTONIC_CLOCK)
-
-  set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!")
-
-  configure_file(
-    ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
-    ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
-    @ONLY)
-
-  add_custom_target(check-libcxx
-    COMMAND ${PYTHON_EXECUTABLE}
-            ${LIT_EXECUTABLE}
-            ${LIT_ARGS}
-            ${CMAKE_CURRENT_BINARY_DIR}
-    DEPENDS cxx
-    COMMENT "Running libcxx tests")
+if(LIBCXX_BUILT_STANDALONE)
+  set(LIT_EXECUTABLE "" CACHE FILEPATH "Path to LLVM's lit.py.")
 else()
-  message(WARNING "Could not find Python, no check target will be available!")
+  set(LIT_EXECUTABLE "${CMAKE_SOURCE_DIR}/utils/lit/lit.py")
+endif()
+
+set(LIT_ARGS_DEFAULT "-sv --show-unsupported --show-xfail")
+if (MSVC OR XCODE)
+  set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
 endif()
+set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}"
+    CACHE STRING "Default options for lit")
+set(LIT_ARGS "${LLVM_LIT_ARGS}")
+separate_arguments(LIT_ARGS)
+
+pythonize_bool(LIBCXX_ENABLE_EXCEPTIONS)
+pythonize_bool(LIBCXX_ENABLE_RTTI)
+pythonize_bool(LIBCXX_BUILD_32_BITS)
+pythonize_bool(LIBCXX_ENABLE_SHARED)
+pythonize_bool(LIBCXX_ENABLE_THREADS)
+pythonize_bool(LIBCXX_ENABLE_MONOTONIC_CLOCK)
+
+set(LIBCXX_LIT_VARIANT "libcxx" CACHE STRING
+    "Configuration variant to use for LIT.")
+
+set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!")
+configure_file(
+  ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
+  ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
+  @ONLY)
+
+
+add_lit_testsuite(check-libcxx "Running libcxx tests"
+  ${CMAKE_CURRENT_BINARY_DIR}
+  DEPENDS cxx
+  ARGS ${LIT_ARGS}
+  )

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7110.18640.patch
Type: text/x-patch
Size: 2747 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150122/0b8ee444/attachment.bin>


More information about the cfe-commits mailing list