diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2022-08-22 21:00:42 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2022-08-22 21:00:42 -0400 |
commit | 15d37713b9113a6f70dde48c764df02c76e18cbc (patch) | |
tree | 022e150c503fa4f63d47374b89cd13d8446cb566 /indra/cmake | |
parent | c0f709b637d800fe07fb265c8ab6f28080994224 (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/cmake')
-rw-r--r-- | indra/cmake/Copy3rdPartyLibs.cmake | 5 | ||||
-rw-r--r-- | indra/cmake/Python.cmake | 17 | ||||
-rwxr-xr-x | indra/cmake/run_build_test.py | 2 |
3 files changed, 15 insertions, 9 deletions
diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index ff705101de..c2e1bb4b85 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -151,6 +151,11 @@ elseif(DARWIN) set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug/Resources") set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/Resources") set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}/Release/Resources") + # Support our "@executable_path/../Resources" load path for executables + # that end up in any of the above SHARED_LIB_STAGING_DIR_MUMBLE + # directories. + file(CREATE_LINK "Release/Resources" "${SHARED_LIB_STAGING_DIR}/Resources" + SYMBOLIC) set(vivox_lib_dir "${ARCH_PREBUILT_DIRS_RELEASE}") set(slvoice_files SLVoice) diff --git a/indra/cmake/Python.cmake b/indra/cmake/Python.cmake index ed595f6966..5be3cbdf11 100644 --- a/indra/cmake/Python.cmake +++ b/indra/cmake/Python.cmake @@ -5,8 +5,8 @@ set(PYTHONINTERP_FOUND) if (WINDOWS) # On Windows, explicitly avoid Cygwin Python. - find_program(PYTHON_EXECUTABLE - NAMES python.exe + find_program(python + NAMES python3.exe python.exe NO_DEFAULT_PATH # added so that cmake does not find cygwin python PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.7\\InstallPath] @@ -18,19 +18,20 @@ if (WINDOWS) [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.8\\InstallPath] [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.9\\InstallPath] [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.10\\InstallPath] - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.11\\InstallPath] + [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.11\\InstallPath] ) include(FindPythonInterp) else() - find_program(PYTHON_EXECUTABLE python3) + find_program(python python3) - if (PYTHON_EXECUTABLE) + if (python) set(PYTHONINTERP_FOUND ON) - endif (PYTHON_EXECUTABLE) + endif (python) endif (WINDOWS) -if (NOT PYTHON_EXECUTABLE) +if (NOT python) message(FATAL_ERROR "No Python interpreter found") -endif (NOT PYTHON_EXECUTABLE) +endif (NOT python) +set(PYTHON_EXECUTABLE "${python}" CACHE FILEPATH "Python interpreter for builds") mark_as_advanced(PYTHON_EXECUTABLE) diff --git a/indra/cmake/run_build_test.py b/indra/cmake/run_build_test.py index 1e92868ae7..1f040bded5 100755 --- a/indra/cmake/run_build_test.py +++ b/indra/cmake/run_build_test.py @@ -73,7 +73,7 @@ def main(command, arguments=[], libpath=[], vars={}): if sys.platform == "win32": lpvars = ["PATH"] elif sys.platform == "darwin": - lpvars = ["LD_LIBRARY_PATH", "DYLD_LIBRARY_PATH"] + lpvars = ["LD_LIBRARY_PATH"] # , "DYLD_LIBRARY_PATH"] elif sys.platform.startswith("linux"): lpvars = ["LD_LIBRARY_PATH"] else: |