Skip to content

Commit

Permalink
Bump required Boost version to 1.72
Browse files Browse the repository at this point in the history
  • Loading branch information
afh authored and tbm committed Mar 24, 2023
1 parent 956d8ea commit d1bc057
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 56 deletions.
32 changes: 2 additions & 30 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
set(Required_CMake_Version 3.16.2)
set(Required_Boost_Version 1.72)

cmake_minimum_required(VERSION ${Required_CMake_Version})

Expand Down Expand Up @@ -83,7 +84,7 @@ else()
endif()

# Set BOOST_ROOT to help CMake to find the right Boost version
find_package(Boost 1.49.0
find_package(Boost ${Required_Boost_Version}
REQUIRED date_time filesystem system iostreams regex unit_test_framework
${BOOST_PYTHON} OPTIONAL_COMPONENTS nowide)

Expand Down Expand Up @@ -182,35 +183,6 @@ endif()

cmake_pop_check_state()

# Check if fix for https://github.com/boostorg/python/issues/39 is needed
if (HAVE_BOOST_PYTHON)
cmake_push_check_state()

set(CMAKE_REQUIRED_INCLUDES
${CMAKE_INCLUDE_PATH} ${Boost_INCLUDE_DIRS} ${Python_INCLUDE_DIRS})
set(CMAKE_REQUIRED_LIBRARIES
${Boost_LIBRARIES} ${Python_LIBRARIES} ${PROFILE_LIBS})

check_cxx_source_compiles("
#include <boost/python.hpp>
struct X { int y; };
int main()
{
boost::python::make_setter(&X::y);
return 0;
}" BOOST_MAKE_SETTER_COMPILES)

if (BOOST_MAKE_SETTER_COMPILES)
set(HAVE_BOOST_159_ISSUE_39 0)
else()
set(HAVE_BOOST_159_ISSUE_39 1)
endif()

cmake_pop_check_state()
endif()

########################################################################

include_directories(${CMAKE_INCLUDE_PATH})
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ current `master` branch:
Dependency | Version (or greater)
------------|---------------------
[CMake] | 3.16.2
[Boost] | 1.49
[Boost] | 1.72
[GMP] | 4.2.2
[MPFR] | 2.4.0
[utfcpp] | 2.3.4
Expand Down
5 changes: 0 additions & 5 deletions src/ptree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,7 @@ void format_ptree::flush()

switch (format) {
case FORMAT_XML:
#if BOOST_VERSION >= 105600
auto indented = property_tree::xml_writer_make_settings<std::string> (' ', 2);
#else
property_tree::xml_writer_settings<char> indented(' ', 2);
#endif

property_tree::write_xml(out, pt, indented);
out << std::endl;
break;
Expand Down
12 changes: 0 additions & 12 deletions src/system.hh.in
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
#define HAVE_BOOST_PYTHON @HAVE_BOOST_PYTHON@
#define HAVE_GPGME @HAVE_GPGME@
#define HAVE_BOOST_REGEX_UNICODE @HAVE_BOOST_REGEX_UNICODE@
#define HAVE_BOOST_159_ISSUE_39 @HAVE_BOOST_159_ISSUE_39@
#define HAVE_BOOST_NOWIDE @HAVE_BOOST_NOWIDE@

#define DEBUG_MODE @DEBUG_MODE@
Expand Down Expand Up @@ -216,17 +215,6 @@

#include <boost/iterator/indirect_iterator.hpp>

#if BOOST_VERSION == 105900 && HAVE_BOOST_159_ISSUE_39
// Fix for https://github.com/boostorg/python/issues/39
namespace boost { namespace python {
template <class D>
inline object make_setter(D const& x)
{
return detail::make_setter(x, default_call_policies(), is_member_pointer<D>(), 0);
}
}}
#endif

#endif // HAVE_BOOST_PYTHON

#endif // INCLUDED_SYSTEM_HH
4 changes: 0 additions & 4 deletions src/utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -849,11 +849,7 @@ path resolve_path(const path& pathname)
path temp = pathname;
if (temp.string()[0] == '~')
temp = expand_path(temp);
#if (BOOST_VERSION >= 106000)
temp.lexically_normal();
#else
temp.normalize();
#endif
return temp;
}

Expand Down
4 changes: 0 additions & 4 deletions src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@
#ifndef INCLUDED_UTILS_H
#define INCLUDED_UTILS_H

#if (BOOST_VERSION >= 106600)
#include <boost/uuid/detail/sha1.hpp>
#else
#include <boost/uuid/sha1.hpp>
#endif

/**
* @name Default values
Expand Down

0 comments on commit d1bc057

Please sign in to comment.