mirror of
https://github.com/intel/llvm.git
synced 2026-01-17 06:40:01 +08:00
In an effort to reduce binary size for components not wishing to link against all of LLDB, as well as a parallel effort to reduce link dependencies on Python, this patch splits out the notion of LLDB initialization into "full" and "common" initialization. All code related to initializing the full LLDB suite lives directly in API now. Previously it was only referenced from API, but because it was defined in lldbCore, it would get implicitly linked against by everything including lldb-server, causing a considerable increase in binary size. By moving this to the API layer, it also creates a better layering for the ongoing effort to make the embedded interpreter replacable with one from a different language (or even be completely removeable). One semantic change necessary to get this all working was to remove the notion of a shared debugger refcount. The debugger is either initialized or uninitialized now, and calling Initialize() multiple times will simply have no effect, while the first Terminate() will now shut it down no matter how many times Initialize() was called. This behaves nicely with all of our supported usage patterns though, and allows us to fix a number of nasty hacks from before. Differential Revision: http://reviews.llvm.org/D8462 llvm-svn: 233758
97 lines
2.1 KiB
CMake
97 lines
2.1 KiB
CMake
set(LLVM_NO_RTTI 1)
|
|
|
|
if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
|
|
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)
|
|
|
|
add_lldb_library(liblldb SHARED
|
|
SBAddress.cpp
|
|
SBAttachInfo.cpp
|
|
SBBlock.cpp
|
|
SBBreakpoint.cpp
|
|
SBBreakpointLocation.cpp
|
|
SBBroadcaster.cpp
|
|
SBCommandInterpreter.cpp
|
|
SBCommandReturnObject.cpp
|
|
SBCommunication.cpp
|
|
SBCompileUnit.cpp
|
|
SBData.cpp
|
|
SBDebugger.cpp
|
|
SBDeclaration.cpp
|
|
SBError.cpp
|
|
SBEvent.cpp
|
|
SBExecutionContext.cpp
|
|
SBExpressionOptions.cpp
|
|
SBFileSpec.cpp
|
|
SBFileSpecList.cpp
|
|
SBFrame.cpp
|
|
SBFunction.cpp
|
|
SBHostOS.cpp
|
|
SBInstruction.cpp
|
|
SBInstructionList.cpp
|
|
SBLaunchInfo.cpp
|
|
SBLineEntry.cpp
|
|
SBListener.cpp
|
|
SBModule.cpp
|
|
SBModuleSpec.cpp
|
|
SBPlatform.cpp
|
|
SBProcess.cpp
|
|
SBQueue.cpp
|
|
SBQueueItem.cpp
|
|
SBSection.cpp
|
|
SBSourceManager.cpp
|
|
SBStream.cpp
|
|
SBStringList.cpp
|
|
SBSymbol.cpp
|
|
SBSymbolContext.cpp
|
|
SBSymbolContextList.cpp
|
|
SBTarget.cpp
|
|
SBThread.cpp
|
|
SBThreadCollection.cpp
|
|
SBThreadPlan.cpp
|
|
SBType.cpp
|
|
SBTypeCategory.cpp
|
|
SBTypeEnumMember.cpp
|
|
SBTypeFilter.cpp
|
|
SBTypeFormat.cpp
|
|
SBTypeNameSpecifier.cpp
|
|
SBTypeSummary.cpp
|
|
SBTypeSynthetic.cpp
|
|
SBValue.cpp
|
|
SBValueList.cpp
|
|
SBVariablesOptions.cpp
|
|
SBWatchpoint.cpp
|
|
SBUnixSignals.cpp
|
|
SystemInitializerFull.cpp
|
|
${LLDB_WRAP_PYTHON}
|
|
${LLDB_VERS_GENERATED_FILE}
|
|
)
|
|
|
|
set_target_properties(liblldb
|
|
PROPERTIES
|
|
VERSION ${LLDB_VERSION}
|
|
)
|
|
|
|
if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
|
|
# Only MSVC has the ABI compatibility problem and avoids using FindPythonLibs,
|
|
# so only it needs to explicitly link against ${PYTHON_LIBRARY}
|
|
if (MSVC AND NOT LLDB_DISABLE_PYTHON)
|
|
target_link_libraries(liblldb PRIVATE ${PYTHON_LIBRARY})
|
|
endif()
|
|
else()
|
|
set_target_properties(liblldb
|
|
PROPERTIES
|
|
OUTPUT_NAME lldb
|
|
)
|
|
endif()
|
|
|
|
if (LLDB_WRAP_PYTHON OR LLDB_VERS_GENERATED_FILE)
|
|
add_dependencies(liblldb swig_wrapper)
|
|
endif()
|
|
target_link_libraries(liblldb ${cmake_2_8_12_PRIVATE} ${LLDB_SYSTEM_LIBS})
|
|
|