Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions indra/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
## We're not there yet, but once done, there is a kludge in Linking.cmake
# "if(${CMAKE_VERSION} VERSION_LESS "3.20.0")" that can also be removed
cmake_minimum_required(VERSION 3.16.0...4.0 FATAL_ERROR)
cmake_policy(SET CMP0156 NEW)
cmake_policy(SET CMP0179 NEW)
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.29.0")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The policies should probably only be set for CMake versions less than 4.0 and the minimum required CMake version should only specify a minimum version. Specifying a maximum version here is going to produce empty lines in the build output at least if using CMake 4.1.0.

Copy link
Contributor Author

@akleshchev akleshchev Sep 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The policies should probably only be set for CMake versions less than 4.0

Why even have them in such case if they only get a narrow window (3.29..4.0) to work?
The problem was that they don't build at 3.24 nor 3.27 so I added a check to not use them (3.29 is the first implementation).

cmake_policy(SET CMP0156 NEW)
endif()
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.31.0")
cmake_policy(SET CMP0179 NEW)
endif()

set(ROOT_PROJECT_NAME "SecondLife" CACHE STRING
"The root project/makefile/solution name. Defaults to SecondLife.")
Expand Down
148 changes: 101 additions & 47 deletions indra/cmake/Boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,53 +16,107 @@ use_prebuilt_binary(boost)
# with the address size.
set(addrsfx "-x${ADDRESS_SIZE}")

find_library(BOOST_CONTEXT_LIBRARY
NAMES
boost_context-mt
boost_context-mt${addrsfx}
PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH)

find_library(BOOST_FIBER_LIBRARY
NAMES
boost_fiber-mt
boost_fiber-mt${addrsfx}
PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH)

find_library(BOOST_FILESYSTEM_LIBRARY
NAMES
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-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-mt
boost_thread-mt${addrsfx}
PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH)

find_library(BOOST_URL_LIBRARY
NAMES
boost_url-mt
boost_url-mt${addrsfx}
PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH)
if (WINDOWS)

find_library(BOOST_CONTEXT_LIBRARY
NAMES
libboost_context-mt
libboost_context-mt${addrsfx}
PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH)

find_library(BOOST_FIBER_LIBRARY
NAMES
libboost_fiber-mt
libboost_fiber-mt${addrsfx}
PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH)

find_library(BOOST_FILESYSTEM_LIBRARY
NAMES
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-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-mt
libboost_thread-mt${addrsfx}
PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH)

find_library(BOOST_URL_LIBRARY
NAMES
libboost_url-mt
libboost_url-mt${addrsfx}
PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH)

else (WINDOWS)

find_library(BOOST_CONTEXT_LIBRARY
NAMES
boost_context-mt
boost_context-mt${addrsfx}
PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH)

find_library(BOOST_FIBER_LIBRARY
NAMES
boost_fiber-mt
boost_fiber-mt${addrsfx}
PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH)

find_library(BOOST_FILESYSTEM_LIBRARY
NAMES
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-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-mt
boost_thread-mt${addrsfx}
PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH)

find_library(BOOST_URL_LIBRARY
NAMES
boost_url-mt
boost_url-mt${addrsfx}
PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH)

endif (WINDOWS)

target_link_libraries(ll::boost INTERFACE
${BOOST_FIBER_LIBRARY}
Expand Down
17 changes: 13 additions & 4 deletions indra/cmake/LLKDU.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,19 @@ if (USE_KDU)
include(Prebuilt)
use_prebuilt_binary(kdu)

find_library(KDU_LIBRARY
NAMES
kdu
PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH)
if (WINDOWS)
find_library(KDU_LIBRARY
NAMES
kdu
PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH)

else (WINDOWS)
find_library(KDU_LIBRARY
NAMES
libkdu.a
PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH)

endif (WINDOWS)

target_link_libraries(ll::kdu INTERFACE ${KDU_LIBRARY})

Expand Down
32 changes: 16 additions & 16 deletions indra/llfilesystem/lldir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include "lldiriterator.h"
#include "stringize.h"
#include "llstring.h"
#include <boost/filesystem.hpp>
#include <filesystem>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/assign/list_of.hpp>
Expand Down Expand Up @@ -103,24 +103,24 @@ std::vector<std::string> LLDir::getFilesInDir(const std::string &dirname)
//Returns a vector of fullpath filenames.

#ifdef LL_WINDOWS // or BOOST_WINDOWS_API
boost::filesystem::path p(ll_convert<std::wstring>(dirname));
std::filesystem::path p(ll_convert<std::wstring>(dirname));
#else
boost::filesystem::path p(dirname);
std::filesystem::path p(dirname);
#endif

std::vector<std::string> v;

boost::system::error_code ec;
if (exists(p, ec) && !ec.failed())
std::error_code ec;
if (std::filesystem::exists(p, ec) && ec.value() == 0)
{
if (is_directory(p, ec) && !ec.failed())
if (is_directory(p, ec) && ec.value() == 0)
{
boost::filesystem::directory_iterator end_iter;
for (boost::filesystem::directory_iterator dir_itr(p);
std::filesystem::directory_iterator end_iter;
for (std::filesystem::directory_iterator dir_itr(p);
dir_itr != end_iter;
++dir_itr)
{
if (boost::filesystem::is_regular_file(dir_itr->status()))
if (std::filesystem::is_regular_file(dir_itr->status()))
{
v.push_back(dir_itr->path().filename().string());
}
Expand Down Expand Up @@ -197,24 +197,24 @@ U32 LLDir::deleteDirAndContents(const std::string& dir_name)
try
{
#ifdef LL_WINDOWS // or BOOST_WINDOWS_API
boost::filesystem::path dir_path(ll_convert<std::wstring>(dir_name));
std::filesystem::path dir_path(ll_convert<std::wstring>(dir_name));
#else
boost::filesystem::path dir_path(dir_name);
std::filesystem::path dir_path(dir_name);
#endif

if (boost::filesystem::exists(dir_path))
if (std::filesystem::exists(dir_path))
{
if (!boost::filesystem::is_empty(dir_path))
if (!std::filesystem::is_empty(dir_path))
{ // Directory has content
num_deleted = (U32)boost::filesystem::remove_all(dir_path);
num_deleted = (U32)std::filesystem::remove_all(dir_path);
}
else
{ // Directory is empty
boost::filesystem::remove(dir_path);
std::filesystem::remove(dir_path);
}
}
}
catch (boost::filesystem::filesystem_error &er)
catch (std::filesystem::filesystem_error &er)
{
LL_WARNS() << "Failed to delete " << dir_name << " with error " << er.code().message() << LL_ENDL;
}
Expand Down
4 changes: 2 additions & 2 deletions indra/llfilesystem/lldiriterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@

#include "fix_macros.h"
#include "llregex.h"
#include <boost/filesystem.hpp>
#include <filesystem>

namespace fs = boost::filesystem;
namespace fs = std::filesystem;

static std::string glob_to_regex(const std::string& glob);

Expand Down
Loading
Loading