[Lldb-commits] [lldb] r202724 - Build liblldb.dll in Windows
Sean Callanan
scallanan at apple.com
Thu Mar 6 09:49:39 PST 2014
Deepak,
please be careful when adding header dependencies in LLDB’s public API. This breaks clients of the OS X API unless steps are taken to modify the OS X build process to install the header in question along with the other API headers.
In this particular case, r202724 introduced a dependency by lldb-defines.h on lldb-dll-export.h.
I am about to commit a fix to the OS X build system, but in future please let us know in advance when the list of headers required for the public API changes, so we can coordinate.
Sean
On Mar 3, 2014, at 7:50 AM, Deepak Panickal <deepak at codeplay.com> wrote:
> Author: panickal
> Date: Mon Mar 3 09:50:36 2014
> New Revision: 202724
>
> URL: http://llvm.org/viewvc/llvm-project?rev=202724&view=rev
> Log:
> Build liblldb.dll in Windows
>
> Modified:
> lldb/trunk/include/lldb/API/SBDefines.h
> lldb/trunk/include/lldb/Host/HostGetOpt.h
> lldb/trunk/include/lldb/lldb-defines.h
> lldb/trunk/source/CMakeLists.txt
> lldb/trunk/source/Host/windows/CMakeLists.txt
> lldb/trunk/tools/driver/CMakeLists.txt
>
> Modified: lldb/trunk/include/lldb/API/SBDefines.h
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBDefines.h?rev=202724&r1=202723&r2=202724&view=diff
> ==============================================================================
> --- lldb/trunk/include/lldb/API/SBDefines.h (original)
> +++ lldb/trunk/include/lldb/API/SBDefines.h Mon Mar 3 09:50:36 2014
> @@ -21,62 +21,65 @@
> #include "lldb/lldb-types.h"
> #include "lldb/lldb-versioning.h"
>
> -// Forward Declarations
> +#ifdef SWIG
> +#define LLDB_API
> +#endif
>
> +// Forward Declarations
> namespace lldb {
>
> -class SBAddress;
> -class SBBlock;
> -class SBBreakpoint;
> -class SBBreakpointLocation;
> -class SBBroadcaster;
> -class SBCommand;
> -class SBCommandInterpreter;
> -class SBCommandPluginInterface;
> -class SBCommandReturnObject;
> -class SBCommunication;
> -class SBCompileUnit;
> -class SBData;
> -class SBDebugger;
> -class SBDeclaration;
> -class SBError;
> -class SBEvent;
> -class SBEventList;
> -class SBExpressionOptions;
> -class SBFileSpec;
> -class SBFileSpecList;
> -class SBFrame;
> -class SBFunction;
> -class SBHostOS;
> -class SBInstruction;
> -class SBInstructionList;
> -class SBLineEntry;
> -class SBListener;
> -class SBModule;
> -class SBModuleSpec;
> -class SBModuleSpecList;
> -class SBProcess;
> -class SBSourceManager;
> -class SBStream;
> -class SBStringList;
> -class SBSymbol;
> -class SBSymbolContext;
> -class SBSymbolContextList;
> -class SBTarget;
> -class SBThread;
> -class SBType;
> -class SBTypeCategory;
> -class SBTypeFilter;
> -class SBTypeFormat;
> -class SBTypeNameSpecifier;
> -class SBTypeSummary;
> +class LLDB_API SBAddress;
> +class LLDB_API SBBlock;
> +class LLDB_API SBBreakpoint;
> +class LLDB_API SBBreakpointLocation;
> +class LLDB_API SBBroadcaster;
> +class LLDB_API SBCommand;
> +class LLDB_API SBCommandInterpreter;
> +class LLDB_API SBCommandPluginInterface;
> +class LLDB_API SBCommandReturnObject;
> +class LLDB_API SBCommunication;
> +class LLDB_API SBCompileUnit;
> +class LLDB_API SBData;
> +class LLDB_API SBDebugger;
> +class LLDB_API SBDeclaration;
> +class LLDB_API SBError;
> +class LLDB_API SBEvent;
> +class LLDB_API SBEventList;
> +class LLDB_API SBExpressionOptions;
> +class LLDB_API SBFileSpec;
> +class LLDB_API SBFileSpecList;
> +class LLDB_API SBFrame;
> +class LLDB_API SBFunction;
> +class LLDB_API SBHostOS;
> +class LLDB_API SBInstruction;
> +class LLDB_API SBInstructionList;
> +class LLDB_API SBLineEntry;
> +class LLDB_API SBListener;
> +class LLDB_API SBModule;
> +class LLDB_API SBModuleSpec;
> +class LLDB_API SBModuleSpecList;
> +class LLDB_API SBProcess;
> +class LLDB_API SBSourceManager;
> +class LLDB_API SBStream;
> +class LLDB_API SBStringList;
> +class LLDB_API SBSymbol;
> +class LLDB_API SBSymbolContext;
> +class LLDB_API SBSymbolContextList;
> +class LLDB_API SBTarget;
> +class LLDB_API SBThread;
> +class LLDB_API SBType;
> +class LLDB_API SBTypeCategory;
> +class LLDB_API SBTypeFilter;
> +class LLDB_API SBTypeFormat;
> +class LLDB_API SBTypeNameSpecifier;
> +class LLDB_API SBTypeSummary;
> #ifndef LLDB_DISABLE_PYTHON
> -class SBTypeSynthetic;
> +class LLDB_API SBTypeSynthetic;
> #endif
> -class SBTypeList;
> -class SBValue;
> -class SBValueList;
> -class SBWatchpoint;
> +class LLDB_API SBTypeList;
> +class LLDB_API SBValue;
> +class LLDB_API SBValueList;
> +class LLDB_API SBWatchpoint;
>
> }
>
>
> Modified: lldb/trunk/include/lldb/Host/HostGetOpt.h
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/HostGetOpt.h?rev=202724&r1=202723&r2=202724&view=diff
> ==============================================================================
> --- lldb/trunk/include/lldb/Host/HostGetOpt.h (original)
> +++ lldb/trunk/include/lldb/Host/HostGetOpt.h Mon Mar 3 09:50:36 2014
> @@ -15,6 +15,6 @@
>
> #else
>
> -#include <lldb/Host/windows/GetOptInc.h>
> +#include <lldb/Host/windows/getopt/GetOptInc.h>
>
> #endif
>
> Modified: lldb/trunk/include/lldb/lldb-defines.h
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-defines.h?rev=202724&r1=202723&r2=202724&view=diff
> ==============================================================================
> --- lldb/trunk/include/lldb/lldb-defines.h (original)
> +++ lldb/trunk/include/lldb/lldb-defines.h Mon Mar 3 09:50:36 2014
> @@ -11,6 +11,7 @@
> #define LLDB_lldb_defines_h_
>
> #include "lldb/lldb-types.h"
> +#include "lldb/lldb-dll-export.h"
>
> #if !defined(UINT32_MAX)
> #define UINT32_MAX 4294967295U
>
> Modified: lldb/trunk/source/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/CMakeLists.txt?rev=202724&r1=202723&r2=202724&view=diff
> ==============================================================================
> --- lldb/trunk/source/CMakeLists.txt (original)
> +++ lldb/trunk/source/CMakeLists.txt Mon Mar 3 09:50:36 2014
> @@ -14,7 +14,11 @@ include_directories(
> )
> endif ()
>
> -add_subdirectory(API)
> +# Need to export the API in the liblldb.dll for Windows
> +# The lldbAPI source files are added directly in liblldb
> +if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows" )
> + add_subdirectory(API)
> +endif ()
> add_subdirectory(Breakpoint)
> add_subdirectory(Commands)
> add_subdirectory(Core)
> @@ -28,7 +32,6 @@ add_subdirectory(Target)
> add_subdirectory(Utility)
>
> set( LLDB_USED_LIBS
> - lldbAPI
> lldbBreakpoint
> lldbCommands
> lldbDataFormatters
> @@ -77,6 +80,14 @@ set( LLDB_USED_LIBS
> lldbPluginOSPython
> )
>
> +# Need to export the API in the liblldb.dll for Windows
> +# The lldbAPI source files are added directly in liblldb
> +if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows" )
> + list(APPEND LLDB_USED_LIBS
> + lldbAPI
> + )
> +endif ()
> +
> # Windows-only libraries
> if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
> list(APPEND LLDB_USED_LIBS
> @@ -171,29 +182,102 @@ set( LLVM_LINK_COMPONENTS
> option
> )
>
> -set_source_files_properties(${LLDB_BINARY_DIR}/scripts/LLDBWrapPython.cpp PROPERTIES GENERATED 1)
>
> -if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
> - set(SHARED_LIBRARY 1)
> +if ( NOT LLDB_DISABLE_PYTHON )
> + set_source_files_properties(${LLDB_BINARY_DIR}/scripts/LLDBWrapPython.cpp PROPERTIES GENERATED 1)
> + set(LLDB_WRAP_PYTHON ${LLDB_BINARY_DIR}/scripts/LLDBWrapPython.cpp)
> endif()
> +set(SHARED_LIBRARY 1)
>
> -if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
> - set(LLDB_WRAP_PYTHON ${LLDB_BINARY_DIR}/scripts/LLDBWrapPython.cpp)
> +if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
> +add_definitions( -DEXPORT_LIBLLDB )
> endif()
>
> +# Need to export the API in the liblldb.dll for Windows
> +# The lldbAPI source files are added directly in liblldb
> +if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
> +add_lldb_library(liblldb
> + lldb.cpp
> + lldb-log.cpp
> + API/SBAddress.cpp
> + API/SBBlock.cpp
> + API/SBBreakpoint.cpp
> + API/SBBreakpointLocation.cpp
> + API/SBBroadcaster.cpp
> + API/SBCommandInterpreter.cpp
> + API/SBCommandReturnObject.cpp
> + API/SBCommunication.cpp
> + API/SBCompileUnit.cpp
> + API/SBData.cpp
> + API/SBDebugger.cpp
> + API/SBDeclaration.cpp
> + API/SBError.cpp
> + API/SBEvent.cpp
> + API/SBExpressionOptions.cpp
> + API/SBFileSpec.cpp
> + API/SBFileSpecList.cpp
> + API/SBFrame.cpp
> + API/SBFunction.cpp
> + API/SBHostOS.cpp
> + API/SBInstruction.cpp
> + API/SBInstructionList.cpp
> + API/SBLineEntry.cpp
> + API/SBListener.cpp
> + API/SBModule.cpp
> + API/SBModuleSpec.cpp
> + API/SBPlatform.cpp
> + API/SBProcess.cpp
> + API/SBQueue.cpp
> + API/SBQueueItem.cpp
> + API/SBSection.cpp
> + API/SBSourceManager.cpp
> + API/SBStream.cpp
> + API/SBStringList.cpp
> + API/SBSymbol.cpp
> + API/SBSymbolContext.cpp
> + API/SBSymbolContextList.cpp
> + API/SBTarget.cpp
> + API/SBThread.cpp
> + API/SBType.cpp
> + API/SBTypeCategory.cpp
> + API/SBTypeFilter.cpp
> + API/SBTypeFormat.cpp
> + API/SBTypeNameSpecifier.cpp
> + API/SBTypeSummary.cpp
> + API/SBTypeSynthetic.cpp
> + API/SBValue.cpp
> + API/SBValueList.cpp
> + API/SBWatchpoint.cpp
> + Host/Windows/getopt/GetOptInc.cpp
> + ${LLDB_WRAP_PYTHON}
> + ${LLDB_VERS_GENERATED_FILE}
> + )
> +else ()
> add_lldb_library(liblldb
> lldb.cpp
> lldb-log.cpp
> ${LLDB_WRAP_PYTHON}
> ${LLDB_VERS_GENERATED_FILE}
> )
> +endif ()
> +
> +if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
> +set_target_properties(liblldb
> + PROPERTIES
> + OUTPUT_NAME liblldb
> + VERSION ${LLDB_VERSION}
> + )
> +else()
> set_target_properties(liblldb
> PROPERTIES
> OUTPUT_NAME lldb
> VERSION ${LLDB_VERSION}
> )
> +endif()
> +
> if (LLDB_WRAP_PYTHON OR LLDB_VERS_GENERATED_FILE)
> add_dependencies(liblldb
> + swig_wrapper
> ${LLDB_WRAP_PYTHON}
> ${LLDB_VERS_GENERATED_FILE}
> )
>
> Modified: lldb/trunk/source/Host/windows/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/CMakeLists.txt?rev=202724&r1=202723&r2=202724&view=diff
> ==============================================================================
> --- lldb/trunk/source/Host/windows/CMakeLists.txt (original)
> +++ lldb/trunk/source/Host/windows/CMakeLists.txt Mon Mar 3 09:50:36 2014
> @@ -7,5 +7,4 @@ add_lldb_library(lldbHostWindows
> Condition.cpp
> Windows.cpp
> EditLineWin.cpp
> - GetOptInc.cpp
> )
>
> Modified: lldb/trunk/tools/driver/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/CMakeLists.txt?rev=202724&r1=202723&r2=202724&view=diff
> ==============================================================================
> --- lldb/trunk/tools/driver/CMakeLists.txt (original)
> +++ lldb/trunk/tools/driver/CMakeLists.txt Mon Mar 3 09:50:36 2014
> @@ -4,6 +4,10 @@ add_lldb_executable(lldb
> Platform.cpp
> )
>
> +if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
> +add_definitions( -DIMPORT_LIBLLDB )
> +endif()
> +
> target_link_libraries(lldb liblldb)
> # TODO: why isn't this done by add_lldb_executable?
> #target_link_libraries(lldb ${LLDB_USED_LIBS})
>
>
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
More information about the lldb-commits
mailing list