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/test/CMakeLists.txt | 38 ++++++++++++-------------------------- 1 file changed, 12 insertions(+), 26 deletions(-) (limited to 'indra/test') diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index 084aa8d9f7..1e9fdfa003 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -5,11 +5,6 @@ project (lltest) include(00-Common) include(LLCommon) include(LLCoreHttp) -include(LLInventory) -include(LLMath) -include(LLMessage) -include(LLFileSystem) -include(LLXML) include(Linking) include(Tut) include(LLAddBuildTest) @@ -88,27 +83,18 @@ if (USE_BUGSPLAT) endif (USE_BUGSPLAT) target_link_libraries(lltest - ${LEGACY_STDIO_LIBS} - ${LLDATABASE_LIBRARIES} - ${LLINVENTORY_LIBRARIES} - ${LLMESSAGE_LIBRARIES} - ${LLMATH_LIBRARIES} - ${LLFILESYSTEM_LIBRARIES} - ${LLXML_LIBRARIES} - ${LSCRIPT_LIBRARIES} - ${LLCOMMON_LIBRARIES} - ${LLCOREHTTP_LIBRARIES} - ${EXPAT_LIBRARIES} - ${GOOGLEMOCK_LIBRARIES} - ${PTHREAD_LIBRARY} - ${WINDOWS_LIBRARIES} - ${BOOST_PROGRAM_OPTIONS_LIBRARY} - ${BOOST_REGEX_LIBRARY} - ${BOOST_FIBER_LIBRARY} - ${BOOST_CONTEXT_LIBRARY} - ${BOOST_SYSTEM_LIBRARY} - ${DL_LIBRARY} - ) + ${LEGACY_STDIO_LIBS} + ${LLDATABASE_LIBRARIES} + llinventory + llmessage + llmath + llfilesystem + llxml + llcommon + llcorehttp + ${WINDOWS_LIBRARIES} + ${DL_LIBRARY} + ) if (WINDOWS) set_target_properties(lltest -- cgit v1.2.3 From bed0b80374c3acfc584587a9b0bc02f8bf899876 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 20:23:54 +0200 Subject: Remove obsolete include directives --- indra/test/CMakeLists.txt | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'indra/test') diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index 1e9fdfa003..b607980bae 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -11,24 +11,6 @@ include(LLAddBuildTest) include(bugsplat) include(GoogleMock) -include_directories( - ${LLCOMMON_INCLUDE_DIRS} - ${LLCOREHTTP_INCLUDE_DIRS} - ${LLDATABASE_INCLUDE_DIRS} - ${LLMATH_INCLUDE_DIRS} - ${LLMESSAGE_INCLUDE_DIRS} - ${LLINVENTORY_INCLUDE_DIRS} - ${LLFILESYSTEM_INCLUDE_DIRS} - ${LLXML_INCLUDE_DIRS} - ${LSCRIPT_INCLUDE_DIRS} - ${GOOGLEMOCK_INCLUDE_DIRS} - ${TUT_INCLUDE_DIR} - ) -include_directories(SYSTEM - ${LLCOMMON_SYSTEM_INCLUDE_DIRS} - ${LLXML_SYSTEM_INCLUDE_DIRS} - ) - set(test_SOURCE_FILES io.cpp llapp_tut.cpp -- cgit v1.2.3 From d1b6a52fefb483ab75ec60e379d37bfd2e6aff90 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 22:38:38 +0200 Subject: Googlemock target --- indra/test/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/test') diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index b607980bae..6d04c3b76b 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -74,6 +74,7 @@ target_link_libraries(lltest llxml llcommon llcorehttp + googlemock::googlemock ${WINDOWS_LIBRARIES} ${DL_LIBRARY} ) -- 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/test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/test') diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index 6d04c3b76b..1c2961a18a 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -74,7 +74,7 @@ target_link_libraries(lltest llxml llcommon llcorehttp - googlemock::googlemock + ll::googlemock ${WINDOWS_LIBRARIES} ${DL_LIBRARY} ) -- 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/test/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/test') diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index 1c2961a18a..822574210f 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -75,8 +75,6 @@ target_link_libraries(lltest llcommon llcorehttp ll::googlemock - ${WINDOWS_LIBRARIES} - ${DL_LIBRARY} ) if (WINDOWS) -- cgit v1.2.3 From b9f94c08977ff76f41a32a2bb9f25883e578eea3 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 15:33:32 +0200 Subject: Now there is a oslibrary target get rid of some more obsolete vars: LEGACY_STDIO_LIBS (was only used for Windows) PTHREAD_LIBRARY (only Linux) LLDATABASE_LIBRARIES (that one was supposed for Linux, but never needed anyway) --- indra/test/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/test') diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index 822574210f..23f80d1ef9 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -65,8 +65,6 @@ if (USE_BUGSPLAT) endif (USE_BUGSPLAT) target_link_libraries(lltest - ${LEGACY_STDIO_LIBS} - ${LLDATABASE_LIBRARIES} llinventory llmessage llmath -- cgit v1.2.3 From 3ac18ad9932b4e2fda8e850bd18a524fb1593520 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 22:08:40 +0200 Subject: Streamline bugsplat target: - Fix usage of bugsplat::bugsplat by using ll::bugsplat - Use bugsplat define by importing target not by using hand crafted magic --- indra/test/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) (limited to 'indra/test') diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index 23f80d1ef9..aae299e6ca 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -60,10 +60,6 @@ list(APPEND test_SOURCE_FILES ${test_HEADER_FILES}) add_executable(lltest ${test_SOURCE_FILES}) -if (USE_BUGSPLAT) - set_target_properties(lltest PROPERTIES COMPILE_DEFINITIONS "${BUGSPLAT_DEFINE}") -endif (USE_BUGSPLAT) - target_link_libraries(lltest llinventory llmessage -- 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/test/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/test') diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index aae299e6ca..2f033616a7 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -53,9 +53,6 @@ if (NOT WINDOWS) ) endif (NOT WINDOWS) -set_source_files_properties(${test_HEADER_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) - list(APPEND test_SOURCE_FILES ${test_HEADER_FILES}) add_executable(lltest ${test_SOURCE_FILES}) -- cgit v1.2.3 From 15d37713b9113a6f70dde48c764df02c76e18cbc Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 22 Aug 2022 21:00:42 -0400 Subject: DRTVWR-558: Fix builds on macOS 12.5 Monterey. Always search for python3[.exe] instead of plain 'python'. macOS Monterey no longer bundles Python 2 at all. Explicitly make PYTHON_EXECUTABLE a cached value so if the user edits it in CMakeCache.txt, it won't be overwritten by indra/cmake/Python.cmake. Do NOT set DYLD_LIBRARY_PATH for test executables! That has Bad Effects, as discussed in https://stackoverflow.com/q/73418423/5533635. Instead, create symlinks from build-mumble/sharedlibs/Resources -> Release/Resources and from build-mumble/test/Resources -> ../sharedlibs/Release/Resources. For test executables in sharedlibs/RelWithDebInfo and test/RelWithDebInfo, this supports our dylibs' baked-in load path @executable_path/../Resources. That load path assumes running in a standard app bundle (which the viewer in fact does), but we've been avoiding creating an app bundle for every test program. These symlinks allow us to continue doing that while avoiding DYLD_LIBRARY_PATH. Add indra/llcommon/apply.h. The LL::apply() function and its wrapper macro VAPPLY were very useful in diagnosing the problem. Tweak llleap_test.cpp. This source was modified extensively for diagnostic purposes; these are the small improvements that remain. --- indra/test/CMakeLists.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'indra/test') diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index 084aa8d9f7..161e957784 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -116,14 +116,21 @@ if (WINDOWS) LINK_FLAGS "/NODEFAULTLIB:LIBCMT" LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\"" ) +elseif (DARWIN) + # Support our "@executable_path/../Resources" load path for our test + # executable. This SHOULD properly be "$/Resources", + # but the CMake $ generator expression isn't evaluated by + # CREATE_LINK, so fudge it. + file(CREATE_LINK "../sharedlibs/Release/Resources" "${CMAKE_BINARY_DIR}/test/Resources" + SYMBOLIC) endif (WINDOWS) set(TEST_EXE $) -SET_TEST_PATH(DYLD_LIBRARY_PATH) +SET_TEST_PATH(LD_LIBRARY_PATH) LL_TEST_COMMAND(command - "${DYLD_LIBRARY_PATH}" + "${LD_LIBRARY_PATH}" "${TEST_EXE}" "--output=${CMAKE_CURRENT_BINARY_DIR}/cpp_test_results.txt" "--touch=${CMAKE_CURRENT_BINARY_DIR}/cpp_tests_ok.txt") -- 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/test/lldoubledispatch_tut.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'indra/test') diff --git a/indra/test/lldoubledispatch_tut.cpp b/indra/test/lldoubledispatch_tut.cpp index ad8f6454d4..dbf55e666f 100644 --- a/indra/test/lldoubledispatch_tut.cpp +++ b/indra/test/lldoubledispatch_tut.cpp @@ -35,8 +35,9 @@ #include "lldoubledispatch.h" // STL headers // std headers -#include #include +#include +#include #include // external library headers // other Linden headers @@ -135,10 +136,10 @@ namespace tut // Instantiate a few GameObjects. Make sure we refer to them // polymorphically, and don't let them leak. - std::auto_ptr home; - std::auto_ptr obstacle; - std::auto_ptr tug; - std::auto_ptr patrol; + std::unique_ptr home; + std::unique_ptr obstacle; + std::unique_ptr tug; + std::unique_ptr patrol; // prototype objects Asteroid dummyAsteroid; -- cgit v1.2.3 From 675cfedb8af74c14ce30759f1d6193f954b88f7b Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 1 Sep 2022 12:27:08 -0400 Subject: DRTVWR-568: Ensure parent directory exists before CREATE_LINK. --- indra/test/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/test') diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index 161e957784..9e65ceb926 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -121,6 +121,8 @@ elseif (DARWIN) # executable. This SHOULD properly be "$/Resources", # but the CMake $ generator expression isn't evaluated by # CREATE_LINK, so fudge it. + # Make sure the symlink's parent directory exists... + file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/test") file(CREATE_LINK "../sharedlibs/Release/Resources" "${CMAKE_BINARY_DIR}/test/Resources" SYMBOLIC) endif (WINDOWS) -- cgit v1.2.3 From e840b5eb40edbac8e72054256112deeaf5c580c2 Mon Sep 17 00:00:00 2001 From: Nicky Dasmijn Date: Sat, 17 Sep 2022 17:37:45 +0200 Subject: MacOs packaging is weird, as Nat already did point out :( Part of his change was omly taking Release builds into account, the other part from me made the same mistake. Use a generator expression with a custom command to get the symlink the way we want. --- indra/test/CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'indra/test') diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index c913e4031f..48c15155a6 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -74,15 +74,6 @@ if (WINDOWS) LINK_FLAGS "/NODEFAULTLIB:LIBCMT" LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\"" ) -elseif (DARWIN) - # Support our "@executable_path/../Resources" load path for our test - # executable. This SHOULD properly be "$/Resources", - # but the CMake $ generator expression isn't evaluated by - # CREATE_LINK, so fudge it. - # Make sure the symlink's parent directory exists... - file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/test") - file(CREATE_LINK "../sharedlibs/Release/Resources" "${CMAKE_BINARY_DIR}/test/Resources" - SYMBOLIC) endif (WINDOWS) set(TEST_EXE $) @@ -111,4 +102,13 @@ set(test_results ${CMAKE_CURRENT_BINARY_DIR}/cpp_tests_ok.txt) # developers choose to disable LL_TESTS. if (LL_TESTS) add_custom_target(tests_ok ALL DEPENDS ${test_results}) + if(DARWIN) + # Support our "@executable_path/../Resources" load path for our test + # executable. This SHOULD properly be "$/Resources", + # but the CMake $ generator expression isn't evaluated by + # CREATE_LINK, so fudge it. + add_custom_command( TARGET tests_ok PRE_BUILD + COMMAND cmake -E create_symlink ${SHARED_LIB_STAGING_DIR} ${CMAKE_BINARY_DIR}/test/Resource + ) + endif() endif (LL_TESTS) -- cgit v1.2.3 From c47b2ae7458f88941e4a129b0bc9aa96ab4ae003 Mon Sep 17 00:00:00 2001 From: Nicky Dasmijn Date: Sat, 17 Sep 2022 17:58:08 +0200 Subject: We probably want this (have to guess as I cannot run the tests). --- indra/test/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/test') diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index 48c15155a6..b7a39a7450 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -107,8 +107,8 @@ if (LL_TESTS) # executable. This SHOULD properly be "$/Resources", # but the CMake $ generator expression isn't evaluated by # CREATE_LINK, so fudge it. - add_custom_command( TARGET tests_ok PRE_BUILD - COMMAND cmake -E create_symlink ${SHARED_LIB_STAGING_DIR} ${CMAKE_BINARY_DIR}/test/Resource + add_custom_command( TARGET lltest POST_BUILD + COMMAND cmake -E create_symlink ${SHARED_LIB_STAGING_DIR} ${CMAKE_BINARY_DIR}/test/Resources ) endif() endif (LL_TESTS) -- cgit v1.2.3