[CMake] Don't set LLDB_TEST_* in the top-level CMakeLists
authorJonas Devlieghere <jonas@devlieghere.com>
Thu, 24 Oct 2019 20:09:23 +0000 (13:09 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Thu, 24 Oct 2019 21:47:07 +0000 (14:47 -0700)
All these variables only affect the API tests. Therefore they belong in
test/API/CMakeLists.txt rather than the top-level CMakeLists.txt.

lldb/CMakeLists.txt
lldb/test/API/CMakeLists.txt

index 588f6f7..31b1d89 100644 (file)
@@ -83,28 +83,6 @@ option(LLDB_INCLUDE_TESTS "Generate build targets for the LLDB unit tests." ${LL
 if(LLDB_INCLUDE_TESTS)
   set(LLDB_TEST_BUILD_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lldb-test-build.noindex" CACHE PATH "The build root for building tests.")
 
-  # Set the path to the default lldb test executable.
-  set(LLDB_DEFAULT_TEST_EXECUTABLE "${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb${CMAKE_EXECUTABLE_SUFFIX}")
-
-  # Set the paths to default llvm tools.
-  set(LLDB_DEFAULT_TEST_DSYMUTIL "${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/dsymutil${CMAKE_EXECUTABLE_SUFFIX}")
-  set(LLDB_DEFAULT_TEST_FILECHECK "${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/FileCheck${CMAKE_EXECUTABLE_SUFFIX}")
-
-  if (TARGET clang)
-    set(LLDB_DEFAULT_TEST_COMPILER "${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}")
-  else()
-    set(LLDB_DEFAULT_TEST_COMPILER "")
-  endif()
-
-  set(LLDB_TEST_EXECUTABLE "${LLDB_DEFAULT_TEST_EXECUTABLE}" CACHE PATH "lldb executable used for testing")
-  set(LLDB_TEST_COMPILER "${LLDB_DEFAULT_TEST_COMPILER}" CACHE PATH "C Compiler to use for building LLDB test inferiors")
-  set(LLDB_TEST_DSYMUTIL "${LLDB_DEFAULT_TEST_DSYMUTIL}" CACHE PATH "dsymutil used for generating dSYM bundles")
-  set(LLDB_TEST_FILECHECK "${LLDB_DEFAULT_TEST_FILECHECK}" CACHE PATH "FileCheck used for testing purposes")
-
-  if ("${LLDB_TEST_COMPILER}" STREQUAL "")
-    message(FATAL_ERROR "LLDB test compiler not specified. Tests will not run.")
-  endif()
-
   add_custom_target(lldb-test-deps)
   set_target_properties(lldb-test-deps PROPERTIES FOLDER "lldb misc")
   add_lldb_test_dependency(lldb)
index 4552e10..1866e31 100644 (file)
@@ -44,11 +44,33 @@ set(LLDB_TEST_COMMON_ARGS
   -u CFLAGS
   )
 
+# Set the path to the default lldb test executable.
+set(LLDB_DEFAULT_TEST_EXECUTABLE "${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb${CMAKE_EXECUTABLE_SUFFIX}")
+
+# Set the paths to default llvm tools.
+set(LLDB_DEFAULT_TEST_DSYMUTIL "${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/dsymutil${CMAKE_EXECUTABLE_SUFFIX}")
+set(LLDB_DEFAULT_TEST_FILECHECK "${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/FileCheck${CMAKE_EXECUTABLE_SUFFIX}")
+
+if (TARGET clang)
+  set(LLDB_DEFAULT_TEST_COMPILER "${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}")
+else()
+  set(LLDB_DEFAULT_TEST_COMPILER "")
+endif()
+
+set(LLDB_TEST_EXECUTABLE "${LLDB_DEFAULT_TEST_EXECUTABLE}" CACHE PATH "lldb executable used for testing")
+set(LLDB_TEST_COMPILER "${LLDB_DEFAULT_TEST_COMPILER}" CACHE PATH "C Compiler to use for building LLDB test inferiors")
+set(LLDB_TEST_DSYMUTIL "${LLDB_DEFAULT_TEST_DSYMUTIL}" CACHE PATH "dsymutil used for generating dSYM bundles")
+set(LLDB_TEST_FILECHECK "${LLDB_DEFAULT_TEST_FILECHECK}" CACHE PATH "FileCheck used for testing purposes")
+
+if ("${LLDB_TEST_COMPILER}" STREQUAL "")
+  message(FATAL_ERROR "LLDB test compiler not specified. Tests will not run.")
+endif()
+
 list(APPEND LLDB_TEST_COMMON_ARGS
   --executable ${LLDB_TEST_EXECUTABLE}
+  --compiler ${LLDB_TEST_COMPILER}
   --dsymutil ${LLDB_TEST_DSYMUTIL}
   --filecheck ${LLDB_TEST_FILECHECK}
-  --compiler ${LLDB_TEST_COMPILER}
   )
 
 if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )