sgraenitz updated this revision to Diff 180890.
sgraenitz marked 5 inline comments as done.
sgraenitz added a comment.
Move BUILD_SHARED_LIBS and LLDB_HAVE_LLD to a separate commit
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56440/new/
https://reviews.llvm.org/D56440
Files:
CMakeLists.txt
lit/CMakeLists.txt
test/CMakeLists.txt
www/build.html
www/test.html
Index: www/test.html
===================================================================
--- www/test.html
+++ www/test.html
@@ -39,9 +39,7 @@
The easiest way to run the LLDB test suite is to use the <tt>check-lldb</tt> build
target. By default, the <tt>check-lldb</tt> target builds the test programs with
the same compiler that was used to build LLDB. To build the tests with a different
- compiler, you can set the <strong>LLDB_TEST_C_COMPILER</strong> or the <strong>LLDB_TEST_CXX_COMPILER</strong> CMake variables.
- These variables are ignored unless the respective <strong>LLDB_TEST_USE_CUSTOM_C_COMPILER</strong> and
- <strong>LLDB_TEST_USE_CUSTOM_CXX_COMPILER</strong> are set to ON.
+ compiler, you can set the <strong>LLDB_TEST_COMPILER</strong> CMake variable.
It is possible to customize the architecture of the test binaries and compiler used by appending -A
and -C options respectively to the CMake variable <strong>LLDB_TEST_USER_ARGS</strong>. For
example, to test LLDB against 32-bit binaries
Index: www/build.html
===================================================================
--- www/build.html
+++ www/build.html
@@ -116,15 +116,14 @@
the PYTHONHOME environment variable if it is specified).
</li>
<li>
- <b>LLDB_TEST_C_COMPILER</b> or <b>LLDB_TEST_CXX_COMPILER</b>: The test suite needs to be able to find a copy of clang.exe
+ <b>LLDB_TEST_COMPILER</b>: The test suite needs to be able to find a copy of clang.exe
that it can use to compile inferior programs. Note that MSVC is not supported here, it <strong>must</strong> be a path to a
clang executable. Note that using a release clang.exe is strongly recommended here, as it will make the test suite run much faster.
- This can be a path to any recent clang.exe, including one you built yourself. These variables are ignored unless the respective
- <strong>LLDB_TEST_USE_CUSTOM_C_COMPILER</strong> and <strong>LLDB_TEST_USE_CUSTOM_CXX_COMPILER</strong> are set to ON.
+ This can be a path to any recent clang.exe, including one you built yourself.
</li>
</ul>
Sample command line:<br/>
- <code>cmake -G Ninja -DLLDB_TEST_DEBUG_TEST_CRASHES=1 -DPYTHON_HOME=C:\Python35 -DLLDB_TEST_USE_CUSTOM_C_COMPILER=ON -DLLDB_TEST_C_COMPILER=d:\src\llvmbuild\ninja_release\bin\clang.exe ..\..\llvm</code>
+ <code>cmake -G Ninja -DLLDB_TEST_DEBUG_TEST_CRASHES=1 -DPYTHON_HOME=C:\Python35 -DLLDB_TEST_COMPILER=d:\src\llvmbuild\ninja_release\bin\clang.exe ..\..\llvm</code>
<h2>Working with both Ninja and MSVC</h2>
<p>
Compiling with <code>ninja</code> is both faster and simpler than compiling with MSVC, but chances are you still want
Index: test/CMakeLists.txt
===================================================================
--- test/CMakeLists.txt
+++ test/CMakeLists.txt
@@ -50,7 +50,7 @@
--executable ${LLDB_TEST_EXECUTABLE}
--dsymutil ${LLDB_TEST_DSYMUTIL}
--filecheck ${LLDB_TEST_FILECHECK}
- -C ${LLDB_TEST_C_COMPILER}
+ -C ${LLDB_TEST_COMPILER_USED}
)
if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
Index: lit/CMakeLists.txt
===================================================================
--- lit/CMakeLists.txt
+++ lit/CMakeLists.txt
@@ -11,14 +11,6 @@
set(LLDB_IS_64_BITS 1)
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}")
-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}")
-endif ()
-
get_property(LLDB_DOTEST_ARGS GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY)
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_LIBS_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -36,9 +36,6 @@
add_subdirectory(tools)
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.
set(LLDB_DEFAULT_TEST_EXECUTABLE "${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb${CMAKE_EXECUTABLE_SUFFIX}")
@@ -50,15 +47,36 @@
set(LLDB_DEFAULT_TEST_COMPILER "${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}")
endif()
+ # Phase out these settings. We only support clang, so we should have only one setting.
+ # dotest has its own logic to deal with C/C++ driver variants.
+ set(LLDB_TEST_C_COMPILER "" CACHE PATH "C Compiler to use for building LLDB test inferiors (deprecated)")
+ set(LLDB_TEST_CXX_COMPILER "" CACHE PATH "C++ Compiler to use for building LLDB test inferiors (deprecated)")
+
+ set(LLDB_TEST_COMPILER "" CACHE PATH "Compiler to use for building LLDB test inferiors (defaults to builtin clang)")
set(LLDB_TEST_EXECUTABLE "${LLDB_DEFAULT_TEST_EXECUTABLE}" CACHE PATH "lldb executable used for testing")
- 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((NOT LLDB_TEST_C_COMPILER) OR (NOT LLDB_TEST_CXX_COMPILER))
- message(WARNING "LLDB test compilers not specified. Tests will not run.")
+ # Use LLDB_TEST_COMPILER_IS_DEFAULT to determine whether or not to replace
+ # CMAKE_CFG_INTDIR with LLVM_BUILD_MODE for dotest.
+ if(LLDB_TEST_COMPILER)
+ set(compiler_used ${LLDB_TEST_COMPILER})
+ elseif(LLDB_TEST_C_COMPILER)
+ set(compiler_used ${LLDB_TEST_C_COMPILER})
+ elseif(LLDB_TEST_CXX_COMPILER)
+ set(compiler_used ${LLDB_TEST_CXX_COMPILER})
+ else()
+ set(LLDB_TEST_COMPILER_IS_DEFAULT ON)
+ set(compiler_used ${LLDB_DEFAULT_TEST_COMPILER})
endif()
+ if (compiler_used)
+ set(LLDB_TEST_COMPILER_USED ${compiler_used})
+ else()
+ message(WARNING "LLDB test compiler not specified. Tests will not run.")
+ endif()
+
+ unset(LLDB_TEST_C_COMPILER CACHE)
+ unset(LLDB_TEST_CXX_COMPILER CACHE)
set(LLDB_TEST_DEPS lldb)
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits