From cf0838cd6917b7dd2c8f056d6cb3ef9f59d92fda Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 2 Nov 2023 09:05:41 -0400 Subject: DRTVWR-589: StringVec's operator<<() overload must precede lltut.h. If not, the resulting error message is so mysterious that it's worth adding an error check to explain how to avoid it. --- indra/llcommon/tests/StringVec.h | 10 ++++++++++ indra/llcommon/tests/lleventfilter_test.cpp | 2 +- indra/llcommon/tests/llleap_test.cpp | 2 +- indra/llcommon/tests/llsdserialize_test.cpp | 2 +- indra/newview/tests/llluamanager_test.cpp | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/tests/StringVec.h b/indra/llcommon/tests/StringVec.h index a380b00a05..761956a012 100644 --- a/indra/llcommon/tests/StringVec.h +++ b/indra/llcommon/tests/StringVec.h @@ -18,6 +18,16 @@ typedef std::vector StringVec; +#if defined(LL_LLTUT_H) +// Modern compilers require us to define operator<<(std::ostream&, StringVec) +// before the definition of the ensure() template that engages it. The error +// stating that the compiler can't find a viable operator<<() is so perplexing +// that even though I've obviously hit it a couple times before, a new +// instance still caused much head-scratching. This warning is intended to +// demystify any inadvertent future recurrence. +#warning "StringVec.h must be #included BEFORE lltut.h for ensure() to work" +#endif + std::ostream& operator<<(std::ostream& out, const StringVec& strings) { out << '('; diff --git a/indra/llcommon/tests/lleventfilter_test.cpp b/indra/llcommon/tests/lleventfilter_test.cpp index fa2cb03e95..ed7cb56506 100644 --- a/indra/llcommon/tests/lleventfilter_test.cpp +++ b/indra/llcommon/tests/lleventfilter_test.cpp @@ -34,10 +34,10 @@ // std headers // external library headers // other Linden headers +#include "listener.h" #include "../test/lltut.h" #include "stringize.h" #include "llsdutil.h" -#include "listener.h" #include "tests/wrapllerrs.h" #include diff --git a/indra/llcommon/tests/llleap_test.cpp b/indra/llcommon/tests/llleap_test.cpp index 7197dedfbf..6fe9e3446f 100644 --- a/indra/llcommon/tests/llleap_test.cpp +++ b/indra/llcommon/tests/llleap_test.cpp @@ -18,6 +18,7 @@ #include // external library headers // other Linden headers +#include "StringVec.h" #include "../test/lltut.h" #include "../test/namedtempfile.h" #include "../test/catch_and_store_what_in.h" @@ -26,7 +27,6 @@ #include "llprocess.h" #include "llstring.h" #include "stringize.h" -#include "StringVec.h" #if defined(LL_WINDOWS) #define sleep(secs) _sleep((secs) * 1000) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index ae3a94c55d..730731a927 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -53,10 +53,10 @@ typedef U32 uint32_t; #include "llmemorystream.h" #include "hexdump.h" +#include "StringVec.h" #include "../test/lltut.h" #include "../test/namedtempfile.h" #include "stringize.h" -#include "StringVec.h" #include typedef std::function FormatterFunction; diff --git a/indra/newview/tests/llluamanager_test.cpp b/indra/newview/tests/llluamanager_test.cpp index 6433ff1118..98a2726af7 100644 --- a/indra/newview/tests/llluamanager_test.cpp +++ b/indra/newview/tests/llluamanager_test.cpp @@ -18,6 +18,7 @@ #include // external library headers // other Linden headers +#include "../llcommon/tests/StringVec.h" #include "../test/lltut.h" #include "llapp.h" #include "lldate.h" @@ -27,7 +28,6 @@ #include "lluri.h" #include "lluuid.h" #include "stringize.h" -#include "../llcommon/tests/StringVec.h" class LLTestApp : public LLApp { -- cgit v1.2.3 From bb51ead8815d6f1843bed3f16dfae94aa0e85950 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 2 Nov 2023 09:08:25 -0400 Subject: DRTVWR-589: Switch to the lua package built by new 3p-lua repo. Also ditch crufty CMake logic related to lleventhost, which we haven't used for years. --- indra/cmake/Lualibs.cmake | 13 ++++++++++--- indra/llcommon/CMakeLists.txt | 1 - indra/newview/CMakeLists.txt | 20 ++------------------ 3 files changed, 12 insertions(+), 22 deletions(-) (limited to 'indra') diff --git a/indra/cmake/Lualibs.cmake b/indra/cmake/Lualibs.cmake index ec40d0f41c..e7d5875198 100644 --- a/indra/cmake/Lualibs.cmake +++ b/indra/cmake/Lualibs.cmake @@ -8,8 +8,15 @@ add_library( ll::lualibs INTERFACE IMPORTED ) use_system_binary( lualibs ) -use_prebuilt_binary(lualibs) +use_prebuilt_binary(lua) -target_link_libraries(ll::lualibs INTERFACE ${lualibs}) +target_include_directories( ll::lualibs SYSTEM INTERFACE + ${LIBS_PREBUILT_DIR}/include +) -target_include_directories( ll::lualibs SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/lualibs) +if (WINDOWS) + target_link_libraries(ll::lualibs INTERFACE lua54.dll) +elseif (DARWIN) + target_link_libraries(ll::lualibs INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/liblua.a) +elseif (LINUX) +endif (WINDOWS) diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 5dd4321330..ef4899978e 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -13,7 +13,6 @@ include(Copy3rdPartyLibs) include(ZLIBNG) include(URIPARSER) include(Tracy) -include(lualibs) set(llcommon_SOURCE_FILES diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 6fc0f28a89..aa723c62cd 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1804,20 +1804,6 @@ if (WINDOWS) endif (NOT UNATTENDED) if (PACKAGE) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.bz2 - COMMAND ${PYTHON_EXECUTABLE} - ARGS - ${CMAKE_CURRENT_SOURCE_DIR}/event_host_manifest.py - ${CMAKE_CURRENT_SOURCE_DIR}/.. - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CFG_INTDIR} - DEPENDS - lleventhost - ${EVENT_HOST_SCRIPTS} - ${CMAKE_CURRENT_SOURCE_DIR}/event_host_manifest.py - ) - add_custom_command( OUTPUT ${CMAKE_CFG_INTDIR}/touched.bat COMMAND ${PYTHON_EXECUTABLE} @@ -1847,9 +1833,6 @@ if (WINDOWS) add_custom_target(llpackage ALL DEPENDS ${CMAKE_CFG_INTDIR}/touched.bat ) - # temporarily disable packaging of event_host until hg subrepos get - # sorted out on the parabuild cluster... - #${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.bz2) endif (PACKAGE) elseif (DARWIN) @@ -1917,6 +1900,7 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${LLPHYSICSEXTENSIONS_LIBRARIES} ll::bugsplat ll::tracy + ll::lualibs ) if( TARGET ll::intel_memops ) @@ -2287,7 +2271,7 @@ if (LL_TESTS) LL_ADD_INTEGRATION_TEST(llluamanager "llluamanager.cpp" - "${test_libs}" + "${test_libs};ll::lualibs" ) LL_ADD_INTEGRATION_TEST(llsechandler_basic -- cgit v1.2.3 From f80ede0a752447d81086f672001a562e4492553f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 2 Nov 2023 17:46:04 -0400 Subject: DRTVWR-589: Update Lualibs.cmake to use lua54.lib from 3p-lua. Also remove #pragma comment(lib, "liblua54.a") from relevant source files. --- indra/cmake/Lualibs.cmake | 2 +- indra/newview/llfloaterluadebug.cpp | 4 ---- indra/newview/llluamanager.cpp | 4 ---- 3 files changed, 1 insertion(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/cmake/Lualibs.cmake b/indra/cmake/Lualibs.cmake index e7d5875198..b6a7de41c6 100644 --- a/indra/cmake/Lualibs.cmake +++ b/indra/cmake/Lualibs.cmake @@ -15,7 +15,7 @@ target_include_directories( ll::lualibs SYSTEM INTERFACE ) if (WINDOWS) - target_link_libraries(ll::lualibs INTERFACE lua54.dll) + target_link_libraries(ll::lualibs INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/lua54.lib) elseif (DARWIN) target_link_libraries(ll::lualibs INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/liblua.a) elseif (LINUX) diff --git a/indra/newview/llfloaterluadebug.cpp b/indra/newview/llfloaterluadebug.cpp index 44454d7be0..32e9e4f1b7 100644 --- a/indra/newview/llfloaterluadebug.cpp +++ b/indra/newview/llfloaterluadebug.cpp @@ -38,10 +38,6 @@ #include "llluamanager.h" -#if LL_WINDOWS -#pragma comment(lib, "liblua54.a") -#endif - LLFloaterLUADebug::LLFloaterLUADebug(const LLSD &key) : LLFloater(key) diff --git a/indra/newview/llluamanager.cpp b/indra/newview/llluamanager.cpp index 0475122832..abef3ce368 100644 --- a/indra/newview/llluamanager.cpp +++ b/indra/newview/llluamanager.cpp @@ -80,10 +80,6 @@ extern "C" #include #include -#if LL_WINDOWS -#pragma comment(lib, "liblua54.a") -#endif - std::string lua_tostdstring(lua_State* L, int index); void lua_pushstdstring(lua_State* L, const std::string& str); LLSD lua_tollsd(lua_State* L, int index); -- cgit v1.2.3 From 0a731cd765cb05820e5e08956ba66cc85e987d3c Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 9 Nov 2023 13:39:03 +0200 Subject: DRTVWR-589 - don't prevent mangling names as we use C++ lib --- indra/newview/llluamanager.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llluamanager.cpp b/indra/newview/llluamanager.cpp index abef3ce368..2bdf4fd0b0 100644 --- a/indra/newview/llluamanager.cpp +++ b/indra/newview/llluamanager.cpp @@ -64,12 +64,9 @@ extern LLUIListener sUIListener; #include -extern "C" -{ #include "lua/lua.h" #include "lua/lauxlib.h" #include "lua/lualib.h" -} #include #include // std::rand() -- cgit v1.2.3