Update pybind11 submodule to v2.2

This commit is contained in:
Dean Moldovan 2017-08-31 20:50:50 +02:00
parent a3a63d7288
commit 8818f493e3
4 changed files with 12 additions and 28 deletions

View file

@ -1,5 +1,5 @@
version: '{build}' version: '{build}'
image: Visual Studio 2015 image: Visual Studio 2017
platform: platform:
- x86 - x86
- x64 - x64
@ -8,7 +8,7 @@ environment:
- PYTHON: 27 - PYTHON: 27
- PYTHON: 36 - PYTHON: 36
- CONDA: 27 - CONDA: 27
- CONDA: 35 - CONDA: 36
install: install:
- ps: | - ps: |
git submodule update -q --init --recursive git submodule update -q --init --recursive

View file

@ -1,4 +1,5 @@
language: cpp language: cpp
dist: trusty
matrix: matrix:
include: include:
- os: linux - os: linux
@ -8,7 +9,7 @@ matrix:
- os: linux - os: linux
env: CONDA=2.7 env: CONDA=2.7
- os: linux - os: linux
env: CONDA=3.5 env: CONDA=3.6
- os: osx - os: osx
env: PYTHON=2.7 env: PYTHON=2.7
- os: osx - os: osx
@ -16,18 +17,7 @@ matrix:
- os: osx - os: osx
env: CONDA=2.7 env: CONDA=2.7
- os: osx - os: osx
env: CONDA=3.5 env: CONDA=3.6
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- deadsnakes
- kubuntu-backports
packages:
- g++-4.8
- python3.5
- python3.5-dev
- cmake
before_install: before_install:
- | - |
if [ "$TRAVIS_OS_NAME" = "linux" ]; then export CXX=g++-4.8 CC=gcc-4.8; fi if [ "$TRAVIS_OS_NAME" = "linux" ]; then export CXX=g++-4.8 CC=gcc-4.8; fi

@ -1 +1 @@
Subproject commit e33ef9c20d36fe760792c61ccc95ecf1b42cf81d Subproject commit 2a5a5ec0a47c245fbf1bb1a8a90b4c3278e01693

View file

@ -4,14 +4,10 @@ int add(int i, int j) {
return i + j; return i + j;
} }
int subtract(int i, int j) {
return i - j;
}
namespace py = pybind11; namespace py = pybind11;
PYBIND11_PLUGIN(cmake_example) { PYBIND11_MODULE(cmake_example, m) {
py::module m("cmake_example", R"pbdoc( m.doc() = R"pbdoc(
Pybind11 example plugin Pybind11 example plugin
----------------------- -----------------------
@ -22,7 +18,7 @@ PYBIND11_PLUGIN(cmake_example) {
add add
subtract subtract
)pbdoc"); )pbdoc";
m.def("add", &add, R"pbdoc( m.def("add", &add, R"pbdoc(
Add two numbers Add two numbers
@ -30,17 +26,15 @@ PYBIND11_PLUGIN(cmake_example) {
Some other explanation about the add function. Some other explanation about the add function.
)pbdoc"); )pbdoc");
m.def("subtract", &subtract, R"pbdoc( m.def("subtract", [](int i, int j) { return i - j; }, R"pbdoc(
Subtract two numbers Subtract two numbers
Some other explanation about the subtract function. Some other explanation about the subtract function.
)pbdoc"); )pbdoc");
#ifdef VERSION_INFO #ifdef VERSION_INFO
m.attr("__version__") = py::str(VERSION_INFO); m.attr("__version__") = VERSION_INFO;
#else #else
m.attr("__version__") = py::str("dev"); m.attr("__version__") = "dev";
#endif #endif
return m.ptr();
} }