diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2009-09-03 16:50:44 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2009-09-03 16:50:44 -0400 |
commit | a1c69da32657ca94166519e1e522dd1d790bfa47 (patch) | |
tree | 47464d3053492332b488b09076b34b1eaf92afe9 /indra/llcommon | |
parent | 8d8e309bfe59e0248c9c9b5c780c919277fced92 (diff) |
QAR-1619: Fix Windows link errors when building INTEGRATION_TEST_lllazy.
The problem arose because we were setting LL_COMMON_BUILD in
llcommon/CMakeLists.txt, not only for the library build itself but also for
its LL_ADD_INTEGRATION_TEST tests. This told all the headers compiled into the
INTEGRATION_TEST_lllazy executable that the executable was providing all the
llcommon symbols, rather than importing them.
The solution is to switch to the llcommon_EXPORTS symbol automagically defined
by CMake when building the llcommon shared library itself.
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
|