The C++ wrapper relies on boost::shared_ptr, likely due to the lack of a
standard smart pointer at the time of the C++ wrapper implementation.
However, std::shared_ptr has been available by default in GCC since
version 6.1, and even with GCC 4.7 when explicitely using the -std=c++11
option.
This commit replaces all usages of boost::shared_ptr with
std::shared_ptr, eliminating the dependency on the Boost library. Since
the smart pointer is only used in private member variables and both
types have the same size, this change does not affect the ABI.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
include_directories ( ${LIBUSB_INCLUDE_DIR} )
# Find Boost
-if (FTDIPP OR BUILD_TESTS)
+if (BUILD_TESTS)
find_package( Boost REQUIRED )
endif()
sudo apt-get install libconfuse-dev (for ftdi-eeprom) (yum install libconfuse-devel)
sudo apt-get install swig python-dev (for python bindings) (yum install swig python-devel)
-sudo apt-get install libboost-all-dev (for C++ binding and unit test) (yum install boost-devel)
+sudo apt-get install libboost-all-dev (for unit test) (yum install boost-devel)
3) Clone the git repository
mkdir libftdi
# libftdi++ examples
if( FTDIPP )
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/ftdipp
- ${Boost_INCLUDE_DIRS}
)
# Target
${PROJECT_SOURCE_DIR}/src
)
-include_directories(${Boost_INCLUDE_DIRS})
-
# Shared library
add_library(ftdipp1 SHARED ${cpp_sources})
set_target_properties(ftdipp1 PROPERTIES CLEAN_DIRECT_OUTPUT 1)
# Dependencies
-target_link_libraries(ftdipp1 ftdi1 ${LIBUSB_LIBRARIES} ${BOOST_LIBRARIES})
+target_link_libraries(ftdipp1 ftdi1 ${LIBUSB_LIBRARIES})
install ( TARGETS ftdipp1
RUNTIME DESTINATION bin
#include <list>
#include <string>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <ftdi.h>
namespace Ftdi
private:
class Private;
- boost::shared_ptr<Private> d;
+ std::shared_ptr<Private> d;
};
/*! \brief Device EEPROM.
private:
class Private;
- boost::shared_ptr<Private> d;
+ std::shared_ptr<Private> d;
};
/*! \brief Device list.
private:
class Private;
- boost::shared_ptr<Private> d;
+ std::shared_ptr<Private> d;
};
}