summaryrefslogtreecommitdiff
path: root/indra/test
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2022-08-22 21:00:42 -0400
committerNat Goodspeed <nat@lindenlab.com>2022-08-22 21:00:42 -0400
commit15d37713b9113a6f70dde48c764df02c76e18cbc (patch)
tree022e150c503fa4f63d47374b89cd13d8446cb566 /indra/test
parentc0f709b637d800fe07fb265c8ab6f28080994224 (diff)
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.
Diffstat (limited to 'indra/test')
-rw-r--r--indra/test/CMakeLists.txt11
1 files changed, 9 insertions, 2 deletions
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 "$<TARGET_FILE_DIR:lltest>/Resources",
+ # but the CMake $<TARGET_FILE_DIR> 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 $<TARGET_FILE:lltest>)
-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")