diff --git a/autobuild.xml b/autobuild.xml index 8b7edcdea..c3841bd8b 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -68,18 +68,18 @@ archive hash - b95e484e5b6cc0d10da48d3cf0ad37cd + b82d5aa8380926240f3415279480c831 hash_algorithm md5 url - http://depot.alchemyviewer.org/pub/packages/common/abseil_cpp-20190327.190862343-common-190862343.tar.bz2 + https://pkg.alchemyviewer.org/repository/autobuild-external/abseil-cpp/common/abseil_cpp-ac78ffc.1-common-1.tar.bz2 name common version - 20190327.190862343 + ac78ffc.1 apr_suite diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index b480c96b3..ab77f9e96 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -17,6 +17,7 @@ project(${ROOT_PROJECT_NAME}) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") include(Variables) +include(00-Common) include(BuildVersion) set(CMAKE_CXX_STANDARD 14) @@ -27,6 +28,9 @@ if (NOT CMAKE_BUILD_TYPE) "Build type. One of: Debug Release RelWithDebInfo" FORCE) endif (NOT CMAKE_BUILD_TYPE) +include(Abseil-CPP) +# Dependencies +add_subdirectory(${ABSEIL_SRC_DIR} ${ABSEIL_BIN_DIR}) add_subdirectory(cmake) add_subdirectory(${LIBS_OPEN_PREFIX}aistatemachine) add_subdirectory(${LIBS_OPEN_PREFIX}llaudio) diff --git a/indra/aistatemachine/CMakeLists.txt b/indra/aistatemachine/CMakeLists.txt index 791ff9d25..42cfec5e2 100644 --- a/indra/aistatemachine/CMakeLists.txt +++ b/indra/aistatemachine/CMakeLists.txt @@ -39,3 +39,9 @@ set_source_files_properties(${aistatemachine_HEADER_FILES} list(APPEND aistatemachine_SOURCE_FILES ${aistatemachine_HEADER_FILES}) add_library (aistatemachine ${aistatemachine_SOURCE_FILES}) + +target_link_libraries( + aistatemachine + PUBLIC + llcommon + ) diff --git a/indra/cmake/Abseil-CPP.cmake b/indra/cmake/Abseil-CPP.cmake new file mode 100644 index 000000000..c7bb0f763 --- /dev/null +++ b/indra/cmake/Abseil-CPP.cmake @@ -0,0 +1,8 @@ +# -*- cmake -*- +include(Prebuilt) + +set(BUILD_TESTING OFF) +use_prebuilt_binary(abseil-cpp) +set(ABSEIL_SRC_DIR ${LIBS_PREBUILT_DIR}/abseil-cpp) +set(ABSEIL_BIN_DIR ${CMAKE_BINARY_DIR}/abseil-cpp) + diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 28f0f3c2a..04ae8dc00 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -8,6 +8,7 @@ set(cmake_SOURCE_FILES CMakeLists.txt 00-Common.cmake + Abseil-CPP.cmake AIStateMachine.cmake APR.cmake Audio.cmake diff --git a/indra/libndhacd/CMakeLists.txt b/indra/libndhacd/CMakeLists.txt index 28c4d2f9a..ce520fbdc 100644 --- a/indra/libndhacd/CMakeLists.txt +++ b/indra/libndhacd/CMakeLists.txt @@ -33,3 +33,8 @@ set_source_files_properties(${libndhacd_HEADER_FILES} add_library( nd_hacdConvexDecomposition STATIC ${libndhacd_SOURCE_FILES} ${libndhacd_HEADER_FILES}) +target_link_libraries( + nd_hacdConvexDecomposition + PUBLIC + llcommon + ) diff --git a/indra/libpathing/CMakeLists.txt b/indra/libpathing/CMakeLists.txt index 2ab424822..aefe1a2ac 100644 --- a/indra/libpathing/CMakeLists.txt +++ b/indra/libpathing/CMakeLists.txt @@ -30,3 +30,8 @@ set_source_files_properties(${libpathing_HEADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) add_library(nd_Pathing STATIC ${libpathing_SOURCE_FILES} ${libpathing_HEADER_FILES} ) + +target_link_libraries(nd_Pathing + PUBLIC + llcommon +) diff --git a/indra/llaudio/CMakeLists.txt b/indra/llaudio/CMakeLists.txt index f6ea97d07..a200a456e 100644 --- a/indra/llaudio/CMakeLists.txt +++ b/indra/llaudio/CMakeLists.txt @@ -81,3 +81,9 @@ set_source_files_properties(${llaudio_HEADER_FILES} list(APPEND llaudio_SOURCE_FILES ${llaudio_HEADER_FILES}) add_library (llaudio ${llaudio_SOURCE_FILES}) + +target_link_libraries( + llaudio + PUBLIC + llcommon + ) diff --git a/indra/llcharacter/CMakeLists.txt b/indra/llcharacter/CMakeLists.txt index a698a9847..e95b92436 100644 --- a/indra/llcharacter/CMakeLists.txt +++ b/indra/llcharacter/CMakeLists.txt @@ -77,3 +77,9 @@ set_source_files_properties(${llcharacter_HEADER_FILES} list(APPEND llcharacter_SOURCE_FILES ${llcharacter_HEADER_FILES}) add_library (llcharacter ${llcharacter_SOURCE_FILES}) + +target_link_libraries( + llcharacter + PUBLIC + llcommon + ) diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index b59485a06..6479c7bca 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -4,7 +4,9 @@ project(llcommon) include(Cwdebug) include(00-Common) +include(Linking) include(LLCommon) +include(EXPAT) include(APR) include(Linking) include(Boost) @@ -287,6 +289,8 @@ endif(LLCOMMON_LINK_SHARED) target_link_libraries( llcommon + PUBLIC + absl::hash ${BREAKPAD_EXCEPTION_HANDLER_LIBRARIES} ${APRUTIL_LIBRARIES} ${APR_LIBRARIES} diff --git a/indra/llcommon/lluuid.h b/indra/llcommon/lluuid.h index 7923d50db..8e5f4e02a 100644 --- a/indra/llcommon/lluuid.h +++ b/indra/llcommon/lluuid.h @@ -34,6 +34,7 @@ #include #include "stdtypes.h" #include "llpreprocessor.h" +#include class LLMutex; @@ -94,6 +95,11 @@ public: bool operator<(const LLUUID &rhs) const; bool operator>(const LLUUID &rhs) const; + template + friend H AbslHashValue(H h, const LLUUID& id) { + return H::combine_contiguous(std::move(h), id.mData, UUID_BYTES); + } + // xor functions. Useful since any two random uuids xored together // will yield a determinate third random unique id that can be // used as a key in a single uuid that represents 2. @@ -294,24 +300,22 @@ typedef std::set uuid_list_t; namespace std { template <> struct hash -{ - public: + { size_t operator()(const LLUUID & id) const { - return id.hash(); + return absl::Hash{}(id); } }; } namespace boost { - template<> class hash -{ - public: - size_t operator()(const LLUUID& id) const + template<> struct hash { - return id.hash(); - } -}; + size_t operator()(const LLUUID& id) const + { + return absl::Hash{}(id); + } + }; } /* diff --git a/indra/llimage/CMakeLists.txt b/indra/llimage/CMakeLists.txt index e05eebc32..fb4188032 100644 --- a/indra/llimage/CMakeLists.txt +++ b/indra/llimage/CMakeLists.txt @@ -57,6 +57,8 @@ add_library (llimage ${llimage_SOURCE_FILES}) target_link_libraries( llimage + PUBLIC + llcommon ${JPEG_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} diff --git a/indra/llimagej2coj/CMakeLists.txt b/indra/llimagej2coj/CMakeLists.txt index af7d35601..2d2a5c86f 100644 --- a/indra/llimagej2coj/CMakeLists.txt +++ b/indra/llimagej2coj/CMakeLists.txt @@ -44,6 +44,8 @@ add_library (llimagej2coj ${llimagej2coj_SOURCE_FILES}) target_link_libraries( llimagej2coj + PUBLIC + llcommon ${OPENJPEG_LIBRARIES} ) diff --git a/indra/llinventory/CMakeLists.txt b/indra/llinventory/CMakeLists.txt index e0659895e..e9586d500 100644 --- a/indra/llinventory/CMakeLists.txt +++ b/indra/llinventory/CMakeLists.txt @@ -69,3 +69,9 @@ set_source_files_properties(${llinventory_HEADER_FILES} list(APPEND llinventory_SOURCE_FILES ${llinventory_HEADER_FILES}) add_library (llinventory ${llinventory_SOURCE_FILES}) + +target_link_libraries( + llinventory + PUBLIC + llcommon + ) diff --git a/indra/llmath/CMakeLists.txt b/indra/llmath/CMakeLists.txt index 29bc58b33..e91d08a11 100644 --- a/indra/llmath/CMakeLists.txt +++ b/indra/llmath/CMakeLists.txt @@ -102,3 +102,9 @@ set_source_files_properties(${llmath_HEADER_FILES} list(APPEND llmath_SOURCE_FILES ${llmath_HEADER_FILES}) add_library (llmath ${llmath_SOURCE_FILES}) + +target_link_libraries( + llmath + PUBLIC + llcommon + ) diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt index 84308e2ba..c131b436c 100644 --- a/indra/llmessage/CMakeLists.txt +++ b/indra/llmessage/CMakeLists.txt @@ -219,6 +219,8 @@ add_library (llmessage ${llmessage_SOURCE_FILES}) target_link_libraries( llmessage + PUBLIC + llcommon ${CURL_LIBRARIES} ${CARES_LIBRARIES} ${CRYPTO_LIBRARIES} diff --git a/indra/llplugin/CMakeLists.txt b/indra/llplugin/CMakeLists.txt index 3c76f7a50..3a903080e 100644 --- a/indra/llplugin/CMakeLists.txt +++ b/indra/llplugin/CMakeLists.txt @@ -58,8 +58,14 @@ list(APPEND llplugin_SOURCE_FILES ${llplugin_HEADER_FILES}) add_library (llplugin ${llplugin_SOURCE_FILES}) if(LINUX AND STANDALONE) - target_link_libraries (llplugin rt dl) -endif(LINUX AND STANDALONE) + target_link_libraries (llplugin llcommon rt dl) +else() + target_link_libraries( + llplugin + PUBLIC + llcommon + ) +endif() add_subdirectory(slplugin) diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt index f2596a1a6..93a125ea1 100644 --- a/indra/llplugin/slplugin/CMakeLists.txt +++ b/indra/llplugin/slplugin/CMakeLists.txt @@ -1,6 +1,7 @@ project(SLPlugin) include(00-Common) +include(Linking) include(LLCommon) include(LLPlugin) include(Linking) diff --git a/indra/llprimitive/CMakeLists.txt b/indra/llprimitive/CMakeLists.txt index b688e746e..33f51a6f0 100644 --- a/indra/llprimitive/CMakeLists.txt +++ b/indra/llprimitive/CMakeLists.txt @@ -71,3 +71,9 @@ set_source_files_properties(${llprimitive_HEADER_FILES} list(APPEND llprimitive_SOURCE_FILES ${llprimitive_HEADER_FILES}) add_library (llprimitive ${llprimitive_SOURCE_FILES}) + +target_link_libraries( + llprimitive + PUBLIC + llcommon + ) diff --git a/indra/llrender/CMakeLists.txt b/indra/llrender/CMakeLists.txt index 57283e9fe..029afac30 100644 --- a/indra/llrender/CMakeLists.txt +++ b/indra/llrender/CMakeLists.txt @@ -84,3 +84,9 @@ endif (DARWIN) list(APPEND llrender_SOURCE_FILES ${llrender_HEADER_FILES}) add_library (llrender ${llrender_SOURCE_FILES}) + +target_link_libraries( + llrender + PUBLIC + llcommon + ) diff --git a/indra/llvfs/CMakeLists.txt b/indra/llvfs/CMakeLists.txt index 326f6671c..aa60e08dd 100644 --- a/indra/llvfs/CMakeLists.txt +++ b/indra/llvfs/CMakeLists.txt @@ -62,6 +62,8 @@ list(APPEND llvfs_SOURCE_FILES ${llvfs_HEADER_FILES}) add_library (llvfs ${llvfs_SOURCE_FILES}) target_link_libraries(llvfs + PUBLIC + llcommon ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ) diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index 2a9396526..73a7aa59b 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -148,4 +148,4 @@ endif (llwindow_HEADER_FILES) ${viewer_SOURCE_FILES} ) -target_link_libraries (llwindow ${llwindow_LINK_LIBRARIES}) +target_link_libraries (llwindow PUBLIC llcommon ${llwindow_LINK_LIBRARIES}) diff --git a/indra/llxml/CMakeLists.txt b/indra/llxml/CMakeLists.txt index 2245255cd..576fb0ffe 100644 --- a/indra/llxml/CMakeLists.txt +++ b/indra/llxml/CMakeLists.txt @@ -40,5 +40,7 @@ add_library (llxml ${llxml_SOURCE_FILES}) target_link_libraries( llxml + PUBLIC + llcommon ${EXPAT_LIBRARIES} ) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index b79c74c01..bebccf1e2 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -3,6 +3,10 @@ project(viewer) include(00-Common) +# DON'T move Linking.cmake to its place in the alphabetized list below: it +# sets variables on which the 3p .cmake files depend. +include(Linking) + include(Boost) include(BuildPackagesInfo) include(BuildVersion) @@ -31,7 +35,6 @@ include(LLUI) include(LLVFS) include(LLWindow) include(LLXML) -include(Linking) include(NDOF) include(NVAPI) include(OPENAL) @@ -1680,6 +1683,8 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${HUNSPELL_LIBRARY} ${LLPHYSICSEXTENSIONS_LIBRARIES} ${LLAPPEARANCE_LIBRARIES} + absl::flat_hash_map + absl::node_hash_map ) if (LINUX) diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 5c9b7c1d9..ebd2376ed 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -120,6 +120,7 @@ void LLViewerTextureList::doPreloadImages() llassert_always(mInitialized) ; llassert_always(mImageList.empty()) ; llassert_always(mUUIDMap.empty()) ; + llassert_always(mUUIDDict.empty()); // Set the "missing asset" image LLViewerFetchedTexture::sMissingAssetImagep = LLViewerTextureManager::getFetchedTextureFromFile("missing_asset.tga", FTT_LOCAL_FILE, MIPMAP_NO, LLViewerFetchedTexture::BOOST_UI); @@ -692,8 +693,12 @@ void LLViewerTextureList::addImage(LLViewerFetchedTexture *new_image) sNumImages++; addImageToList(new_image); - mUUIDMap.emplace(image_id, new_image); - mUUIDDict.emplace(image_id, new_image); + auto ret_pair = mUUIDMap.emplace(image_id, new_image); + if (!ret_pair.second) + { + ret_pair.first->second = new_image; + } + mUUIDDict.insert_or_assign(image_id, new_image); } diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h index e69b9ddbc..240a86050 100644 --- a/indra/newview/llviewertexturelist.h +++ b/indra/newview/llviewertexturelist.h @@ -37,6 +37,8 @@ #include #include +#include "absl/container/flat_hash_map.h" + const U32 LL_IMAGE_REZ_LOSSLESS_CUTOFF = 128; const BOOL MIPMAP_YES = TRUE; @@ -188,8 +190,8 @@ public: private: typedef std::map< LLUUID, LLPointer > uuid_map_t; uuid_map_t mUUIDMap; - typedef std::unordered_map< LLUUID, LLPointer* > uuid_dict_t; - uuid_map_t mUUIDDict; + typedef absl::flat_hash_map< LLUUID, LLViewerFetchedTexture* > uuid_dict_t; + uuid_dict_t mUUIDDict; LLUUID mLastUpdateUUID; LLUUID mLastFetchUUID; diff --git a/indra/newview/statemachine/CMakeLists.txt b/indra/newview/statemachine/CMakeLists.txt index 887298030..81078eb78 100644 --- a/indra/newview/statemachine/CMakeLists.txt +++ b/indra/newview/statemachine/CMakeLists.txt @@ -56,3 +56,9 @@ set_source_files_properties(${statemachine_HEADER_FILES} list(APPEND statemachine_SOURCE_FILES ${statemachine_HEADER_FILES}) add_library (statemachine ${statemachine_SOURCE_FILES}) + +target_link_libraries( + statemachine + PUBLIC + llcommon + ) diff --git a/indra/plugins/base_basic/CMakeLists.txt b/indra/plugins/base_basic/CMakeLists.txt index 7c941af4f..33ddced66 100644 --- a/indra/plugins/base_basic/CMakeLists.txt +++ b/indra/plugins/base_basic/CMakeLists.txt @@ -41,3 +41,8 @@ list(APPEND basic_plugin_base_SOURCE_FILES ${basic_plugin_base_HEADER_FILES}) add_library(basic_plugin_base ${basic_plugin_base_SOURCE_FILES} ) + +target_link_libraries(basic_plugin_base + PUBLIC + llcommon +) diff --git a/indra/plugins/base_media/CMakeLists.txt b/indra/plugins/base_media/CMakeLists.txt index 504b6c932..3e5c05b8e 100644 --- a/indra/plugins/base_media/CMakeLists.txt +++ b/indra/plugins/base_media/CMakeLists.txt @@ -57,5 +57,7 @@ add_library(media_plugin_base ) target_link_libraries(media_plugin_base + PUBLIC + llcommon ${BASIC_PLUGIN_BASE_LIBRARIES} )