Guard for older boost versions in LSP

This commit is contained in:
Nikola Matic 2023-01-17 15:44:33 +01:00
parent 4b618cc3de
commit 59547bd90a
3 changed files with 7 additions and 3 deletions

View File

@ -10,7 +10,7 @@ parameters:
ubuntu-2204-docker-image:
type: string
# solbuildpackpusher/solidity-buildpack-deps:ubuntu2204-1
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:07419ed58537cbca9d4c30701fb84f6bb517ce2fce7f3b5dccb3db8bf1c30183"
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:ee1def5806f40c35d583234e172ec5769bb9a08b6f5bbc713c1a2658846dbced"
ubuntu-2204-clang-docker-image:
type: string
# solbuildpackpusher/solidity-buildpack-deps:ubuntu2204.clang-1

View File

@ -38,7 +38,7 @@ if (WIN32)
find_package(Boost 1.77.0 EXACT QUIET REQUIRED COMPONENTS ${BOOST_COMPONENTS})
else()
find_package(Boost 1.74.0 QUIET REQUIRED COMPONENTS ${BOOST_COMPONENTS})
find_package(Boost 1.71.0 QUIET REQUIRED COMPONENTS ${BOOST_COMPONENTS})
endif()
# If cmake is older than boost and boost is older than 1.70,

View File

@ -220,8 +220,12 @@ vector<boost::filesystem::path> LanguageServer::allSolidityFilesFromProject() co
// We explicitly decided against including all files from include paths but leave the possibility
// open for a future PR to enable such a feature to be optionally enabled (default disabled).
// Note: Newer versions of boost have deprecated symlink_option::recurse
#if (BOOST_VERSION < 107200)
auto directoryIterator = fs::recursive_directory_iterator(m_fileRepository.basePath(), fs::symlink_option::recurse);
#else
auto directoryIterator = fs::recursive_directory_iterator(m_fileRepository.basePath(), fs::directory_options::follow_directory_symlink);
#endif
for (fs::directory_entry const& dirEntry: directoryIterator)
if (
dirEntry.path().extension() == ".sol" &&