summaryrefslogtreecommitdiff
path: root/indra/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'indra/cmake')
-rw-r--r--indra/cmake/00-Common.cmake8
-rw-r--r--indra/cmake/Copy3rdPartyLibs.cmake11
-rw-r--r--indra/cmake/DBusGlib.cmake15
-rw-r--r--indra/cmake/Python.cmake51
-rwxr-xr-xindra/cmake/run_build_test.py2
5 files changed, 55 insertions, 32 deletions
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index 279e7ca1b9..a144973a16 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -164,13 +164,7 @@ if (DARWIN)
# see Variables.cmake.
string(REPLACE "-gdwarf-2" "-g${CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT}"
CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- # The viewer code base can now be successfully compiled with -std=c++14. But
- # turning that on in the generic viewer-build-variables/variables file would
- # potentially require tweaking each of our ~50 third-party library builds.
- # Until we decide to set -std=c++14 in viewer-build-variables/variables, set
- # it locally here: we want to at least prevent inadvertently reintroducing
- # viewer code that would fail with C++14.
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags} -std=c++14")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DARWIN_extra_cstar_flags}")
# NOTE: it's critical that the optimization flag is put in front.
# NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered.
diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake
index e43d4757bb..b265c92e45 100644
--- a/indra/cmake/Copy3rdPartyLibs.cmake
+++ b/indra/cmake/Copy3rdPartyLibs.cmake
@@ -107,6 +107,8 @@ if(WINDOWS)
set(MSVC_VER 140)
elseif (MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1930) # Visual Studio 2019
set(MSVC_VER 140)
+ elseif (MSVC_VERSION GREATER_EQUAL 1930 AND MSVC_VERSION LESS 1940) # Visual Studio 2022
+ set(MSVC_VER 140)
else (MSVC80)
MESSAGE(WARNING "New MSVC_VERSION ${MSVC_VERSION} of MSVC: adapt Copy3rdPartyLibs.cmake")
endif (MSVC80)
@@ -150,6 +152,15 @@ if(WINDOWS)
endforeach()
elseif(DARWIN)
+ # Support our "@executable_path/../Resources" load path for executables
+ # that end up in any of the above SHARED_LIB_STAGING_DIR_MUMBLE
+ # directories.
+ # Cannot use ${SHARED_LIB_STAGING_DIR} here as it used a generator expression and tha this not
+ # supported by file(...)
+ file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/sharedlibs/Release/Resources")
+ file(CREATE_LINK "${CMAKE_BINARY_DIR}/sharedlibs/Release/Resources" "${CMAKE_BINARY_DIR}/sharedlibs/Resources"
+ SYMBOLIC)
+
set(vivox_lib_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
set(slvoice_files SLVoice)
set(vivox_libs
diff --git a/indra/cmake/DBusGlib.cmake b/indra/cmake/DBusGlib.cmake
index f75018ad0e..c9b727ca9d 100644
--- a/indra/cmake/DBusGlib.cmake
+++ b/indra/cmake/DBusGlib.cmake
@@ -3,11 +3,12 @@ include(Prebuilt)
add_library( ll::dbus INTERFACE IMPORTED)
-# Only define this when not using the prebuild 3ps, lls prebuild is broken
-if( NOT USE_AUTOBUILD_3P )
- target_compile_definitions( ll::dbus INTERFACE LL_DBUS_ENABLED )
+if( LINUX )
+ # Only define this when not using the prebuild 3ps, lls prebuild is broken
+ if( NOT USE_AUTOBUILD_3P )
+ target_compile_definitions( ll::dbus INTERFACE LL_DBUS_ENABLED )
+ endif()
+ use_system_binary(dbus)
+
+ use_prebuilt_binary(dbus_glib)
endif()
-use_system_binary(dbus)
-
-use_prebuilt_binary(dbus_glib)
-
diff --git a/indra/cmake/Python.cmake b/indra/cmake/Python.cmake
index ed595f6966..dbf5033ce5 100644
--- a/indra/cmake/Python.cmake
+++ b/indra/cmake/Python.cmake
@@ -5,32 +5,49 @@ set(PYTHONINTERP_FOUND)
if (WINDOWS)
# On Windows, explicitly avoid Cygwin Python.
- find_program(PYTHON_EXECUTABLE
- NAMES python.exe
+ # if the user has their own version of Python installed, prefer that
+ foreach(hive HKEY_CURRENT_USER HKEY_LOCAL_MACHINE)
+ # prefer more recent Python versions to older ones, if multiple versions
+ # are installed
+ foreach(pyver 3.11 3.10 3.9 3.8 3.7)
+ list(APPEND regpaths "[${hive}\\SOFTWARE\\Python\\PythonCore\\${pyver}\\InstallPath]")
+ endforeach()
+ endforeach()
+
+ # TODO: This logic has the disadvantage that if you have multiple versions
+ # of Python installed, the selected path won't necessarily be the newest -
+ # e.g. this GLOB will prefer Python310 to Python311. But since pymaybe is
+ # checked AFTER the registry entries, this will only surface as a problem if
+ # no installed Python appears in the registry.
+ file(GLOB pymaybe
+ "$ENV{PROGRAMFILES}/Python*"
+## "$ENV{PROGRAMFILES(X86)}/Python*"
+ # The Windows environment variable is in fact as shown above, but CMake
+ # disallows querying an environment variable containing parentheses -
+ # thanks, Windows. Fudge by just appending " (x86)" to $PROGRAMFILES and
+ # hoping for the best.
+ "$ENV{PROGRAMFILES} (x86)/Python*"
+ "c:/Python*")
+
+ 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]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.8\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.9\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.10\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.11\\InstallPath]
- [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.7\\InstallPath]
- [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]
+ ${regpaths}
+ ${pymaybe}
)
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: