[Lldb-commits] [lldb] r232287 - [CMake] Make the unittests link against everything...

Zachary Turner zturner at google.com
Sat Mar 14 16:39:28 PDT 2015


Author: zturner
Date: Sat Mar 14 18:39:28 2015
New Revision: 232287

URL: http://llvm.org/viewvc/llvm-project?rev=232287&view=rev
Log:
[CMake] Make the unittests link against everything...

Sigh.  There's really not a good alternative until we decouple
python from lldb better.  The only way the build works right now
is by having every executable link against every LLDB library.
This causes implicit transitive link dependencies on the union
of everything that LLDB brings in.  Which means that if all we
want is one header file from interpreter, we have to bring in
everything, including everything that everything depends on,
which means python.

There's outstanding efforts to address this, but it's not yet
complete.  So until then, this is all we can do.

Modified:
    lldb/trunk/cmake/modules/LLDBConfig.cmake
    lldb/trunk/source/CMakeLists.txt
    lldb/trunk/unittests/CMakeLists.txt
    lldb/trunk/unittests/Host/SocketTest.cpp

Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=232287&r1=232286&r2=232287&view=diff
==============================================================================
--- lldb/trunk/cmake/modules/LLDBConfig.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake Sat Mar 14 18:39:28 2015
@@ -24,6 +24,7 @@ endif ()
 set(LLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION ${LLDB_DEFAULT_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION} CACHE BOOL
   "Enables using new Python scripts for SWIG API generation .")  
 
+set(LLDB_PROJECT_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
 set(LLDB_SOURCE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/source")
 set(LLDB_INCLUDE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include")
 

Modified: lldb/trunk/source/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/CMakeLists.txt?rev=232287&r1=232286&r2=232287&view=diff
==============================================================================
--- lldb/trunk/source/CMakeLists.txt (original)
+++ lldb/trunk/source/CMakeLists.txt Sat Mar 14 18:39:28 2015
@@ -38,7 +38,12 @@ add_subdirectory(Symbol)
 add_subdirectory(Target)
 add_subdirectory(Utility)
 
-include(../cmake/LLDBDependencies.cmake)
+include(${LLDB_PROJECT_ROOT}/cmake/LLDBDependencies.cmake)
+
+add_lldb_library(lldbBase STATIC
+  lldb.cpp
+  lldb-log.cpp
+  )
 
 add_lldb_library(liblldb SHARED
   lldb.cpp

Modified: lldb/trunk/unittests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/CMakeLists.txt?rev=232287&r1=232286&r2=232287&view=diff
==============================================================================
--- lldb/trunk/unittests/CMakeLists.txt (original)
+++ lldb/trunk/unittests/CMakeLists.txt Sat Mar 14 18:39:28 2015
@@ -12,10 +12,12 @@ endif ()
 
 # add_lldb_unittest(test_dirname file1.cpp file2.cpp)
 #
-# Will compile the list of files together and link against the liblldb
+# Will compile the list of files together and link against
 function(add_lldb_unittest test_name)
   add_unittest(LLDBUnitTests ${test_name} ${ARGN})
-  target_link_libraries(${test_name} liblldb)
+
+  target_link_libraries(${test_name} lldbBase)
+  target_link_libraries(${test_name} ${LLDB_USED_LIBS})
 endfunction()
 
 add_subdirectory(Host)

Modified: lldb/trunk/unittests/Host/SocketTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Host/SocketTest.cpp?rev=232287&r1=232286&r2=232287&view=diff
==============================================================================
--- lldb/trunk/unittests/Host/SocketTest.cpp (original)
+++ lldb/trunk/unittests/Host/SocketTest.cpp Sat Mar 14 18:39:28 2015
@@ -140,6 +140,3 @@ TEST_F (SocketTest, GetAddress)
     EXPECT_STREQ ("127.0.0.1", socket_a_up->GetRemoteIPAddress ().c_str ());
     EXPECT_STREQ ("127.0.0.1", socket_b_up->GetRemoteIPAddress ().c_str ());
 }
-
-
-





More information about the lldb-commits mailing list