[Lldb-commits] [lldb] r229568 - Remove the CMake duplication for liblldb.
Zachary Turner
zturner at google.com
Tue Feb 17 14:20:21 PST 2015
Author: zturner
Date: Tue Feb 17 16:20:20 2015
New Revision: 229568
URL: http://llvm.org/viewvc/llvm-project?rev=229568&view=rev
Log:
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.
Modified:
lldb/trunk/include/lldb/Host/windows/getopt/GetOptInc.h
lldb/trunk/source/API/CMakeLists.txt
lldb/trunk/source/CMakeLists.txt
lldb/trunk/source/Host/CMakeLists.txt
Modified: lldb/trunk/include/lldb/Host/windows/getopt/GetOptInc.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/windows/getopt/GetOptInc.h?rev=229568&r1=229567&r2=229568&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/windows/getopt/GetOptInc.h (original)
+++ lldb/trunk/include/lldb/Host/windows/getopt/GetOptInc.h Tue Feb 17 16:20:20 2015
@@ -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,
Modified: lldb/trunk/source/API/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/CMakeLists.txt?rev=229568&r1=229567&r2=229568&view=diff
==============================================================================
--- lldb/trunk/source/API/CMakeLists.txt (original)
+++ lldb/trunk/source/API/CMakeLists.txt Tue Feb 17 16:20:20 2015
@@ -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
Modified: lldb/trunk/source/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/CMakeLists.txt?rev=229568&r1=229567&r2=229568&view=diff
==============================================================================
--- lldb/trunk/source/CMakeLists.txt (original)
+++ lldb/trunk/source/CMakeLists.txt Tue Feb 17 16:20:20 2015
@@ -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
Modified: lldb/trunk/source/Host/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/CMakeLists.txt?rev=229568&r1=229567&r2=229568&view=diff
==============================================================================
--- lldb/trunk/source/Host/CMakeLists.txt (original)
+++ lldb/trunk/source/Host/CMakeLists.txt Tue Feb 17 16:20:20 2015
@@ -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
More information about the lldb-commits
mailing list