diff options
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/CMakeLists.txt | 2 | ||||
-rw-r--r-- | indra/llcommon/llpreprocessor.h | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 147b361ad8..baf374ee38 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -242,7 +242,6 @@ list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES}) if(LLCOMMON_LINK_SHARED) add_library (llcommon SHARED ${llcommon_SOURCE_FILES}) - add_definitions(-DLL_COMMON_BUILD=1) if(SHARED_LIB_STAGING_DIR) # *FIX:Mani --- @@ -290,7 +289,6 @@ target_link_libraries( add_dependencies(llcommon stage_third_party_libs) - include(LLAddBuildTest) SET(llcommon_TEST_SOURCE_FILES ) diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h index f135beed6a..f853e31002 100644 --- a/indra/llcommon/llpreprocessor.h +++ b/indra/llcommon/llpreprocessor.h @@ -149,11 +149,16 @@ #endif // LL_WINDOWS
#if LL_COMMON_LINK_SHARED
-# if LL_COMMON_BUILD
+// CMake automagically defines llcommon_EXPORTS only when building llcommon
+// sources, and only when llcommon is a shared library (i.e. when
+// LL_COMMON_LINK_SHARED). We must still test LL_COMMON_LINK_SHARED because
+// otherwise we can't distinguish between (non-llcommon source) and (llcommon
+// not shared).
+# if defined(llcommon_EXPORTS)
# define LL_COMMON_API LL_DLLEXPORT
-# else //LL_COMMON_BUILD
+# else //llcommon_EXPORTS
# define LL_COMMON_API LL_DLLIMPORT
-# endif //LL_COMMON_BUILD
+# endif //llcommon_EXPORTS
#else // LL_COMMON_LINK_SHARED
# define LL_COMMON_API
#endif // LL_COMMON_LINK_SHARED
|