Browse Source
By including pybind11 and Python headers as SYSTEM. Possible in pybind11 master, but not yet part of any release so I'm patching it manually.pull/1/head
3 changed files with 34 additions and 1 deletions
@ -0,0 +1,13 @@ |
|||||||
|
diff --git a/tools/pybind11Tools.cmake b/tools/pybind11Tools.cmake
|
||||||
|
index 52a70c2..1e9d033 100644
|
||||||
|
--- a/tools/pybind11Tools.cmake
|
||||||
|
+++ b/tools/pybind11Tools.cmake
|
||||||
|
@@ -130,7 +130,7 @@ function(pybind11_add_module target_name)
|
||||||
|
|
||||||
|
add_library(${target_name} ${lib_type} ${exclude_from_all} ${ARG_UNPARSED_ARGUMENTS})
|
||||||
|
|
||||||
|
- target_include_directories(${target_name}
|
||||||
|
+ target_include_directories(${target_name} SYSTEM
|
||||||
|
PRIVATE ${PYBIND11_INCLUDE_DIR} # from project CMakeLists.txt
|
||||||
|
PRIVATE ${pybind11_INCLUDE_DIR} # from pybind11Config
|
||||||
|
PRIVATE ${PYTHON_INCLUDE_DIRS})
|
||||||
@ -0,0 +1,20 @@ |
|||||||
|
set -e |
||||||
|
|
||||||
|
wget --no-clobber https://github.com/pybind/pybind11/archive/v2.2.4.tar.gz && tar -xzf v2.2.4.tar.gz |
||||||
|
|
||||||
|
cd pybind11-2.2.4 |
||||||
|
|
||||||
|
# Patch the CMake macro to add include paths as SYSTEM because otherwise GCC |
||||||
|
# 4.8 gets very loud. This is already done in |
||||||
|
# https://github.com/pybind/pybind11/pull/1416 but it's opt-in and not part of |
||||||
|
# any release yet. I don't want to force users to use pybind11 git, so apply |
||||||
|
# a patch manually. |
||||||
|
patch -p1 < $TRAVIS_BUILD_DIR/package/ci/pybind11-system-includes.patch |
||||||
|
|
||||||
|
mkdir -p build && cd build |
||||||
|
cmake .. \ |
||||||
|
-DCMAKE_INSTALL_PREFIX=$HOME/pybind11 \ |
||||||
|
-DPYBIND11_PYTHON_VERSION=3.6 \ |
||||||
|
-DPYBIND11_TEST=OFF \ |
||||||
|
-G Ninja |
||||||
|
ninja install |
||||||
Loading…
Reference in new issue