From 212f8993964e21da647041fca6f961e9fb5fe9e4 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Tue, 17 Oct 2017 19:57:42 +0100 Subject: [PATCH] Update to pybind11 v2.2.1 --- CMakeLists.txt | 7 ++++--- src/main.cpp | 10 ++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 876b226..c597af7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,9 +30,10 @@ configure_file("${CMAKE_SOURCE_DIR}/src/wrapper_version.cpp.in" "${CMAKE_BINARY_ # pybind11 ####################################### -set(PYBIND11_URL "https://github.com/pybind/pybind11/archive/v2.1.1.tar.gz") -set(PYBIND11_DOWNLOAD_PATH "${EXTERNAL_PROJECTS_PATH}/pybind11-2.1.1.tar.gz") -set(PYBIND11_EXTRACTED_PATH "${EXTERNAL_PROJECTS_PATH}/pybind11-2.1.1") +set(PYBIND11_VERSION "2.2.1") +set(PYBIND11_URL "https://github.com/pybind/pybind11/archive/v${PYBIND11_VERSION}.tar.gz") +set(PYBIND11_DOWNLOAD_PATH "${EXTERNAL_PROJECTS_PATH}/pybind11-${PYBIND11_VERSION}.tar.gz") +set(PYBIND11_EXTRACTED_PATH "${EXTERNAL_PROJECTS_PATH}/pybind11-${PYBIND11_VERSION}") if (NOT EXISTS ${PYBIND11_DOWNLOAD_PATH}) file(DOWNLOAD ${PYBIND11_URL} ${PYBIND11_DOWNLOAD_PATH}) diff --git a/src/main.cpp b/src/main.cpp index afdea1f..e7431a5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -82,14 +82,14 @@ void bindMetadataClasses(pybind11::module& module) { } void bindVersionClasses(pybind11::module& module) { - class_(module, "Version", metaclass()) + class_(module, "Version") .def_readonly_static("major", &LootVersion::major) .def_readonly_static("minor", &LootVersion::minor) .def_readonly_static("patch", &LootVersion::patch) .def_readonly_static("revision", &LootVersion::revision) .def_static("string", LootVersion::string); - class_(module, "WrapperVersion", metaclass()) + class_(module, "WrapperVersion") .def_readonly_static("major", &WrapperVersion::major) .def_readonly_static("minor", &WrapperVersion::minor) .def_readonly_static("patch", &WrapperVersion::patch) @@ -131,12 +131,10 @@ void bindFunctions(pybind11::module& module) { } } -PYBIND11_PLUGIN(loot_api) { - pybind11::module module("loot_api", "A Python module that wraps the LOOT API, generated by pybind11."); +PYBIND11_MODULE(loot_api, module) { + module.doc() = "A Python module that wraps the LOOT API, generated by pybind11."; loot::bindEnums(module); loot::bindClasses(module); loot::bindFunctions(module); - - return module.ptr(); }