From 786b291d9c6b784c7ce6ceef0e38a4ec76ea14db Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 16:32:52 +0200 Subject: Move CMake files to modernized cmake syntax, step 1. Change projects to cmake targetsto get rid of havig to hardcore include directories and link libraries in consumer projects. --- indra/llui/CMakeLists.txt | 59 ++++++++++++++--------------------------------- 1 file changed, 17 insertions(+), 42 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index d96824bbf8..04103b1a94 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -6,33 +6,9 @@ include(00-Common) include(Hunspell) include(LLCommon) include(LLImage) -include(LLInventory) -include(LLMath) -include(LLMessage) include(LLCoreHttp) -include(LLRender) include(LLWindow) include(LLCoreHttp) -include(LLFileSystem) -include(LLXML) - -include_directories( - ${LLCOMMON_INCLUDE_DIRS} - ${LLCOREHTTP_INCLUDE_DIRS} - ${LLIMAGE_INCLUDE_DIRS} - ${LLINVENTORY_INCLUDE_DIRS} - ${LLMATH_INCLUDE_DIRS} - ${LLMESSAGE_INCLUDE_DIRS} - ${LLRENDER_INCLUDE_DIRS} - ${LLWINDOW_INCLUDE_DIRS} - ${LLFILESYSTEM_INCLUDE_DIRS} - ${LLXML_INCLUDE_DIRS} - ${LIBS_PREBUILD_DIR}/include/hunspell - ) -include_directories(SYSTEM - ${LLCOMMON_SYSTEM_INCLUDE_DIRS} - ${LLXML_SYSTEM_INCLUDE_DIRS} - ) set(llui_SOURCE_FILES llaccordionctrl.cpp @@ -276,38 +252,37 @@ set_source_files_properties(llurlentry.cpp list(APPEND llui_SOURCE_FILES ${llui_HEADER_FILES}) add_library (llui ${llui_SOURCE_FILES}) +set_target_include_dirs( llui ${CMAKE_CURRENT_SOURCE_DIR}) # Libraries on which this library depends, needed for Linux builds # Sort by high-level to low-level target_link_libraries(llui - ${LLRENDER_LIBRARIES} - ${LLWINDOW_LIBRARIES} - ${LLIMAGE_LIBRARIES} - ${LLINVENTORY_LIBRARIES} - ${LLMESSAGE_LIBRARIES} - ${LLCOREHTTP_LIBRARIES} - ${LLFILESYSTEM_LIBRARIES} - ${LLXUIXML_LIBRARIES} - ${LLXML_LIBRARIES} - ${LLMATH_LIBRARIES} - ${HUNSPELL_LIBRARY} - ${LLMESSAGE_LIBRARIES} - ${LLCOMMON_LIBRARIES} # must be after llimage, llwindow, llrender + llrender + llwindow + llimage + llinventory + llmessage + llcorehttp + llfilesystem + llxml + llmath + hunspell::hunspell + llcommon ) # Add tests if(LL_TESTS) include(LLAddBuildTest) + set(test_libs llmessage llcorehttp llxml llrender llcommon hunspell::hunspell ${WINDOWS_LIBRARIES}) + SET(llui_TEST_SOURCE_FILES llurlmatch.cpp ) + set_property( SOURCE ${llui_TEST_SOURCE_FILES} PROPERTY LL_TEST_ADDITIONAL_LIBRARIES ${test_libs}) LL_ADD_PROJECT_UNIT_TESTS(llui "${llui_TEST_SOURCE_FILES}") # INTEGRATION TESTS - set(test_libs llui llmessage llcorehttp llcommon - ${HUNSPELL_LIBRARY} - ${LLCOMMON_LIBRARIES} - ${BOOST_FIBER_LIBRARY} ${BOOST_CONTEXT_LIBRARY} ${BOOST_SYSTEM_LIBRARY} - ${WINDOWS_LIBRARIES}) + if(NOT LINUX) + set(test_libs llui llmessage llcorehttp llxml llrender llcommon hunspell::hunspell ${WINDOWS_LIBRARIES}) LL_ADD_INTEGRATION_TEST(llurlentry llurlentry.cpp "${test_libs}") endif(NOT LINUX) endif(LL_TESTS) -- cgit v1.2.3 From 241919e7f7986c11586a49bff53cf19c2c0e0ea6 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 13 Apr 2022 19:21:55 +0200 Subject: Rework cmake, the original plan was to maybe be able to use conan targets with the same name (that's why 3ps had names like apr::apr), but it's safer and saner to put the LL 3ps under the ll:: prefix. This also allows means it is possible to get rid of that bad "if( TRAGET ...) return() endif()" pattern and rather use include_guard(). --- indra/llui/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 04103b1a94..9035095d5f 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -265,14 +265,14 @@ target_link_libraries(llui llfilesystem llxml llmath - hunspell::hunspell + ll::hunspell llcommon ) # Add tests if(LL_TESTS) include(LLAddBuildTest) - set(test_libs llmessage llcorehttp llxml llrender llcommon hunspell::hunspell ${WINDOWS_LIBRARIES}) + set(test_libs llmessage llcorehttp llxml llrender llcommon ll::hunspell ${WINDOWS_LIBRARIES}) SET(llui_TEST_SOURCE_FILES llurlmatch.cpp @@ -282,7 +282,7 @@ if(LL_TESTS) # INTEGRATION TESTS if(NOT LINUX) - set(test_libs llui llmessage llcorehttp llxml llrender llcommon hunspell::hunspell ${WINDOWS_LIBRARIES}) + set(test_libs llui llmessage llcorehttp llxml llrender llcommon ll::hunspell ${WINDOWS_LIBRARIES}) LL_ADD_INTEGRATION_TEST(llurlentry llurlentry.cpp "${test_libs}") endif(NOT LINUX) endif(LL_TESTS) -- cgit v1.2.3 From bb85651d987a6cb969de7dd7c2b130411de6203c Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 15:29:02 +0200 Subject: Create a new target ll::oslibrary to link against libs specific to the OS compiled on. This gets rid of the a few OS specific set and uses variables (which some even seemed mostly duplicate like WINDOWS_LIBRARIES ans UI_LIBRARIES) and it also solves the problem of having them to tack on every target, as of no they come as a transitive dependency from llcommon --- indra/llui/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 9035095d5f..5e71b673a5 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -272,7 +272,7 @@ target_link_libraries(llui # Add tests if(LL_TESTS) include(LLAddBuildTest) - set(test_libs llmessage llcorehttp llxml llrender llcommon ll::hunspell ${WINDOWS_LIBRARIES}) + set(test_libs llmessage llcorehttp llxml llrender llcommon ll::hunspell) SET(llui_TEST_SOURCE_FILES llurlmatch.cpp @@ -282,7 +282,7 @@ if(LL_TESTS) # INTEGRATION TESTS if(NOT LINUX) - set(test_libs llui llmessage llcorehttp llxml llrender llcommon ll::hunspell ${WINDOWS_LIBRARIES}) + set(test_libs llui llmessage llcorehttp llxml llrender llcommon ll::hunspell ) LL_ADD_INTEGRATION_TEST(llurlentry llurlentry.cpp "${test_libs}") endif(NOT LINUX) endif(LL_TESTS) -- cgit v1.2.3 From e0cf0cdfd49e5a946dcd202a083fb23f01e4f1fe Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 17 Apr 2022 18:04:57 +0200 Subject: Switch to target_include_directories All 3Ps include dirs are treated as SYSTEM, this will stop compilers stop emitting warnings from those files and greatly helps having high warning levels and not being swamped by warnings that come from external libraries. --- indra/llui/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 5e71b673a5..144923636b 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -252,7 +252,7 @@ set_source_files_properties(llurlentry.cpp list(APPEND llui_SOURCE_FILES ${llui_HEADER_FILES}) add_library (llui ${llui_SOURCE_FILES}) -set_target_include_dirs( llui ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories( llui INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) # Libraries on which this library depends, needed for Linux builds # Sort by high-level to low-level target_link_libraries(llui -- cgit v1.2.3 From 283c2a20cc4ef856076d287303c7143332b201fe Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 1 May 2022 00:38:40 +0200 Subject: Remove setting of HEADER_FILE_ONLY on .h* files, cmake automatically sets the property on those. --- indra/llui/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 144923636b..9108c6143c 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -236,9 +236,6 @@ set(llui_HEADER_FILES llxyvector.h ) -set_source_files_properties(${llui_HEADER_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) - SET(llurlentry_TEST_DEPENDENCIES llurlmatch.cpp llurlregistry.cpp -- cgit v1.2.3 From c08a61453b21664da3687661512e2ea208f90d98 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 5 Jun 2022 16:15:55 +0200 Subject: Port new cmake files (Trace/Meshoptimizer) to modern cmake --- indra/llui/CMakeLists.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index c2c819c80e..9108c6143c 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -280,10 +280,6 @@ if(LL_TESTS) if(NOT LINUX) set(test_libs llui llmessage llcorehttp llxml llrender llcommon ll::hunspell ) - if(WINDOWS) - LL_ADD_INTEGRATION_TEST(llurlentry llurlentry.cpp "imm32;${test_libs}") - else(WINDOWS) - LL_ADD_INTEGRATION_TEST(llurlentry llurlentry.cpp "${test_libs}") - endif(WINDOWS) + LL_ADD_INTEGRATION_TEST(llurlentry llurlentry.cpp "${test_libs}") endif(NOT LINUX) endif(LL_TESTS) -- cgit v1.2.3 From 65612700f389d453d4817fb3f68429a60ea144b8 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 24 Aug 2022 14:00:16 -0400 Subject: DRTVWR-558: Eliminate many spurious set-not-used variables. With Xcode 13.4, these unused variables break Release builds. --- indra/llui/lllayoutstack.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index aac28e04b9..77938edf27 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -395,7 +395,6 @@ void LLLayoutStack::updateLayout() space_to_distribute += panelp ? ll_round((F32)mPanelSpacing * panelp->getVisibleAmount()) : 0; S32 remaining_space = space_to_distribute; - F32 fraction_distributed = 0.f; if (space_to_distribute > 0 && total_visible_fraction > 0.f) { // give space proportionally to visible auto resize panels BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) @@ -404,7 +403,6 @@ void LLLayoutStack::updateLayout() { F32 fraction_to_distribute = (panelp->mFractionalSize * panelp->getAutoResizeFactor()) / (total_visible_fraction); S32 delta = ll_round((F32)space_to_distribute * fraction_to_distribute); - fraction_distributed += fraction_to_distribute; panelp->mTargetDim += delta; remaining_space -= delta; } -- cgit v1.2.3 From 2dc4aec9936186eeaa0867745bb94168f569849b Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 26 Aug 2022 17:21:01 -0400 Subject: DRTVWR-568: Eliminate more blockers to C++17 language standard. --- indra/llui/lldockablefloater.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lldockablefloater.h b/indra/llui/lldockablefloater.h index 89c9852f4a..5d90b3ef4e 100644 --- a/indra/llui/lldockablefloater.h +++ b/indra/llui/lldockablefloater.h @@ -30,6 +30,7 @@ #include "llerror.h" #include "llfloater.h" #include "lldockcontrol.h" +#include /** * Represents floater that can dock. @@ -131,7 +132,7 @@ protected: boost::function mIsDockedStateForcedCallback; private: - std::auto_ptr mDockControl; + std::unique_ptr mDockControl; LLUIImagePtr mDockTongue; static LLHandle sInstanceHandle; /** -- cgit v1.2.3 From d5257abdb1e09de531640313dfffbfd63aeadfd3 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Fri, 2 Dec 2022 00:45:34 +0200 Subject: SL-18734 certain links are not displayed appropriately --- indra/llui/llurlentry.cpp | 1 + indra/llui/llurlregistry.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 1547a4ba5c..6a9070634c 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -206,6 +206,7 @@ bool LLUrlEntryBase::isWikiLinkCorrect(const std::string &labeled_url) const { return (chr == L'\u02D0') // "Modifier Letter Colon" || (chr == L'\uFF1A') // "Fullwidth Colon" + || (chr == L'\u2236') // "Ratio" || (chr == L'\uFE55'); // "Small Colon" }, L'\u003A'); // Colon diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index c9d7013a11..23f3dca3fb 100644 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -169,7 +169,7 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL for (it = mUrlEntry.begin(); it != mUrlEntry.end(); ++it) { //Skip for url entry icon if content is not trusted - if(!is_content_trusted && (mUrlEntryIcon == *it)) + if((mUrlEntryIcon == *it) && ((text.find("Hand") != std::string::npos) || !is_content_trusted)) { continue; } -- cgit v1.2.3 From 6dec98a14ca052a3600556815e6b215eed15e97d Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 24 Jan 2023 21:51:24 +0200 Subject: SL-17425 Crash when having more than one dependent floater #2 --- indra/llui/llfloater.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index d413fab270..2303cd24b7 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -759,11 +759,13 @@ void LLFloater::closeFloater(bool app_quitting) } // now close dependent floater - for(handle_set_iter_t dependent_it = mDependents.begin(); - dependent_it != mDependents.end(); ) + while(mDependents.size() > 0) { + handle_set_iter_t dependent_it = mDependents.begin(); LLFloater* floaterp = dependent_it->get(); - dependent_it = mDependents.erase(dependent_it); + // normally removeDependentFloater will do this, but in + // case floaterp is somehow invalid or orphaned, erase now + mDependents.erase(dependent_it); if (floaterp) { floaterp->mDependeeHandle = LLHandle(); -- cgit v1.2.3