Skip to content
Open
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ find_package(Boost 1.54.0 COMPONENTS ${USED_BOOST_LIBS} REQUIRED)

add_library(inotify-filesystem-adapter INTERFACE)
if(CMAKE_CXX_STANDARD LESS 17 OR USE_BOOST_FILESYSTEM)
add_definitions(-DUSE_BOOST_FILESYSTEM)
target_compile_definitions(inotify-filesystem-adapter INTERFACE USE_BOOST_FILESYSTEM)
target_link_libraries(inotify-filesystem-adapter INTERFACE Boost::filesystem)
else()
target_link_libraries(inotify-filesystem-adapter INTERFACE stdc++fs)
Expand Down
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ macro(configure_target target)
$<INSTALL_INTERFACE:include>
${Boost_INCLUDE_DIR})
target_link_libraries(${target} PUBLIC inotify-filesystem-adapter)
if(CMAKE_CXX_STANDARD LESS 17 OR USE_BOOST_FILESYSTEM)
target_compile_definitions(${target} PUBLIC USE_BOOST_FILESYSTEM)
endif()

endmacro(configure_target target)

Expand Down
4 changes: 4 additions & 0 deletions src/Inotify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ void Inotify::watchDirectoryRecursively(fs::path path)
if (fs::is_directory(path)) {
inotifypp::error_code ec;
fs::recursive_directory_iterator it(
#if !defined USE_BOOST_FILESYSTEM || (defined USE_BOOST_FILESYSTEM && BOOST_VERSION >= 107200)
path, fs::directory_options::follow_directory_symlink, ec);
#else
path, ec);
#endif
fs::recursive_directory_iterator end;

for (; it != end; it.increment(ec)) {
Expand Down
3 changes: 2 additions & 1 deletion src/include/inotify-cpp/FileSystemAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace inotifypp

#include <boost/filesystem.hpp>
#include <boost/optional.hpp>
#include <boost/version.hpp>

namespace inotifypp
{
Expand All @@ -32,7 +33,7 @@ namespace inotifypp
template<typename T>
using optional = boost::optional<T>;

inline constexpr boost::none_t nullopt() { return boost::none; };
inline boost::none_t nullopt() { return boost::none; };
}

#endif