[lldb] Surround LLDB_API-defining code with #ifndef LLDB_API
authorPavel Labath <pavel@labath.sk>
Thu, 20 Jan 2022 19:36:14 +0000 (20:36 +0100)
committerPavel Labath <pavel@labath.sk>
Thu, 20 Jan 2022 19:50:35 +0000 (20:50 +0100)
This enables power-users to annotate lldb api functions with arbitrary
attributes. The motivation for this is being able to build liblldb as a
static library on windows (see discussion on D117564).

This should not be interpreted to mean that building liblldb is
supported in any way, but this does not cause any problems for us, and
can help users who really know what they are doing (or have no other
choice).

lldb/include/lldb/API/SBDefines.h

index d0ee093..ecf1dc3 100644 (file)
@@ -15,6 +15,7 @@
 #include "lldb/lldb-types.h"
 #include "lldb/lldb-versioning.h"
 
+#ifndef LLDB_API
 #if defined(_WIN32)
 #if defined(LLDB_IN_LIBLLDB)
 #define LLDB_API __declspec(dllexport)
@@ -24,6 +25,7 @@
 #else // defined (_WIN32)
 #define LLDB_API
 #endif
+#endif
 
 // Forward Declarations
 namespace lldb {