From c40ef612cc41d8a59af049a132fd8beef73623b8 Mon Sep 17 00:00:00 2001 From: Dean Moldovan Date: Fri, 25 Aug 2017 21:11:36 +0200 Subject: [PATCH] Skip boost::variant tests on unsupported compilers and versions of Boost --- tests/CMakeLists.txt | 4 ++-- tests/test_stl.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0d6ebfcbd..df77d4306 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -114,8 +114,8 @@ if(PYBIND11_TEST_FILES_EIGEN_I GREATER -1) endif() endif() -# Optional dependency for some tests -find_package(Boost) +# Optional dependency for some tests (boost::variant is only supported with version >= 1.56) +find_package(Boost 1.56) # Compile with compiler warnings turned on function(pybind11_enable_warnings target_name) diff --git a/tests/test_stl.cpp b/tests/test_stl.cpp index 66fe9d1ce..0746fb4d5 100644 --- a/tests/test_stl.cpp +++ b/tests/test_stl.cpp @@ -13,7 +13,7 @@ // Test with `std::variant` in C++17 mode, or with `boost::variant` in C++11/14 #if PYBIND11_HAS_VARIANT using std::variant; -#elif PYBIND11_TEST_BOOST +#elif defined(PYBIND11_TEST_BOOST) && (!defined(_MSC_VER) || _MSC_VER >= 1910) # include # define PYBIND11_HAS_VARIANT 1 using boost::variant;