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.
meow-7.2.2
Nat Goodspeed 2009-09-03 16:50:44 -04:00
parent 8d8e309bfe
commit a1c69da326
2 changed files with 8 additions and 5 deletions

View File

@ -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
)

View File

@ -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