Index: cmake/LLDBDependencies.cmake =================================================================== --- cmake/LLDBDependencies.cmake +++ /dev/null @@ -1,52 +0,0 @@ -set(LLDB_SYSTEM_LIBS) - -# Windows-only libraries -if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) - list(APPEND LLDB_SYSTEM_LIBS - ws2_32 - rpcrt4 - ) -endif () - -if (NOT LLDB_DISABLE_LIBEDIT) - list(APPEND LLDB_SYSTEM_LIBS edit) -endif() -if (NOT LLDB_DISABLE_CURSES) - list(APPEND LLDB_SYSTEM_LIBS ${CURSES_LIBRARIES}) - if(LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO) - list(APPEND LLDB_SYSTEM_LIBS ${TERMINFO_LIBS}) - endif() -endif() - -if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB ) - list(APPEND LLDB_SYSTEM_LIBS atomic) -endif() - -list(APPEND LLDB_SYSTEM_LIBS ${Backtrace_LIBRARY}) - -if (NOT LLDB_DISABLE_PYTHON AND NOT LLVM_BUILD_STATIC) - list(APPEND LLDB_SYSTEM_LIBS ${PYTHON_LIBRARIES}) -endif() - -list(APPEND LLDB_SYSTEM_LIBS ${system_libs}) - -if (LLVM_BUILD_STATIC) - if (NOT LLDB_DISABLE_PYTHON) - list(APPEND LLDB_SYSTEM_LIBS python2.7 util) - endif() - if (NOT LLDB_DISABLE_CURSES) - list(APPEND LLDB_SYSTEM_LIBS gpm) - endif() -endif() - -if ( NOT LLDB_DISABLE_PYTHON ) - set_source_files_properties(${LLDB_WRAP_PYTHON} PROPERTIES GENERATED 1) - if (CLANG_CL) - set_source_files_properties(${LLDB_WRAP_PYTHON} PROPERTIES COMPILE_FLAGS -Wno-unused-function) - endif() - if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND - NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin") - set_property(SOURCE ${LLDB_WRAP_PYTHON} - APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-sequence-point -Wno-cast-qual") - endif () -endif() Index: scripts/CMakeLists.txt =================================================================== --- scripts/CMakeLists.txt +++ scripts/CMakeLists.txt @@ -48,10 +48,10 @@ --swigExecutable=${SWIG_EXECUTABLE} VERBATIM COMMENT "Python script building LLDB Python wrapper") -set_source_files_properties(${LLDB_WRAP_PYTHON} PROPERTIES GENERATED 1) +add_custom_target(swig_wrapper ALL DEPENDS ${LLDB_WRAP_PYTHON}) + set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/lldb.py PROPERTIES GENERATED 1) -add_custom_target(swig_wrapper ALL DEPENDS ${LLDB_WRAP_PYTHON}) # Install the LLDB python module install(DIRECTORY ${SWIG_PYTHON_DIR} DESTINATION ${SWIG_INSTALL_DIR}) Index: source/API/CMakeLists.txt =================================================================== --- source/API/CMakeLists.txt +++ source/API/CMakeLists.txt @@ -2,10 +2,6 @@ add_definitions( -DEXPORT_LIBLLDB ) endif() -# Include this so that add_lldb_library() has the list of dependencies -# for liblldb to link against -include(${LLDB_PROJECT_ROOT}/cmake/LLDBDependencies.cmake) - option(LLDB_BUILD_FRAMEWORK "Build the Darwin LLDB.framework" Off) if(LLDB_BUILD_FRAMEWORK AND CMAKE_VERSION VERSION_LESS 3.7) @@ -112,9 +108,17 @@ set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS " -w") endif() endif() +set_source_files_properties(${LLDB_WRAP_PYTHON} PROPERTIES GENERATED 1) +if (CLANG_CL) + set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING + PROPERTY COMPILE_FLAGS " -Wno-unused-function") +endif() +if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND + NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin") + set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING + PROPERTY COMPILE_FLAGS " -Wno-sequence-point -Wno-cast-qual") +endif () -# This should not be part of LLDBDependencies.cmake, because we don't -# want every single library taking a dependency on the script interpreters. target_link_libraries(liblldb PRIVATE lldbPluginScriptInterpreterNone lldbPluginScriptInterpreterPython @@ -156,7 +160,6 @@ if (LLDB_WRAP_PYTHON) add_dependencies(liblldb swig_wrapper) endif() -target_link_libraries(liblldb PRIVATE ${LLDB_SYSTEM_LIBS}) if(LLDB_BUILD_FRAMEWORK) file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h Index: source/Utility/CMakeLists.txt =================================================================== --- source/Utility/CMakeLists.txt +++ source/Utility/CMakeLists.txt @@ -1,3 +1,44 @@ +set(LLDB_SYSTEM_LIBS) + +# Windows-only libraries +if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) + list(APPEND LLDB_SYSTEM_LIBS + ws2_32 + rpcrt4 + ) +endif () + +if (NOT LLDB_DISABLE_LIBEDIT) + list(APPEND LLDB_SYSTEM_LIBS edit) +endif() +if (NOT LLDB_DISABLE_CURSES) + list(APPEND LLDB_SYSTEM_LIBS ${CURSES_LIBRARIES}) + if(LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO) + list(APPEND LLDB_SYSTEM_LIBS ${TERMINFO_LIBS}) + endif() +endif() + +if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB ) + list(APPEND LLDB_SYSTEM_LIBS atomic) +endif() + +list(APPEND LLDB_SYSTEM_LIBS ${Backtrace_LIBRARY}) + +if (NOT LLDB_DISABLE_PYTHON AND NOT LLVM_BUILD_STATIC) + list(APPEND LLDB_SYSTEM_LIBS ${PYTHON_LIBRARIES}) +endif() + +list(APPEND LLDB_SYSTEM_LIBS ${system_libs}) + +if (LLVM_BUILD_STATIC) + if (NOT LLDB_DISABLE_PYTHON) + list(APPEND LLDB_SYSTEM_LIBS python2.7 util) + endif() + if (NOT LLDB_DISABLE_CURSES) + list(APPEND LLDB_SYSTEM_LIBS gpm) + endif() +endif() + add_lldb_library(lldbUtility Baton.cpp Connection.cpp @@ -38,7 +79,8 @@ VMRange.cpp LINK_LIBS - # lldbUtility cannot have any dependencies + ${LLDB_SYSTEM_LIBS} + # lldbUtility does not depend on other LLDB libraries LINK_COMPONENTS BinaryFormat Index: tools/argdumper/CMakeLists.txt =================================================================== --- tools/argdumper/CMakeLists.txt +++ tools/argdumper/CMakeLists.txt @@ -1,9 +1,6 @@ -include(${LLDB_PROJECT_ROOT}/cmake/LLDBDependencies.cmake) - add_lldb_tool(lldb-argdumper INCLUDE_IN_FRAMEWORK argdumper.cpp LINK_LIBS lldbUtility ) - Index: tools/driver/CMakeLists.txt =================================================================== --- tools/driver/CMakeLists.txt +++ tools/driver/CMakeLists.txt @@ -1,5 +1,3 @@ -include(${LLDB_PROJECT_ROOT}/cmake/LLDBDependencies.cmake) - if ((CMAKE_SYSTEM_NAME MATCHES "Windows") OR (CMAKE_SYSTEM_NAME MATCHES "NetBSD" )) # These targets do not have getopt support, so they rely on the one provided by Index: tools/intel-features/CMakeLists.txt =================================================================== --- tools/intel-features/CMakeLists.txt +++ tools/intel-features/CMakeLists.txt @@ -1,5 +1,3 @@ -include(${LLDB_PROJECT_ROOT}/cmake/LLDBDependencies.cmake) - # Flags to control each individual feature option(LLDB_BUILD_INTEL_MPX "Enable Building of Intel(R) Memory Protection Extensions" ON) option(LLDB_BUILD_INTEL_PT "Enable Building of Intel(R) Processor Trace Tool" OFF) @@ -63,7 +61,6 @@ # Add link dependencies for python wrapper if (NOT LLDB_DISABLE_PYTHON AND LLDB_BUILD_INTEL_PT) add_dependencies(lldbIntelFeatures intel-features-swig_wrapper) - target_link_libraries(lldbIntelFeatures PRIVATE ${LLDB_SYSTEM_LIBS}) endif() install(TARGETS lldbIntelFeatures Index: tools/lldb-server/CMakeLists.txt =================================================================== --- tools/lldb-server/CMakeLists.txt +++ tools/lldb-server/CMakeLists.txt @@ -24,41 +24,6 @@ include_directories(../../source) -set(LLDB_SYSTEM_LIBS) -if (NOT LLDB_DISABLE_LIBEDIT) - list(APPEND LLDB_SYSTEM_LIBS edit) -endif() -if (NOT LLDB_DISABLE_CURSES) - list(APPEND LLDB_SYSTEM_LIBS ${CURSES_LIBRARIES}) - if(LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO) - list(APPEND LLDB_SYSTEM_LIBS ${TERMINFO_LIBS}) - endif() -endif() - -if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB ) - list(APPEND LLDB_SYSTEM_LIBS atomic) -endif() - -# On FreeBSD/NetBSD backtrace() is provided by libexecinfo, not libc. -if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD") - list(APPEND LLDB_SYSTEM_LIBS execinfo) -endif() - -if (NOT LLDB_DISABLE_PYTHON AND NOT LLVM_BUILD_STATIC) - list(APPEND LLDB_SYSTEM_LIBS ${PYTHON_LIBRARIES}) -endif() - -list(APPEND LLDB_SYSTEM_LIBS ${system_libs}) - -if (LLVM_BUILD_STATIC) - if (NOT LLDB_DISABLE_PYTHON) - list(APPEND LLDB_SYSTEM_LIBS python2.7 util) - endif() - if (NOT LLDB_DISABLE_CURSES) - list(APPEND LLDB_SYSTEM_LIBS gpm) - endif() -endif() - set(LLDB_PLUGINS) if(CMAKE_SYSTEM_NAME MATCHES "Linux|Android") Index: unittests/CMakeLists.txt =================================================================== --- unittests/CMakeLists.txt +++ unittests/CMakeLists.txt @@ -11,8 +11,6 @@ list(APPEND LLVM_COMPILE_FLAGS -include ${LLDB_GTEST_COMMON_INCLUDE}) endif () -include(${LLDB_PROJECT_ROOT}/cmake/LLDBDependencies.cmake) - if (LLDB_BUILT_STANDALONE) # Build the gtest library needed for unittests, if we have LLVM sources # handy. @@ -46,7 +44,7 @@ POST_BUILD COMMAND "${CMAKE_COMMAND}" -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/Inputs) - target_link_libraries(${test_name} ${ARG_LINK_LIBS} ${LLDB_SYSTEM_LIBS}) + target_link_libraries(${test_name} ${ARG_LINK_LIBS}) endfunction() function(add_unittest_inputs test_name inputs)