[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.
llvm-svn: 232287
GitOrigin-RevId: eeba1a896a6f038557e3a643413a9d3be1634dee
diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake
index a678eb5..e01ae95 100644
--- a/cmake/modules/LLDBConfig.cmake
+++ b/cmake/modules/LLDBConfig.cmake
@@ -24,6 +24,7 @@
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")
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index 93ed716..372c38e 100644
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -38,7 +38,12 @@
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
diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt
index e9b3770..6899904 100644
--- a/unittests/CMakeLists.txt
+++ b/unittests/CMakeLists.txt
@@ -12,10 +12,12 @@
# 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)
diff --git a/unittests/Host/SocketTest.cpp b/unittests/Host/SocketTest.cpp
index 26bef35..a9e14c3 100644
--- a/unittests/Host/SocketTest.cpp
+++ b/unittests/Host/SocketTest.cpp
@@ -140,6 +140,3 @@
EXPECT_STREQ ("127.0.0.1", socket_a_up->GetRemoteIPAddress ().c_str ());
EXPECT_STREQ ("127.0.0.1", socket_b_up->GetRemoteIPAddress ().c_str ());
}
-
-
-