Commit Graph

26 Commits

Author SHA1 Message Date
Henry Schreiner fc59f4e6e5
fix(cmake): add required emscripten flags (#5298)
* fix(cmake): add required emscripten flags

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Update emscripten.yaml

* fix(cmake): add required emscripten flags to headers target

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix(cmake): incorrect detection of Emscripten

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix(cmake): allow pybind11::headers to be modified

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix(cmake): hide a warning when building the tests standalone

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix(cmake): use explicit variable for is config

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix(cmake): go back to ALIAS target

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* chore: reduce overall diff

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* chore: reduce overall diff

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* chore: shorten code a bit

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2024-08-12 16:51:48 -04:00
Social_Mean 31b0a5d94f fix doc typo 2023-11-03 23:51:16 -04:00
Henry Schreiner 2e5f5c4cf8
fix: support CMake 3.27, drop 3.4 (#4719)
* fix: support CMake 3.27, drop 3.4

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Update upgrade.rst

* Update upgrade.rst

* Update upgrade.rst

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2023-07-12 13:10:24 -05:00
Henry Schreiner 522c59ceb2
chore: drop Python 3.5 (#3719)
* chore: drop Python 3.5 support

* chore: more fstrings with flynt's help

* ci: drop Python 3.5

* chore: bump dependency versions

* docs: touch up py::args

* tests: remove deprecation warning

* Ban smartquotes

* Very minor tweaks (by-product of reviewing PR #3719).

Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
2022-02-11 19:06:16 -05:00
Chris Ohk 1a432b426f
docs: Correct minor typos (#3721) 2022-02-11 10:42:48 -05:00
Ralf W. Grosse-Kunstleve 6493f496e3
Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688)
* `#error BYE_BYE_GOLDEN_SNAKE`

* Removing everything related to 2.7 from ci.yml

* Commenting-out Centos7

* Removing `PYTHON: 27` from .appveyor.yml

* "PY2" removal, mainly from tests. C++ code is not touched.

* Systematic removal of `u` prefix from `u"..."` and `u'...'` literals. Collateral cleanup of a couple minor other things.

* Cleaning up around case-insensitive hits for `[^a-z]py.*2` in tests/.

* Removing obsolete Python 2 mention in compiling.rst

* Proper `#error` for Python 2.

* Using PY_VERSION_HEX to guard `#error "PYTHON 2 IS NO LONGER SUPPORTED.`

* chore: bump pre-commit

* style: run pre-commit for pyupgrade 3+

* tests: use sys.version_info, not PY

* chore: more Python 2 removal

* Uncommenting Centos7 block (PR #3691 showed that it is working again).

* Update pre-commit hooks

* Fix pre-commit hook

* refactor: remove Python 2 from CMake

* refactor: remove Python 2 from setup code

* refactor: simplify, better static typing

* feat: fail with nice messages

* refactor: drop Python 2 C++ code

* docs: cleanup for Python 3

* revert: intree

revert: intree

* docs: minor touchup to py2 statement

Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
2022-02-10 18:28:08 -08:00
Sergiu Deitsch d2b2131603
cmake: report version type in the version string (#3472) 2021-11-16 10:03:41 -05:00
Ralf W. Grosse-Kunstleve 7d3b05715b
Improved workaround for Centos 8 failure (follow-on to PR #3030). (#3193)
* Rollback of PR #3030 (Working around Centos 8 failure).

* Adding `-DCMAKE_BUILD_TYPE=Release`

* Improving existing workaround (undoing the originally intended rollback).

* Fixing minor documentation bug.
2021-08-12 13:21:49 -07:00
Henry Schreiner 7cc0ebb475
fix: the CMake config in Python package had a hard coded path (#3144) 2021-07-27 17:23:52 -04:00
Robert Schütz d00fc62931
use CMAKE_INSTALL_FULL_INCLUDEDIR (#3005) 2021-06-19 18:45:53 -04:00
Akira Kawata 417fd120cc
Fix: fix typo of WITHOUT_SOABI (#2992) 2021-05-06 00:19:05 -07:00
Henry Schreiner 230fa53f16
fix: Don't override global settings for VISIBILITY if set (#2793)
Sometimes programmers want to control this, and while it can be changed after the fact, it's commonly set via a CMAKE_ variable; if that variable is set, we should respect that (like the CMAKE_INTERPROCEDURAL_OPTIMIZATION setting).
2021-01-14 08:31:48 -05:00
Henry Schreiner 3488494a81
refactor: import check as a common function (#2526)
* feat: import check as a common function

* docs: add cmake to docs
2020-10-02 22:34:22 -04:00
Henry Schreiner c58f7b745b
fix: reduce target collision in add_submodule mode (#2423)
* fix: reduce target collision in add_submodule mode

Closes #2420

* fix: update CMakeLists.txt
2020-08-22 09:06:01 -04:00
Henry Schreiner 1729aae96f
feat: new FindPython support (#2370)
* feat: FindPython support

* refactor: rename to PYBIND11_FINDPYTHON

* docs: Caps fixes

* feat: NOPYTHON mode

* test: check simple call

* docs: add changelog/upgrade guide

* feat: Support Python3 and Python2

* refactor: Use targets in tests

* fix: support CMake 3.4+

* feat: classic search also finds virtual environments

* docs: some updates from @wjakob's review

* fix: wrong name for QUIET mode variable, reported by @skoslowski

* refactor: cleaner output messaging

* fix: support debug Python's in FindPython mode too

* fixup! refactor: cleaner output messaging

* fix: missing pybind11_FOUND and pybind11_INCLUDE_DIR restored to subdir mode

* fix: nicer reporting of Python / PyPy

* fix: out-of-order variable fix

* docs: minor last-minute cleanup
2020-08-19 12:26:26 -04:00
Henry Schreiner ed6de125c9 format: include .in files 2020-08-06 11:54:41 -04:00
Henry Schreiner df115977df chore: cleanup 2020-08-06 11:54:41 -04:00
Henry Schreiner 1b92cd1703 fix: address review points from @YannickJadoul 2020-07-30 20:27:55 -04:00
Henry Schreiner 6ec1775fff feat: drop CMake 3.6 and below, modernize CMake
fix: include PYTHON_IS_DEBUG
2020-07-30 20:27:55 -04:00
Axel Huebl 6ebfc4b2b0 Document CMAKE_CXX_STANDARD
This variable is a CMake community standard to set the C++
standard of a build. Document it in favor of the previous variable,
which stays as a legacy flag for existing projects.

https://cmake.org/cmake/help/v3.17/variable/CMAKE_CXX_STANDARD.html
2020-04-26 09:17:10 +02:00
Lori A. Burns 868d94fcb4 Apply c++ standard flag only to files of CXX language. (#1678) 2019-06-11 22:07:57 +02:00
Jason Rhinelander fad5d3386c Detect c++ standard unconditionally
Currently select_cxx_standard(), which sets PYBIND11_CPP_STANDARD when
not externally set, is only called from pybind11_add_module(), but the
embed target setup (which runs unconditionally) makes use of
${PYBIND11_CPP_STANDARD}, which isn't set yet.  This commit removes the
`select_cxx_standard` function completely and just always runs the
standard detection code.

This also tweaks the detection code to not bothering checking for the
`-std=c++11` flag when the `-std=c++14` detection succeeded.
2017-07-16 11:01:00 -04:00
Dean Moldovan 7f5c85c861 Add CMake target for embedding the Python interpreter
All targets provided by pybind11:

* pybind11::module - the existing target for creating extension modules
* pybind11::embed - new target for embedding the interpreter
* pybind11::pybind11 - common "base" target (headers only)
2017-05-28 02:12:24 +02:00
Lori A. Burns 53a338c05a fix one lingering ::pybind11 --> ::module target name (#603) 2017-01-13 11:10:22 +01:00
Dean Moldovan 71e8a7962c Rename target from pybind11::pybind11 to pybind11::module
Makes room for an eventual pybind11::embedded target.
2016-12-19 16:34:48 +01:00
Lori A. Burns 5cafc99884 add CMake exported interface library and Config detection file 2016-12-13 21:44:19 +01:00