[CMake] Move some variables around

This improves consistency by creating a CMake variable for the dsymutil
path. The motivation is that for Swift, the dsymutil binary and the lldb
binary live in different directories and we need an option to configure
this from the build script.

llvm-svn: 336272
This commit is contained in:
Jonas Devlieghere
2018-07-04 13:59:25 +00:00
parent 6a99ce27f6
commit 60cbbb4440
2 changed files with 13 additions and 3 deletions

View File

@@ -88,6 +88,10 @@ option(LLDB_INCLUDE_TESTS "Generate build targets for the LLDB unit tests."
option(LLDB_TEST_USE_CUSTOM_C_COMPILER "Use the C compiler provided via LLDB_TEST_C_COMPILER for building test inferiors (instead of the just-built compiler). Defaults to OFF." OFF)
option(LLDB_TEST_USE_CUSTOM_CXX_COMPILER "Use the C++ compiler provided via LLDB_TEST_CXX_COMPILER for building test inferiors (instead of the just-built compiler). Defaults to OFF." OFF)
if(LLDB_INCLUDE_TESTS)
set(LLDB_DEFAULT_TEST_EXECUTABLE "${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/lldb${CMAKE_EXECUTABLE_SUFFIX}")
set(LLDB_DEFAULT_TEST_DSYMUTIL "${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/dsymutil${CMAKE_EXECUTABLE_SUFFIX}")
if (NOT LLDB_TEST_USE_CUSTOM_C_COMPILER AND TARGET clang)
set(LLDB_DEFAULT_TEST_C_COMPILER "${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}")
else()
@@ -100,8 +104,10 @@ if(LLDB_INCLUDE_TESTS)
set(LLDB_DEFAULT_TEST_CXX_COMPILER "")
endif()
set(LLDB_TEST_EXECUTABLE "${LLDB_DEFAULT_TEST_EXECUTABLE}" CACHE PATH "lldb executable used for testing")
set(LLDB_TEST_C_COMPILER "${LLDB_DEFAULT_TEST_C_COMPILER}" CACHE PATH "C Compiler to use for building LLDB test inferiors")
set(LLDB_TEST_CXX_COMPILER "${LLDB_DEFAULT_TEST_CXX_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")
if (("${LLDB_TEST_C_COMPILER}" STREQUAL "") OR
("${LLDB_TEST_CXX_COMPILER}" STREQUAL ""))
@@ -130,7 +136,7 @@ if(LLDB_INCLUDE_TESTS)
endif()
if(NOT LLDB_BUILT_STANDALONE)
list(APPEND LLDB_TEST_DEPS yaml2obj dsymutil)
list(APPEND LLDB_TEST_DEPS yaml2obj)
endif()
if(TARGET liblldb)
@@ -141,6 +147,10 @@ if(LLDB_INCLUDE_TESTS)
list(APPEND LLDB_TEST_DEPS clang)
endif()
if(TARGET dsymutil)
list(APPEND LLDB_TEST_DEPS dsymutil)
endif()
add_subdirectory(test)
add_subdirectory(unittests)
add_subdirectory(lit)

View File

@@ -47,8 +47,8 @@ set(LLDB_TEST_COMMON_ARGS
)
list(APPEND LLDB_TEST_COMMON_ARGS
--executable ${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb${CMAKE_EXECUTABLE_SUFFIX}
--dsymutil ${LLVM_RUNTIME_OUTPUT_INTDIR}/dsymutil${CMAKE_EXECUTABLE_SUFFIX}
--executable ${LLDB_TEST_EXECUTABLE}
--dsymutil ${LLDB_TEST_DSYMUTIL}
-C ${LLDB_TEST_C_COMPILER}
)