option_defaults = { 'force-cpp11': False }
def dependencies(target, options):
- libdcp = ('libdcp', 'c6665c1', { 'force-cpp11': options['force-cpp11'] })
- libcxml = ('libcxml', 'c333199', { 'force-cpp11': options['force-cpp11'] })
+ libdcp = ('libdcp', '0f1034f')
+ libcxml = ('libcxml', 'c336f86')
return (('asdcplib', 'carl'), libcxml, libdcp)
def build(target, options):
if target.platform == 'windows':
cmd += ' --target-windows --disable-tests'
- # Centos 7 ships with glibmm 2.50.0 which requires C++11
- # but its compiler (gcc 4.8.5) defaults to C++97. Go figure.
- # I worry that this will cause ABI problems but I don't have
- # a better solution. Mageia 6 pulls the same stunt except it's
- # libxml++ that requires C++11
- force_cpp11 = False
- if target.platform == 'linux':
- if target.distro == 'centos' and target.version == '7':
- force_cpp11 = True
- if target.distro == 'mageia' and target.version == '6':
- force_cpp11 = True
- if force_cpp11 or options['force-cpp11']:
- cmd += ' --force-cpp11'
-
target.command(cmd)
target.command('./waf build install')
using std::cout;
using std::string;
using std::exception;
-using boost::shared_ptr;
+using std::shared_ptr;
using boost::optional;
-using boost::dynamic_pointer_cast;
+using std::dynamic_pointer_cast;
using namespace sub;
static Time
using std::string;
using std::ifstream;
using boost::algorithm::ends_with;
-using boost::shared_ptr;
+using std::shared_ptr;
using namespace sub;
shared_ptr<Reader>
*/
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <boost/filesystem.hpp>
namespace sub {
class Reader;
-extern boost::shared_ptr<Reader>
+extern std::shared_ptr<Reader>
reader_factory (boost::filesystem::path);
}
using boost::algorithm::replace_all;
using boost::is_any_of;
using boost::locale::conv::utf_to_utf;
-using boost::shared_ptr;
+using std::shared_ptr;
using namespace sub;
namespace sub {
std::string editor_contact_details;
private:
- void read (boost::shared_ptr<InputReader> reader);
+ void read (std::shared_ptr<InputReader> reader);
STLBinaryTables _tables;
};
#include "reader.h"
#include "subtitle.h"
#include "collect.h"
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <string>
#include <iostream>
#include <cstdio>
using std::map;
using std::list;
using boost::optional;
-using boost::shared_ptr;
+using std::shared_ptr;
using namespace sub;
/** @param s A string.
*/
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <string>
#define LIBSUB_UNUSED(x) (void)(x)
extern void remove_unicode_bom (boost::optional<std::string>& line);
extern boost::optional<std::string> get_line_file (FILE* f);
extern boost::optional<std::string> get_line_string (std::string* s);
-extern void dump (boost::shared_ptr<const Reader> read, std::ostream& os);
+extern void dump (std::shared_ptr<const Reader> read, std::ostream& os);
}
{
template <class T>
-boost::shared_ptr<T>
+std::shared_ptr<T>
optional_type_child (cxml::Node const & node, std::string name)
{
- std::list<boost::shared_ptr<cxml::Node> > n = node.node_children (name);
+ std::list<std::shared_ptr<cxml::Node> > n = node.node_children (name);
if (n.size() > 1) {
throw XMLError ("duplicate XML tag");
} else if (n.empty ()) {
- return boost::shared_ptr<T> ();
+ return std::shared_ptr<T> ();
}
- return boost::shared_ptr<T> (new T (n.front ()));
+ return std::shared_ptr<T> (new T (n.front ()));
}
template <class T>
-boost::shared_ptr<T> type_child (boost::shared_ptr<const cxml::Node> node, std::string name) {
- return boost::shared_ptr<T> (new T (node->node_child (name)));
+std::shared_ptr<T> type_child (std::shared_ptr<const cxml::Node> node, std::string name) {
+ return std::shared_ptr<T> (new T (node->node_child (name)));
}
template <class T>
-boost::shared_ptr<T>
-optional_type_child (boost::shared_ptr<const cxml::Node> node, std::string name)
+std::shared_ptr<T>
+optional_type_child (std::shared_ptr<const cxml::Node> node, std::string name)
{
return optional_type_child<T> (*node.get(), name);
}
template <class T>
-std::list<boost::shared_ptr<T> >
+std::list<std::shared_ptr<T> >
type_children (cxml::Node const & node, std::string name)
{
- std::list<boost::shared_ptr<cxml::Node> > n = node.node_children (name);
- std::list<boost::shared_ptr<T> > r;
- for (typename std::list<boost::shared_ptr<cxml::Node> >::iterator i = n.begin(); i != n.end(); ++i) {
- r.push_back (boost::shared_ptr<T> (new T (*i)));
+ std::list<std::shared_ptr<cxml::Node> > n = node.node_children (name);
+ std::list<std::shared_ptr<T> > r;
+ for (typename std::list<std::shared_ptr<cxml::Node> >::iterator i = n.begin(); i != n.end(); ++i) {
+ r.push_back (std::shared_ptr<T> (new T (*i)));
}
return r;
}
template <class T>
-std::list<boost::shared_ptr<T> >
-type_children (boost::shared_ptr<const cxml::Node> node, std::string name)
+std::list<std::shared_ptr<T> >
+type_children (std::shared_ptr<const cxml::Node> node, std::string name)
{
return type_children<T> (*node.get(), name);
}
template <class T>
-std::list<boost::shared_ptr<T> >
+std::list<std::shared_ptr<T> >
type_grand_children (cxml::Node const & node, std::string name, std::string sub)
{
- boost::shared_ptr<const cxml::Node> p = node.node_child (name);
+ std::shared_ptr<const cxml::Node> p = node.node_child (name);
return type_children<T> (p, sub);
}
template <class T>
-std::list<boost::shared_ptr<T> >
-type_grand_children (boost::shared_ptr<const cxml::Node> node, std::string name, std::string sub)
+std::list<std::shared_ptr<T> >
+type_grand_children (std::shared_ptr<const cxml::Node> node, std::string name, std::string sub)
{
return type_grand_children<T> (*node.get(), name, sub);
}
#include <boost/optional/optional_io.hpp>
using std::list;
-using boost::shared_ptr;
+using std::shared_ptr;
/* Test reading of a DCP XML file */
BOOST_AUTO_TEST_CASE (dcp_reader_test1)
using std::list;
using std::ifstream;
using std::ofstream;
-using boost::shared_ptr;
+using std::shared_ptr;
/* Test reading of a binary STL file */
BOOST_AUTO_TEST_CASE (stl_binary_reader_test1)
using std::cout;
using std::map;
using std::list;
-using boost::shared_ptr;
+using std::shared_ptr;
using namespace sub;
static void
opt.add_option('--static', action='store_true', default=False, help='build libsub statically and link statically to cxml and dcp')
opt.add_option('--target-windows', action='store_true', default=False, help='set up to do a cross-compile to make a Windows package')
opt.add_option('--disable-tests', action='store_true', default=False, help='disable building of tests')
- opt.add_option('--force-cpp11', action='store_true', default=False, help='force use of C++11')
def configure(conf):
conf.load('compiler_cxx')
conf.load('clang_compilation_database', tooldir=['waf-tools'])
- conf.env.append_value('CXXFLAGS', ['-Wall', '-Wextra', '-D_FILE_OFFSET_BITS=64', '-D__STDC_FORMAT_MACROS'])
- if conf.options.force_cpp11:
- conf.env.append_value('CXXFLAGS', ['-std=c++11', '-DBOOST_NO_CXX11_SCOPED_ENUMS'])
+ conf.env.append_value('CXXFLAGS', ['-Wall', '-Wextra', '-D_FILE_OFFSET_BITS=64', '-D__STDC_FORMAT_MACROS', '-std=c++11', '-DBOOST_NO_CXX11_SCOPED_ENUMS'])
conf.env.append_value('CXXFLAGS', ['-DLIBSUB_VERSION="%s"' % VERSION])
conf.env.ENABLE_DEBUG = conf.options.enable_debug