Skip to content
Snippets Groups Projects
Commit 7d607f9b authored by Ming-Yuan Yu's avatar Ming-Yuan Yu
Browse files

fixed compilation for c++14

parent 8ad70720
No related branches found
No related tags found
No related merge requests found
cmake_minimum_required(VERSION 3.1) cmake_minimum_required(VERSION 3.1)
project(cartopy) project(cartopy)
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 14)
find_package(pybind11 REQUIRED) find_package(pybind11 REQUIRED)
find_package(cartographer REQUIRED) find_package(cartographer REQUIRED)
pybind11_add_module(cartopy cartopy.cpp) pybind11_add_module(cartopy cartopy.cpp)
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
#include <string> #include <string>
#include <type_traits> #include <type_traits>
#define PROJECT_NAME "cartopy" #define PROJECT_NAME "cartopy"
namespace pybind11::detail { namespace pybind11 { namespace detail {
template <typename T> template <typename T>
struct type_caster< struct type_caster<
T, std::enable_if_t<std::is_base_of_v<google::protobuf::Message, T>>> { T, typename std::enable_if<std::is_base_of<google::protobuf::Message, T>::value>::type> {
PYBIND11_TYPE_CASTER(T, _("google.protobuf.message.Message")); PYBIND11_TYPE_CASTER(T, _("google.protobuf.message.Message"));
bool load(handle src, bool) { return false; } bool load(handle src, bool) { return false; }
static handle cast(T src, return_value_policy policy, static handle cast(T src, return_value_policy policy,
...@@ -31,6 +31,7 @@ struct type_caster< ...@@ -31,6 +31,7 @@ struct type_caster<
} }
}; };
}
} // namespace pybind11::detail } // namespace pybind11::detail
PYBIND11_MODULE(cartopy, m) { PYBIND11_MODULE(cartopy, m) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment