Apart from just really cleaning things up and moving everything into one class regarding thread IDs (ie, is_main_thread(), comparing ID's etc), this also fixes an obscure bug where LL was casting thread ID's to U32 and then compared those to find out if it the same thread. It's theoretically possible that such fails on a 64bit OS. By generalizing the interface, I adopted the use of a thread-local cache for the current thread ID as used by LLMutex et al, so now all code benefits from that. The idea was even extended to now also be used for is_main_thread() tests and even resetting a thread ID to the ID of the current thread.
280 lines
5.2 KiB
CMake
280 lines
5.2 KiB
CMake
# -*- cmake -*-
|
|
|
|
project(llcommon)
|
|
|
|
include(Cwdebug)
|
|
include(00-Common)
|
|
include(LLCommon)
|
|
include(APR)
|
|
include(Linking)
|
|
|
|
include_directories(
|
|
${EXPAT_INCLUDE_DIRS}
|
|
${LLCOMMON_INCLUDE_DIRS}
|
|
${ZLIB_INCLUDE_DIRS}
|
|
)
|
|
|
|
set(llcommon_SOURCE_FILES
|
|
aiframetimer.cpp
|
|
aithreadid.cpp
|
|
imageids.cpp
|
|
indra_constants.cpp
|
|
llallocator.cpp
|
|
llallocator_heap_profile.cpp
|
|
llapp.cpp
|
|
llapr.cpp
|
|
llaprpool.cpp
|
|
llassettype.cpp
|
|
llavatarname.cpp
|
|
llbase32.cpp
|
|
llbase64.cpp
|
|
llcommon.cpp
|
|
llcommonutils.cpp
|
|
llcoros.cpp
|
|
llcrc.cpp
|
|
llcriticaldamp.cpp
|
|
llcursortypes.cpp
|
|
lldate.cpp
|
|
lldependencies.cpp
|
|
lldictionary.cpp
|
|
llerror.cpp
|
|
llerrorthread.cpp
|
|
llevent.cpp
|
|
lleventapi.cpp
|
|
lleventcoro.cpp
|
|
lleventdispatcher.cpp
|
|
lleventfilter.cpp
|
|
llevents.cpp
|
|
lleventtimer.cpp
|
|
llfasttimer_class.cpp
|
|
llfile.cpp
|
|
llfindlocale.cpp
|
|
llfixedbuffer.cpp
|
|
llfoldertype.cpp
|
|
llformat.cpp
|
|
llframetimer.cpp
|
|
llheartbeat.cpp
|
|
llinstancetracker.cpp
|
|
llindraconfigfile.cpp
|
|
llliveappconfig.cpp
|
|
lllivefile.cpp
|
|
lllog.cpp
|
|
llmd5.cpp
|
|
llmemory.cpp
|
|
llmemorystream.cpp
|
|
llmemtype.cpp
|
|
llmetrics.cpp
|
|
llmortician.cpp
|
|
lloptioninterface.cpp
|
|
llptrto.cpp
|
|
llprocesslauncher.cpp
|
|
llprocessor.cpp
|
|
llqueuedthread.cpp
|
|
llrand.cpp
|
|
llrefcount.cpp
|
|
llrun.cpp
|
|
llscopedvolatileaprpool.h
|
|
llsd.cpp
|
|
llsdserialize.cpp
|
|
llsdserialize_xml.cpp
|
|
llsdutil.cpp
|
|
llsecondlifeurls.cpp
|
|
llsingleton.cpp
|
|
llstat.cpp
|
|
llstacktrace.cpp
|
|
llstreamtools.cpp
|
|
llstring.cpp
|
|
llstringtable.cpp
|
|
llsys.cpp
|
|
llthread.cpp
|
|
llthreadsafequeue.cpp
|
|
lltimer.cpp
|
|
lluri.cpp
|
|
lluuid.cpp
|
|
llworkerthread.cpp
|
|
ll_template_cast.h
|
|
metaclass.cpp
|
|
metaproperty.cpp
|
|
reflective.cpp
|
|
timing.cpp
|
|
u64.cpp
|
|
)
|
|
|
|
set(llcommon_HEADER_FILES
|
|
CMakeLists.txt
|
|
|
|
aiframetimer.h
|
|
aithreadid.h
|
|
aithreadsafe.h
|
|
bitpack.h
|
|
ctype_workaround.h
|
|
doublelinkedlist.h
|
|
imageids.h
|
|
indra_constants.h
|
|
linden_common.h
|
|
linked_lists.h
|
|
llaccountingcost.h
|
|
llallocator.h
|
|
llallocator_heap_profile.h
|
|
llagentconstants.h
|
|
llavatarname.h
|
|
llapp.h
|
|
llapr.h
|
|
llaprpool.h
|
|
llassettype.h
|
|
llassoclist.h
|
|
llatomic.h
|
|
llavatarconstants.h
|
|
llbase32.h
|
|
llbase64.h
|
|
llboost.h
|
|
llchat.h
|
|
llclickaction.h
|
|
llcommon.h
|
|
llcommonutils.h
|
|
llcoros.h
|
|
llcrc.h
|
|
llcriticaldamp.h
|
|
llcursortypes.h
|
|
lldarray.h
|
|
lldarrayptr.h
|
|
lldate.h
|
|
lldefs.h
|
|
lldependencies.h
|
|
lldeleteutils.h
|
|
lldepthstack.h
|
|
lldictionary.h
|
|
lldlinked.h
|
|
lldqueueptr.h
|
|
llendianswizzle.h
|
|
llenum.h
|
|
llerror.h
|
|
llerrorcontrol.h
|
|
llerrorlegacy.h
|
|
llerrorthread.h
|
|
llevent.h
|
|
lleventapi.h
|
|
lleventcoro.h
|
|
lleventdispatcher.h
|
|
lleventfilter.h
|
|
llevents.h
|
|
lleventemitter.h
|
|
llextendedstatus.h
|
|
lleventtimer.h
|
|
llfasttimer.h
|
|
llfasttimer_class.h
|
|
llfile.h
|
|
llfindlocale.h
|
|
llfixedbuffer.h
|
|
llfoldertype.h
|
|
llformat.h
|
|
llframetimer.h
|
|
llhash.h
|
|
llheartbeat.h
|
|
llhttpstatuscodes.h
|
|
llindexedqueue.h
|
|
llinstancetracker.h
|
|
llindraconfigfile.h
|
|
llkeythrottle.h
|
|
lllinkedqueue.h
|
|
llliveappconfig.h
|
|
lllivefile.h
|
|
lllocalidhashmap.h
|
|
lllog.h
|
|
lllslconstants.h
|
|
llmap.h
|
|
llmd5.h
|
|
llmemory.h
|
|
llmemorystream.h
|
|
llmemtype.h
|
|
llmetrics.h
|
|
llmortician.h
|
|
llnametable.h
|
|
lloptioninterface.h
|
|
llpointer.h
|
|
llpreprocessor.h
|
|
llpriqueuemap.h
|
|
llprocesslauncher.h
|
|
llprocessor.h
|
|
llptrskiplist.h
|
|
llptrskipmap.h
|
|
llptrto.h
|
|
llqueuedthread.h
|
|
llrand.h
|
|
llrefcount.h
|
|
llrun.h
|
|
llrefcount.h
|
|
llsafehandle.h
|
|
llsd.h
|
|
llsdserialize.h
|
|
llsdserialize_xml.h
|
|
llsdutil.h
|
|
llsecondlifeurls.h
|
|
llsimplehash.h
|
|
llsingleton.h
|
|
llskiplist.h
|
|
llskipmap.h
|
|
llstack.h
|
|
llstacktrace.h
|
|
llstat.h
|
|
llstatenums.h
|
|
llstl.h
|
|
llstreamtools.h
|
|
llstrider.h
|
|
llstring.h
|
|
llstringtable.h
|
|
llsys.h
|
|
llthread.h
|
|
llthreadsafequeue.h
|
|
lltimer.h
|
|
lltreeiterators.h
|
|
lluri.h
|
|
lluuid.h
|
|
lluuidhashmap.h
|
|
llversionviewer.h.in
|
|
llworkerthread.h
|
|
metaclass.h
|
|
metaclasst.h
|
|
metaproperty.h
|
|
metapropertyt.h
|
|
reflective.h
|
|
reflectivet.h
|
|
roles_constants.h
|
|
stdenums.h
|
|
stdtypes.h
|
|
string_table.h
|
|
stringize.h
|
|
timer.h
|
|
timing.h
|
|
u64.h
|
|
)
|
|
|
|
set_source_files_properties(${llcommon_HEADER_FILES}
|
|
PROPERTIES HEADER_FILE_ONLY TRUE)
|
|
|
|
list(APPEND llcommon_SOURCE_FILES ${cwdebug_SOURCE_FILES})
|
|
list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES})
|
|
|
|
add_library (llcommon SHARED ${llcommon_SOURCE_FILES})
|
|
add_dependencies(llcommon prepare)
|
|
target_link_libraries(
|
|
llcommon
|
|
${APRUTIL_LIBRARIES}
|
|
${APR_LIBRARIES}
|
|
${EXPAT_LIBRARIES}
|
|
${ZLIB_LIBRARIES}
|
|
${WINDOWS_LIBRARIES}
|
|
${BOOST_REGEX_LIBRARY}
|
|
${CORESERVICES_LIBRARY}
|
|
)
|
|
|
|
if (DARWIN)
|
|
# Don't embed a full path in the library's install name
|
|
set_target_properties(
|
|
llcommon
|
|
PROPERTIES
|
|
BUILD_WITH_INSTALL_RPATH 1
|
|
INSTALL_NAME_DIR "@executable_path/../Resources"
|
|
)
|
|
endif (DARWIN)
|