Skip to content
Permalink
Browse files
turn pybind11 into python build dependency, removing from source tree…
…. docs no yet updated.
  • Loading branch information
jmalkin committed Aug 30, 2021
1 parent ed37a7a commit 847babec95c6bfee6774e23ab7d4c736e925ad2c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
@@ -1,3 +0,0 @@
[submodule "python/pybind11"]
path = python/pybind11
url = https://github.com/pybind/pybind11
@@ -2,7 +2,8 @@
requires = ["wheel",
"setuptools >= 30.3.0",
"setuptools_scm",
"cmake >= 3.12"]
"cmake >= 3.12",
"pybind11[global] >= 2.6.0"]

[tool.tox]
legacy_tox_ini = """
@@ -12,6 +13,7 @@ envlist = py3
[testenv]
deps = pytest
numpy
pybind11[global] >= 2.6.0
changedir = python/tests
commands = pytest
"""
@@ -22,9 +22,12 @@ else()
set(PYBIND11_CPP_STANDARD -std=c++11)
endif()

add_subdirectory(pybind11)
find_package(Python3 COMPONENTS Interpreter Development)
find_package(pybind11 CONFIG)
#add_subdirectory(pybind11)

pybind11_add_module(python MODULE EXCLUDE_FROM_ALL SYSTEM THIN_LTO)
#pybind11_add_module(python MODULE EXCLUDE_FROM_ALL SYSTEM THIN_LTO)
pybind11_add_module(python MODULE EXCLUDE_FROM_ALL THIN_LTO)

target_link_libraries(python
PRIVATE
Submodule pybind11 deleted from 59a2ac
@@ -49,8 +49,9 @@ def build_extension(self, ext):
os.path.dirname(self.get_ext_fullpath(ext.name)))
cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir]
cmake_args += ['-DWITH_PYTHON=True']
cmake_args += ['-DCMAKE_CXX_STANDARD=11']
# ensure we use a consistent python version
cmake_args += ['-DPYTHON_EXECUTABLE=' + sys.executable]
cmake_args += ['-DPython3_EXECUTABLE=' + sys.executable]
cfg = 'Debug' if self.debug else 'Release'
build_args = ['--config', cfg]

0 comments on commit 847babe

Please sign in to comment.