Remove the CMake duplication for liblldb.

Previously the CMake had a lot of duplication for the public API
due to some differences regarding how we link on Windows.  This
fixes the issue, so making changes to the public API should be
much easier now.

llvm-svn: 229568
This commit is contained in:
Zachary Turner 2015-02-17 22:20:20 +00:00
parent 1a20fdf36f
commit 7513e82075
4 changed files with 12 additions and 89 deletions

View File

@ -21,13 +21,13 @@ struct option
int getopt( int argc, char * const argv[], const char *optstring );
// from getopt.h
extern LLDB_API char * optarg;
extern LLDB_API int optind;
extern char * optarg;
extern int optind;
extern int opterr;
extern int optopt;
// defined in unistd.h
extern LLDB_API int optreset;
extern int optreset;
int getopt_long
(
@ -38,7 +38,7 @@ int getopt_long
int *longindex
);
LLDB_API int getopt_long_only
int getopt_long_only
(
int argc,
char * const *argv,

View File

@ -1,8 +1,9 @@
set(LLVM_NO_RTTI 1)
# On Windows, the file list for liblldb is maintained in source\CMakeLists.txt.
# When adding a file to this list, do not forget to add it to the other list as
# well (where appropriate).
if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
add_definitions( -DEXPORT_LIBLLDB )
endif()
add_lldb_library(lldbAPI
SBAddress.cpp
SBAttachInfo.cpp

View File

@ -25,12 +25,7 @@ include_directories(
)
endif ()
# 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(API)
add_subdirectory(Breakpoint)
add_subdirectory(Commands)
add_subdirectory(Core)
@ -45,90 +40,16 @@ add_subdirectory(Utility)
include(../cmake/LLDBDependencies.cmake)
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" )
# On Non-Windows, the corresponding file list is maintained in
# source\API\CMakeLists.txt. When editing this list, do not forget to make a
# corresponding change in that file as well (when appropriate).
add_lldb_library(liblldb SHARED
lldb.cpp
lldb-log.cpp
API/SBAddress.cpp
API/SBAttachInfo.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/SBExecutionContext.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/SBLaunchInfo.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/SBThreadPlan.cpp
API/SBThreadCollection.cpp
API/SBType.cpp
API/SBTypeCategory.cpp
API/SBTypeEnumMember.cpp
API/SBTypeFilter.cpp
API/SBTypeFormat.cpp
API/SBTypeNameSpecifier.cpp
API/SBTypeSummary.cpp
API/SBTypeSynthetic.cpp
API/SBUnixSignals.cpp
API/SBValue.cpp
API/SBValueList.cpp
API/SBVariablesOptions.cpp
API/SBWatchpoint.cpp
Host/Windows/getopt/GetOptInc.cpp
${LLDB_WRAP_PYTHON}
${LLDB_VERS_GENERATED_FILE}
)
else ()
add_lldb_library(liblldb SHARED
lldb.cpp
lldb-log.cpp
${LLDB_WRAP_PYTHON}
${LLDB_VERS_GENERATED_FILE}
)
endif ()
if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
target_link_libraries(liblldb PRIVATE lldbAPI)
set_target_properties(liblldb
PROPERTIES
OUTPUT_NAME liblldb

View File

@ -63,6 +63,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows")
windows/ProcessRunLock.cpp
windows/ThisThread.cpp
windows/Windows.cpp
windows/getopt/GetOptInc.cpp
)
else()
add_host_subdirectory(posix