diff options
author | Zachary Turner <zturner@google.com> | 2015-02-24 22:17:57 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2015-02-24 22:17:57 +0000 |
commit | 030b8cb413c5f982cb5b0a5bc3402aba300e6039 (patch) | |
tree | 44b0ae1534e485346f17723242817a41379091e0 /lldb/source/API | |
parent | d8820ae70c6b863bce2fd273f736dd88f6ff2a3e (diff) | |
download | bcm5719-llvm-030b8cb413c5f982cb5b0a5bc3402aba300e6039.tar.gz bcm5719-llvm-030b8cb413c5f982cb5b0a5bc3402aba300e6039.zip |
Resubmit "[CMake] Change lldbAPI to be a CMake OBJECT library."
This resubmits r230380. The primary cause of the failure was
actually just a warning, which we can disable at the CMake level
in a followup patch on the LLVM side. The other thing which was
actually an error on the bot should be able to be fixed with
a clean.
llvm-svn: 230389
Diffstat (limited to 'lldb/source/API')
-rw-r--r-- | lldb/source/API/CMakeLists.txt | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt index 65ce88e4b97..a6f4349b7b7 100644 --- a/lldb/source/API/CMakeLists.txt +++ b/lldb/source/API/CMakeLists.txt @@ -1,10 +1,25 @@ set(LLVM_NO_RTTI 1) if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) -add_definitions( -DEXPORT_LIBLLDB ) + add_definitions( -DEXPORT_LIBLLDB ) endif() -add_lldb_library(lldbAPI +# An OBJECT library is a special type of CMake library that produces +# no archive, has no link interface, and no link inputs. It is like +# a regular archive, just without the physical output. To link against +# an OBJECT library, you reference it in the *source* file list of a +# library using the special syntax $<TARGET_OBJECTS:lldbAPI>. This will +# cause every object file to be passed to the linker independently, as +# opposed to a single archive being passed to the linker. +# +# This is *extremely* important on Windows. lldbAPI exports all of the +# SB classes using __declspec(dllexport). Unfortunately for technical +# reasons it is not possible (well, extremely difficult) to get the linker +# to propagate a __declspec(dllexport) attribute from a symbol in an +# object file in an archive to a DLL that links against that archive. +# The solution to this is for the DLL to link the object file directly. +# So lldbAPI must be an OBJECT library. +add_lldb_library(lldbAPI OBJECT SBAddress.cpp SBAttachInfo.cpp SBBlock.cpp |