diff options
| author | Erik Kundiman <erik@megapahit.org> | 2026-03-07 14:55:05 +0800 |
|---|---|---|
| committer | Erik Kundiman <erik@megapahit.org> | 2026-03-07 14:55:05 +0800 |
| commit | eac10375e294cd24c21c09497e838e70dcf4d74a (patch) | |
| tree | 4b53b1ebc1582e3323c80953236dca6b3a92ab65 /indra/cmake | |
| parent | 8142dd11b4cae8d4768a2d985a24340163a42a5c (diff) | |
| parent | 3529bc5f9d29a71355f3a3666540abff57dc1a4c (diff) | |
Merge tag 'Second_Life_Release#3529bc5f-2026.02' into 2026.02
Diffstat (limited to 'indra/cmake')
| -rw-r--r-- | indra/cmake/Boost.cmake | 38 | ||||
| -rw-r--r-- | indra/cmake/Python.cmake | 67 |
2 files changed, 26 insertions, 79 deletions
diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index e754918c5b..961973f3fe 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -55,48 +55,42 @@ if (WINDOWS) find_library(BOOST_CONTEXT_LIBRARY NAMES + libboost_context libboost_context-mt libboost_context-mt${addrsfx} PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) find_library(BOOST_FIBER_LIBRARY NAMES + libboost_fiber libboost_fiber-mt libboost_fiber-mt${addrsfx} PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) find_library(BOOST_FILESYSTEM_LIBRARY NAMES + libboost_filesystem libboost_filesystem-mt libboost_filesystem-mt${addrsfx} PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) find_library(BOOST_PROGRAMOPTIONS_LIBRARY NAMES + libboost_program_options libboost_program_options-mt libboost_program_options-mt${addrsfx} PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - find_library(BOOST_REGEX_LIBRARY - NAMES - libboost_regex-mt - libboost_regex-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_SYSTEM_LIBRARY - NAMES - libboost_system-mt - libboost_system-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - find_library(BOOST_THREAD_LIBRARY NAMES + libboost_thread libboost_thread-mt libboost_thread-mt${addrsfx} PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) find_library(BOOST_URL_LIBRARY NAMES + libboost_url libboost_url-mt libboost_url-mt${addrsfx} PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) @@ -105,48 +99,42 @@ else (WINDOWS) find_library(BOOST_CONTEXT_LIBRARY NAMES + boost_context boost_context-mt boost_context-mt${addrsfx} PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) find_library(BOOST_FIBER_LIBRARY NAMES + boost_fiber boost_fiber-mt boost_fiber-mt${addrsfx} PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) find_library(BOOST_FILESYSTEM_LIBRARY NAMES + boost_filesystem boost_filesystem-mt boost_filesystem-mt${addrsfx} PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) find_library(BOOST_PROGRAMOPTIONS_LIBRARY NAMES + boost_program_options boost_program_options-mt boost_program_options-mt${addrsfx} PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - find_library(BOOST_REGEX_LIBRARY - NAMES - boost_regex-mt - boost_regex-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_SYSTEM_LIBRARY - NAMES - boost_system-mt - boost_system-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - find_library(BOOST_THREAD_LIBRARY NAMES + boost_thread boost_thread-mt boost_thread-mt${addrsfx} PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) find_library(BOOST_URL_LIBRARY NAMES + boost_url boost_url-mt boost_url-mt${addrsfx} PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) @@ -158,8 +146,6 @@ target_link_libraries(ll::boost INTERFACE ${BOOST_CONTEXT_LIBRARY} ${BOOST_FILESYSTEM_LIBRARY} ${BOOST_PROGRAMOPTIONS_LIBRARY} - ${BOOST_REGEX_LIBRARY} - ${BOOST_SYSTEM_LIBRARY} ${BOOST_THREAD_LIBRARY} ${BOOST_URL_LIBRARY}) diff --git a/indra/cmake/Python.cmake b/indra/cmake/Python.cmake index 7cce190f6a..428f9e3326 100644 --- a/indra/cmake/Python.cmake +++ b/indra/cmake/Python.cmake @@ -1,57 +1,18 @@ -# -*- cmake -*- +# Allow explicit Python path via environment variable +if(DEFINED ENV{PYTHON}) + set(Python3_ROOT_DIR "$ENV{PYTHON}") +endif() -set(PYTHONINTERP_FOUND) +# On Windows, prefer registry entries to avoid Cygwin/MSYS Python +# The registry is searched first by default, which finds native Windows Python +# installations rather than Cygwin/MSYS Python +if(WINDOWS) + set(Python3_FIND_REGISTRY FIRST CACHE STRING "Python search order") +endif() -if (DEFINED ENV{PYTHON}) - # Allow python executable to be explicitly set - set(python "$ENV{PYTHON}") - set(PYTHONINTERP_FOUND ON) -elseif (WINDOWS) - # On Windows, explicitly avoid Cygwin Python. +# Find Python 3 interpreter +find_package(Python3 REQUIRED COMPONENTS Interpreter) - # 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.13 3.12 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 - ${regpaths} - ${pymaybe} - ) - find_package(Python3 COMPONENTS Interpreter) -else() - find_program(python python3) - - if (python) - set(PYTHONINTERP_FOUND ON) - endif (python) -endif (DEFINED ENV{PYTHON}) - -if (NOT python) - message(FATAL_ERROR "No Python interpreter found") -endif (NOT python) - -set(PYTHON_EXECUTABLE "${python}" CACHE FILEPATH "Python interpreter for builds") +# Set legacy variable name for compatibility with existing code +set(PYTHON_EXECUTABLE "${Python3_EXECUTABLE}" CACHE FILEPATH "Python interpreter for builds") mark_as_advanced(PYTHON_EXECUTABLE) |
