Commit b503bf16 authored by David E. DeMarle's avatar David E. DeMarle

make it easy to choose boost instead of the new cxx11 sptrs

On some platforms, like windows, you don't have to do anything
special to get c++11. This change makes it easy to use the
older boost based implementation on them.
parent 3984a316
......@@ -104,21 +104,25 @@ endif (TIFF_FOUND)
option(XDMF_BUILD_DSM OFF)
mark_as_advanced(XDMF_BUILD_DSM)
# Test for Cxx11
unset(HAVE_CXX11_SHARED_PTR CACHE)
check_cxx_source_compiles("
#include <memory>
using namespace std;
struct Base { virtual ~Base(){} };
int main(int ac, char * av[])
{
shared_ptr<Base> ptr(new Base());
}
"
HAVE_CXX11_SHARED_PTR)
option(XDMF_TRY_NOBOOST ON)
mark_as_advanced(XDMF_TRY_NOBOOST)
if (XDMF_TRY_NOBOOST)
# Test for Cxx11
unset(HAVE_CXX11_SHARED_PTR CACHE)
check_cxx_source_compiles("
#include <memory>
using namespace std;
struct Base { virtual ~Base(){} };
int main(int ac, char * av[])
{
shared_ptr<Base> ptr(new Base());
}
"
HAVE_CXX11_SHARED_PTR)
endif ()
# Cxx11 does not work with swig due to an issue with swig
if (HAVE_CXX11_SHARED_PTR AND NOT XDMF_WRAP_PYTHON)
......
......@@ -133,18 +133,20 @@ int main(int ac, char * av[])
"
HAVE_BOOST_SHARED_DYNAMIC_CAST)
check_cxx_source_compiles("
#include <memory>
using namespace std;
struct Base { virtual ~Base(){} };
int main(int ac, char * av[])
{
shared_ptr<Base> ptr(new Base());
}
"
HAVE_CXX11_SHARED_PTR)
if (XDMF_TRY_NOBOOST)
check_cxx_source_compiles("
#include <memory>
using namespace std;
struct Base { virtual ~Base(){} };
int main(int ac, char * av[])
{
shared_ptr<Base> ptr(new Base());
}
"
HAVE_CXX11_SHARED_PTR)
endif ()
if (HAVE_CXX11_SHARED_PTR AND NOT XDMF_WRAP_PYTHON)
add_definitions(-DHAVE_CXX11_SHARED_PTR)
......
......@@ -14,18 +14,20 @@ option(XDMF_BUILD_DSM_THREADS ON)
# Test for Cxx11
unset(HAVE_CXX11_SHARED_PTR CACHE)
check_cxx_source_compiles("
#include <memory>
using namespace std;
struct Base { virtual ~Base(){} };
int main(int ac, char * av[])
{
shared_ptr<Base> ptr(new Base());
}
"
HAVE_CXX11_SHARED_PTR)
if (XDMF_TRY_NOBOOST)
check_cxx_source_compiles("
#include <memory>
using namespace std;
struct Base { virtual ~Base(){} };
int main(int ac, char * av[])
{
shared_ptr<Base> ptr(new Base());
}
"
HAVE_CXX11_SHARED_PTR)
endif ()
# Cxx11 does not work with swig due to an issue with swig
if (HAVE_CXX11_SHARED_PTR AND NOT XDMF_WRAP_PYTHON)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment