[Lldb-commits] [PATCH] D56400: [CMake] Some cleanup around test preparations
Stefan Gränitz via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Jan 8 05:19:29 PST 2019
sgraenitz updated this revision to Diff 180643.
sgraenitz added a comment.
Act on FIXME's in subsequent commits and remove comments here
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56400/new/
https://reviews.llvm.org/D56400
Files:
CMakeLists.txt
lit/CMakeLists.txt
Index: lit/CMakeLists.txt
===================================================================
--- lit/CMakeLists.txt
+++ lit/CMakeLists.txt
@@ -12,11 +12,11 @@
endif()
if (NOT LLDB_TEST_USE_CUSTOM_C_COMPILER)
- string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_C_COMPILER ${LLDB_TEST_C_COMPILER})
+ string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_C_COMPILER "${LLDB_TEST_C_COMPILER}")
endif ()
if (NOT LLDB_TEST_USE_CUSTOM_CXX_COMPILER)
- string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_CXX_COMPILER ${LLDB_TEST_CXX_COMPILER})
+ string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_CXX_COMPILER "${LLDB_TEST_CXX_COMPILER}")
endif ()
get_property(LLDB_DOTEST_ARGS GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY)
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -35,43 +35,29 @@
add_subdirectory(source)
add_subdirectory(tools)
-option(LLDB_INCLUDE_TESTS "Generate build targets for the LLDB unit tests."
- ${LLVM_INCLUDE_TESTS})
+option(LLDB_INCLUDE_TESTS "Generate build targets for the LLDB unit tests." ${LLVM_INCLUDE_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 the path to the default lldb test executable. Make the path relative to
- # LLVM_RUNTIME_OUTPUT_INTDIR: this will be correct even when LLVM and LLDB
- # have separate binary directories.
+if(LLDB_INCLUDE_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. Make these paths relative to the LLVM
- # binary directory.
+ # 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 (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()
- set(LLDB_DEFAULT_TEST_C_COMPILER "")
- endif()
-
- if (NOT LLDB_TEST_USE_CUSTOM_CXX_COMPILER AND TARGET clang)
- set(LLDB_DEFAULT_TEST_CXX_COMPILER "${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/clang++${CMAKE_EXECUTABLE_SUFFIX}")
- else()
- set(LLDB_DEFAULT_TEST_CXX_COMPILER "")
+ if(TARGET clang)
+ set(LLDB_DEFAULT_TEST_COMPILER "${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}")
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_C_COMPILER "${LLDB_DEFAULT_TEST_COMPILER}" CACHE PATH "C Compiler to use for building LLDB test inferiors")
+ set(LLDB_TEST_CXX_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_C_COMPILER}" STREQUAL "") OR
- ("${LLDB_TEST_CXX_COMPILER}" STREQUAL ""))
- message(FATAL_ERROR "LLDB test compilers not specified. Tests will not run")
+ if((NOT LLDB_TEST_C_COMPILER) OR (NOT LLDB_TEST_CXX_COMPILER))
+ message(WARNING "LLDB test compilers not specified. Tests will not run.")
endif()
set(LLDB_TEST_DEPS lldb)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56400.180643.patch
Type: text/x-patch
Size: 4183 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190108/bbd28205/attachment.bin>
More information about the lldb-commits
mailing list