From: Jonas Devlieghere Date: Thu, 24 Oct 2019 20:09:23 +0000 (-0700) Subject: [CMake] Don't set LLDB_TEST_* in the top-level CMakeLists X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=220cce1e7274e1d4b015965fad82ccd79d03b305;p=platform%2Fupstream%2Fllvm.git [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. --- diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt index 588f6f7..31b1d89 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 4552e10..1866e31 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" )