[libcxx] r191930 - Make it possible to run the test suite when built as part of LLVM.

Peter Collingbourne peter at pcc.me.uk
Thu Oct 3 14:58:25 PDT 2013


Author: pcc
Date: Thu Oct  3 16:58:25 2013
New Revision: 191930

URL: http://llvm.org/viewvc/llvm-project?rev=191930&view=rev
Log:
Make it possible to run the test suite when built as part of LLVM.

Modified:
    libcxx/trunk/CMakeLists.txt
    libcxx/trunk/test/CMakeLists.txt

Modified: libcxx/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=191930&r1=191929&r2=191930&view=diff
==============================================================================
--- libcxx/trunk/CMakeLists.txt (original)
+++ libcxx/trunk/CMakeLists.txt Thu Oct  3 16:58:25 2013
@@ -26,6 +26,10 @@ MACRO_ENSURE_OUT_OF_SOURCE_BUILD(
  build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there."
  )
 
+if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+  set(LIBCXX_BUILT_STANDALONE 1)
+endif()
+
 #===============================================================================
 # Setup CMake Options
 #===============================================================================

Modified: libcxx/trunk/test/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/CMakeLists.txt?rev=191930&r1=191929&r2=191930&view=diff
==============================================================================
--- libcxx/trunk/test/CMakeLists.txt (original)
+++ libcxx/trunk/test/CMakeLists.txt Thu Oct  3 16:58:25 2013
@@ -8,7 +8,12 @@ endmacro()
 
 include(FindPythonInterp)
 if(PYTHONINTERP_FOUND)
-  set(LIT_EXECUTABLE "" CACHE FILEPATH "Path to LLVM's lit.py.")
+  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")
   if (MSVC OR XCODE)
     set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
@@ -19,7 +24,7 @@ if(PYTHONINTERP_FOUND)
   separate_arguments(LIT_ARGS)
 
   set(LIBCXX_COMPILER ${CMAKE_CXX_COMPILER})
-  set(LIBCXX_SOURCE_DIR ${CMAKE_SOURCE_DIR})
+  set(LIBCXX_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..)
   set(LIBCXX_BINARY_DIR ${CMAKE_BINARY_DIR})
   set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
   pythonize_bool(LIBCXX_ENABLE_SHARED)
@@ -37,7 +42,7 @@ if(PYTHONINTERP_FOUND)
             ${LIT_EXECUTABLE}
             ${LIT_ARGS}
             ${CMAKE_CURRENT_BINARY_DIR}
-    DEPENDS
+    DEPENDS cxx
     COMMENT "Running libcxx tests")
 else()
   message(WARNING "Could not find Python, no check target will be available!")





More information about the cfe-commits mailing list