[Lldb-commits] [lldb] 220cce1 - [CMake] Don't set LLDB_TEST_* in the top-level CMakeLists
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Thu Oct 24 14:47:16 PDT 2019
Author: Jonas Devlieghere
Date: 2019-10-24T14:47:07-07:00
New Revision: 220cce1e7274e1d4b015965fad82ccd79d03b305
URL: https://github.com/llvm/llvm-project/commit/220cce1e7274e1d4b015965fad82ccd79d03b305
DIFF: https://github.com/llvm/llvm-project/commit/220cce1e7274e1d4b015965fad82ccd79d03b305.diff
LOG: [CMake] Don't set LLDB_TEST_* in the top-level CMakeLists
All these variables only affect the API tests. Therefore they belong in
test/API/CMakeLists.txt rather than the top-level CMakeLists.txt.
Added:
Modified:
lldb/CMakeLists.txt
lldb/test/API/CMakeLists.txt
Removed:
################################################################################
diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt
index 588f6f72b795..31b1d899a94d 100644
--- a/lldb/CMakeLists.txt
+++ b/lldb/CMakeLists.txt
@@ -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)
diff --git a/lldb/test/API/CMakeLists.txt b/lldb/test/API/CMakeLists.txt
index 4552e1062d5e..1866e31be322 100644
--- a/lldb/test/API/CMakeLists.txt
+++ b/lldb/test/API/CMakeLists.txt
@@ -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" )
More information about the lldb-commits
mailing list