diff options
Diffstat (limited to '3rdparty/pybind11/tools')
| -rw-r--r-- | 3rdparty/pybind11/tools/FindCatch.cmake | 2 | ||||
| -rw-r--r-- | 3rdparty/pybind11/tools/FindEigen3.cmake | 3 | ||||
| -rw-r--r-- | 3rdparty/pybind11/tools/FindPythonLibsNew.cmake | 58 | ||||
| -rw-r--r-- | 3rdparty/pybind11/tools/JoinPaths.cmake | 23 | ||||
| -rwxr-xr-x | 3rdparty/pybind11/tools/check-style.sh | 6 | ||||
| -rw-r--r-- | 3rdparty/pybind11/tools/codespell_ignore_lines_from_errors.py | 35 | ||||
| -rw-r--r-- | 3rdparty/pybind11/tools/libsize.py | 6 | ||||
| -rwxr-xr-x | 3rdparty/pybind11/tools/make_changelog.py | 63 | ||||
| -rw-r--r-- | 3rdparty/pybind11/tools/pybind11.pc.in | 7 | ||||
| -rw-r--r-- | 3rdparty/pybind11/tools/pybind11Common.cmake | 86 | ||||
| -rw-r--r-- | 3rdparty/pybind11/tools/pybind11Config.cmake.in | 19 | ||||
| -rw-r--r-- | 3rdparty/pybind11/tools/pybind11NewTools.cmake | 104 | ||||
| -rw-r--r-- | 3rdparty/pybind11/tools/pybind11Tools.cmake | 125 | ||||
| -rw-r--r-- | 3rdparty/pybind11/tools/setup_global.py.in | 14 | ||||
| -rw-r--r-- | 3rdparty/pybind11/tools/setup_main.py.in | 12 | 
15 files changed, 379 insertions, 184 deletions
| diff --git a/3rdparty/pybind11/tools/FindCatch.cmake b/3rdparty/pybind11/tools/FindCatch.cmake index 4d6bffcf..57bba58b 100644 --- a/3rdparty/pybind11/tools/FindCatch.cmake +++ b/3rdparty/pybind11/tools/FindCatch.cmake @@ -9,6 +9,8 @@  #  CATCH_INCLUDE_DIR      - path to catch.hpp  #  CATCH_VERSION          - version number +option(DOWNLOAD_CATCH "Download catch2 if not found") +  if(NOT Catch_FIND_VERSION)    message(FATAL_ERROR "A version number must be specified.")  elseif(Catch_FIND_REQUIRED) diff --git a/3rdparty/pybind11/tools/FindEigen3.cmake b/3rdparty/pybind11/tools/FindEigen3.cmake index 98ab43d9..83625d92 100644 --- a/3rdparty/pybind11/tools/FindEigen3.cmake +++ b/3rdparty/pybind11/tools/FindEigen3.cmake @@ -64,6 +64,9 @@ if(EIGEN3_INCLUDE_DIR)    set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})  else(EIGEN3_INCLUDE_DIR) +  if(NOT DEFINED KDE4_INCLUDE_DIR) +    set(KDE4_INCLUDE_DIR "") +  endif()    find_path(      EIGEN3_INCLUDE_DIR diff --git a/3rdparty/pybind11/tools/FindPythonLibsNew.cmake b/3rdparty/pybind11/tools/FindPythonLibsNew.cmake index b7125912..a5a628fd 100644 --- a/3rdparty/pybind11/tools/FindPythonLibsNew.cmake +++ b/3rdparty/pybind11/tools/FindPythonLibsNew.cmake @@ -57,6 +57,8 @@ endif()  if(PythonLibsNew_FIND_QUIETLY)    set(_pythonlibs_quiet QUIET) +else() +  set(_pythonlibs_quiet "")  endif()  if(PythonLibsNew_FIND_REQUIRED) @@ -90,7 +92,7 @@ endif()  # Use the Python interpreter to find the libs.  if(NOT PythonLibsNew_FIND_VERSION) -  set(PythonLibsNew_FIND_VERSION "") +  set(PythonLibsNew_FIND_VERSION "3.6")  endif()  find_package(PythonInterp ${PythonLibsNew_FIND_VERSION} ${_pythonlibs_required} @@ -110,12 +112,26 @@ endif()  # VERSION. VERSION will typically be like "2.7" on unix, and "27" on windows.  execute_process(    COMMAND -    "${PYTHON_EXECUTABLE}" "-c" "from distutils import sysconfig as s;import sys;import struct; +    "${PYTHON_EXECUTABLE}" "-c" " +import sys;import struct; +import sysconfig as s +USE_SYSCONFIG = sys.version_info >= (3, 10) +if not USE_SYSCONFIG: +    from distutils import sysconfig as ds  print('.'.join(str(v) for v in sys.version_info));  print(sys.prefix); -print(s.get_python_inc(plat_specific=True)); -print(s.get_python_lib(plat_specific=True)); -print(s.get_config_var('EXT_SUFFIX') or s.get_config_var('SO')); +if USE_SYSCONFIG: +    scheme = s.get_default_scheme() +    if scheme == 'posix_local': +        # Debian's default scheme installs to /usr/local/ but we want to find headers in /usr/ +        scheme = 'posix_prefix' +    print(s.get_path('platinclude', scheme)) +    print(s.get_path('platlib')) +    print(s.get_config_var('EXT_SUFFIX') or s.get_config_var('SO')) +else: +    print(ds.get_python_inc(plat_specific=True)); +    print(ds.get_python_lib(plat_specific=True)); +    print(ds.get_config_var('EXT_SUFFIX') or ds.get_config_var('SO'));  print(hasattr(sys, 'gettotalrefcount')+0);  print(struct.calcsize('@P'));  print(s.get_config_var('LDVERSION') or s.get_config_var('VERSION')); @@ -135,26 +151,36 @@ if(NOT _PYTHON_SUCCESS MATCHES 0)    return()  endif() +# Can manually set values when cross-compiling +macro(_PYBIND11_GET_IF_UNDEF lst index name) +  if(NOT DEFINED "${name}") +    list(GET "${lst}" "${index}" "${name}") +  endif() +endmacro() +  # Convert the process output into a list  if(WIN32)    string(REGEX REPLACE "\\\\" "/" _PYTHON_VALUES ${_PYTHON_VALUES})  endif()  string(REGEX REPLACE ";" "\\\\;" _PYTHON_VALUES ${_PYTHON_VALUES})  string(REGEX REPLACE "\n" ";" _PYTHON_VALUES ${_PYTHON_VALUES}) -list(GET _PYTHON_VALUES 0 _PYTHON_VERSION_LIST) -list(GET _PYTHON_VALUES 1 PYTHON_PREFIX) -list(GET _PYTHON_VALUES 2 PYTHON_INCLUDE_DIR) -list(GET _PYTHON_VALUES 3 PYTHON_SITE_PACKAGES) -list(GET _PYTHON_VALUES 4 PYTHON_MODULE_EXTENSION) -list(GET _PYTHON_VALUES 5 PYTHON_IS_DEBUG) -list(GET _PYTHON_VALUES 6 PYTHON_SIZEOF_VOID_P) -list(GET _PYTHON_VALUES 7 PYTHON_LIBRARY_SUFFIX) -list(GET _PYTHON_VALUES 8 PYTHON_LIBDIR) -list(GET _PYTHON_VALUES 9 PYTHON_MULTIARCH) +_pybind11_get_if_undef(_PYTHON_VALUES 0 _PYTHON_VERSION_LIST) +_pybind11_get_if_undef(_PYTHON_VALUES 1 PYTHON_PREFIX) +_pybind11_get_if_undef(_PYTHON_VALUES 2 PYTHON_INCLUDE_DIR) +_pybind11_get_if_undef(_PYTHON_VALUES 3 PYTHON_SITE_PACKAGES) +_pybind11_get_if_undef(_PYTHON_VALUES 4 PYTHON_MODULE_EXTENSION) +_pybind11_get_if_undef(_PYTHON_VALUES 5 PYTHON_IS_DEBUG) +_pybind11_get_if_undef(_PYTHON_VALUES 6 PYTHON_SIZEOF_VOID_P) +_pybind11_get_if_undef(_PYTHON_VALUES 7 PYTHON_LIBRARY_SUFFIX) +_pybind11_get_if_undef(_PYTHON_VALUES 8 PYTHON_LIBDIR) +_pybind11_get_if_undef(_PYTHON_VALUES 9 PYTHON_MULTIARCH)  # Make sure the Python has the same pointer-size as the chosen compiler  # Skip if CMAKE_SIZEOF_VOID_P is not defined -if(CMAKE_SIZEOF_VOID_P AND (NOT "${PYTHON_SIZEOF_VOID_P}" STREQUAL "${CMAKE_SIZEOF_VOID_P}")) +# This should be skipped for (non-Apple) cross-compiles (like EMSCRIPTEN) +if(NOT CMAKE_CROSSCOMPILING +   AND CMAKE_SIZEOF_VOID_P +   AND (NOT "${PYTHON_SIZEOF_VOID_P}" STREQUAL "${CMAKE_SIZEOF_VOID_P}"))    if(PythonLibsNew_FIND_REQUIRED)      math(EXPR _PYTHON_BITS "${PYTHON_SIZEOF_VOID_P} * 8")      math(EXPR _CMAKE_BITS "${CMAKE_SIZEOF_VOID_P} * 8") diff --git a/3rdparty/pybind11/tools/JoinPaths.cmake b/3rdparty/pybind11/tools/JoinPaths.cmake new file mode 100644 index 00000000..c68d91b8 --- /dev/null +++ b/3rdparty/pybind11/tools/JoinPaths.cmake @@ -0,0 +1,23 @@ +# This module provides function for joining paths +# known from most languages +# +# SPDX-License-Identifier: (MIT OR CC0-1.0) +# Copyright 2020 Jan Tojnar +# https://github.com/jtojnar/cmake-snips +# +# Modelled after Python’s os.path.join +# https://docs.python.org/3.7/library/os.path.html#os.path.join +# Windows not supported +function(join_paths joined_path first_path_segment) +    set(temp_path "${first_path_segment}") +    foreach(current_segment IN LISTS ARGN) +        if(NOT ("${current_segment}" STREQUAL "")) +            if(IS_ABSOLUTE "${current_segment}") +                set(temp_path "${current_segment}") +            else() +                set(temp_path "${temp_path}/${current_segment}") +            endif() +        endif() +    endforeach() +    set(${joined_path} "${temp_path}" PARENT_SCOPE) +endfunction() diff --git a/3rdparty/pybind11/tools/check-style.sh b/3rdparty/pybind11/tools/check-style.sh index f7af2a41..6d832523 100755 --- a/3rdparty/pybind11/tools/check-style.sh +++ b/3rdparty/pybind11/tools/check-style.sh @@ -16,11 +16,11 @@ check_style_errors=0  IFS=$'\n' -found="$(grep '\<\(if\|for\|while\|catch\)(\|){' $@ -rn --color=always)" +found="$(grep '\<\(if\|for\|while\|catch\)(\|){' "$@" -rn --color=always)"  if [ -n "$found" ]; then      echo -e '\033[31;01mError: found the following coding style problems:\033[0m'      check_style_errors=1 -    echo "$found" | sed -e 's/^/    /' +    echo "${found//^/    /}"  fi  found="$(awk ' @@ -34,7 +34,7 @@ last && /^\s*{/ {      last=""  }  { last = /(if|for|while|catch|switch)\s*\(.*\)\s*$/ ? $0 : "" } -' $(find include -type f) $@)" +' "$(find include -type f)" "$@")"  if [ -n "$found" ]; then      check_style_errors=1      echo -e '\033[31;01mError: braces should occur on the same line as the if/while/.. statement. Found issues in the following files:\033[0m' diff --git a/3rdparty/pybind11/tools/codespell_ignore_lines_from_errors.py b/3rdparty/pybind11/tools/codespell_ignore_lines_from_errors.py new file mode 100644 index 00000000..5403ec3a --- /dev/null +++ b/3rdparty/pybind11/tools/codespell_ignore_lines_from_errors.py @@ -0,0 +1,35 @@ +"""Simple script for rebuilding .codespell-ignore-lines + +Usage: + +cat < /dev/null > .codespell-ignore-lines +pre-commit run --all-files codespell >& /tmp/codespell_errors.txt +python3 tools/codespell_ignore_lines_from_errors.py /tmp/codespell_errors.txt > .codespell-ignore-lines + +git diff to review changes, then commit, push. +""" + +import sys +from typing import List + + +def run(args: List[str]) -> None: +    assert len(args) == 1, "codespell_errors.txt" +    cache = {} +    done = set() +    for line in sorted(open(args[0]).read().splitlines()): +        i = line.find(" ==> ") +        if i > 0: +            flds = line[:i].split(":") +            if len(flds) >= 2: +                filename, line_num = flds[:2] +                if filename not in cache: +                    cache[filename] = open(filename).read().splitlines() +                supp = cache[filename][int(line_num) - 1] +                if supp not in done: +                    print(supp) +                    done.add(supp) + + +if __name__ == "__main__": +    run(args=sys.argv[1:]) diff --git a/3rdparty/pybind11/tools/libsize.py b/3rdparty/pybind11/tools/libsize.py index 589c317f..1ac9afbe 100644 --- a/3rdparty/pybind11/tools/libsize.py +++ b/3rdparty/pybind11/tools/libsize.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import print_function, division  import os  import sys @@ -15,7 +13,7 @@ lib = sys.argv[1]  save = sys.argv[2]  if not os.path.exists(lib): -    sys.exit("Error: requested file ({}) does not exist".format(lib)) +    sys.exit(f"Error: requested file ({lib}) does not exist")  libsize = os.path.getsize(lib) @@ -30,7 +28,7 @@ if os.path.exists(save):          if change == 0:              print(" (no change)")          else: -            print(" (change of {:+} bytes = {:+.2%})".format(change, change / oldsize)) +            print(f" (change of {change:+} bytes = {change / oldsize:+.2%})")  else:      print() diff --git a/3rdparty/pybind11/tools/make_changelog.py b/3rdparty/pybind11/tools/make_changelog.py new file mode 100755 index 00000000..839040a9 --- /dev/null +++ b/3rdparty/pybind11/tools/make_changelog.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 + +import re + +import ghapi.all +from rich import print +from rich.syntax import Syntax + +ENTRY = re.compile( +    r""" +    Suggested \s changelog \s entry: +    .* +    ```rst +    \s* +    (.*?) +    \s* +    ``` +""", +    re.DOTALL | re.VERBOSE, +) + +print() + + +api = ghapi.all.GhApi(owner="pybind", repo="pybind11") + +issues_pages = ghapi.page.paged( +    api.issues.list_for_repo, labels="needs changelog", state="closed" +) +issues = (issue for page in issues_pages for issue in page) +missing = [] + +for issue in issues: +    changelog = ENTRY.findall(issue.body) +    if changelog: +        (msg,) = changelog +        if not msg.startswith("* "): +            msg = "* " + msg +        if not msg.endswith("."): +            msg += "." + +        msg += f"\n  `#{issue.number} <{issue.html_url}>`_" + +        print(Syntax(msg, "rst", theme="ansi_light", word_wrap=True)) +        print() + +    else: +        missing.append(issue) + +if missing: +    print() +    print("[blue]" + "-" * 30) +    print() + +    for issue in missing: +        print(f"[red bold]Missing:[/red bold][red] {issue.title}") +        print(f"[red]  {issue.html_url}\n") + +    print("[bold]Template:\n") +    msg = "## Suggested changelog entry:\n\n```rst\n\n```" +    print(Syntax(msg, "md", theme="ansi_light")) + +print() diff --git a/3rdparty/pybind11/tools/pybind11.pc.in b/3rdparty/pybind11/tools/pybind11.pc.in new file mode 100644 index 00000000..402f0b35 --- /dev/null +++ b/3rdparty/pybind11/tools/pybind11.pc.in @@ -0,0 +1,7 @@ +prefix=@prefix_for_pc_file@ +includedir=@includedir_for_pc_file@ + +Name: @PROJECT_NAME@ +Description: Seamless operability between C++11 and Python +Version: @PROJECT_VERSION@ +Cflags: -I${includedir} diff --git a/3rdparty/pybind11/tools/pybind11Common.cmake b/3rdparty/pybind11/tools/pybind11Common.cmake index 3c05c682..e1fb601a 100644 --- a/3rdparty/pybind11/tools/pybind11Common.cmake +++ b/3rdparty/pybind11/tools/pybind11Common.cmake @@ -8,7 +8,6 @@ Adds the following targets::      pybind11::lto - Link time optimizations (manual selection)      pybind11::thin_lto - Link time optimizations (manual selection)      pybind11::python_link_helper - Adds link to Python libraries -    pybind11::python2_no_register - Avoid warning/error with Python 2 + C++14/7      pybind11::windows_extras - MSVC bigobj and mp for building multithreaded      pybind11::opt_size - avoid optimizations that increase code size @@ -20,6 +19,7 @@ Adds the following functions::  #]======================================================]  # CMake 3.10 has an include_guard command, but we can't use that yet +# include_guard(global) (pre-CMake 3.10)  if(TARGET pybind11::lto)    return()  endif() @@ -65,31 +65,6 @@ set_property(    APPEND    PROPERTY INTERFACE_LINK_LIBRARIES pybind11::pybind11) -# ----------------------- no register ---------------------- - -# Workaround for Python 2.7 and C++17 (C++14 as a warning) incompatibility -# This adds the flags -Wno-register and -Wno-deprecated-register if the compiler -# is Clang 3.9+ or AppleClang and the compile language is CXX, or /wd5033 for MSVC (all languages, -# since MSVC didn't recognize COMPILE_LANGUAGE until CMake 3.11+). - -add_library(pybind11::python2_no_register INTERFACE IMPORTED ${optional_global}) -set(clang_4plus -    "$<AND:$<CXX_COMPILER_ID:Clang>,$<NOT:$<VERSION_LESS:$<CXX_COMPILER_VERSION>,3.9>>>") -set(no_register "$<OR:${clang_4plus},$<CXX_COMPILER_ID:AppleClang>>") - -if(MSVC AND CMAKE_VERSION VERSION_LESS 3.11) -  set(cxx_no_register "${no_register}") -else() -  set(cxx_no_register "$<AND:$<COMPILE_LANGUAGE:CXX>,${no_register}>") -endif() - -set(msvc "$<CXX_COMPILER_ID:MSVC>") - -set_property( -  TARGET pybind11::python2_no_register -  PROPERTY INTERFACE_COMPILE_OPTIONS -           "$<${cxx_no_register}:-Wno-register;-Wno-deprecated-register>" "$<${msvc}:/wd5033>") -  # --------------------------- link helper ---------------------------  add_library(pybind11::python_link_helper IMPORTED INTERFACE ${optional_global}) @@ -115,28 +90,32 @@ endif()  add_library(pybind11::windows_extras IMPORTED INTERFACE ${optional_global}) -if(MSVC) -  # /MP enables multithreaded builds (relevant when there are many files), /bigobj is -  # needed for bigger binding projects due to the limit to 64k addressable sections +if(MSVC) # That's also clang-cl +  # /bigobj is needed for bigger binding projects due to the limit to 64k +  # addressable sections    set_property(      TARGET pybind11::windows_extras      APPEND -    PROPERTY INTERFACE_COMPILE_OPTIONS /bigobj) +    PROPERTY INTERFACE_COMPILE_OPTIONS $<$<COMPILE_LANGUAGE:CXX>:/bigobj>) -  if(CMAKE_VERSION VERSION_LESS 3.11) -    set_property( -      TARGET pybind11::windows_extras -      APPEND -      PROPERTY INTERFACE_COMPILE_OPTIONS $<$<NOT:$<CONFIG:Debug>>:/MP>) -  else() -    # Only set these options for C++ files.  This is important so that, for -    # instance, projects that include other types of source files like CUDA -    # .cu files don't get these options propagated to nvcc since that would -    # cause the build to fail. -    set_property( -      TARGET pybind11::windows_extras -      APPEND -      PROPERTY INTERFACE_COMPILE_OPTIONS $<$<NOT:$<CONFIG:Debug>>:$<$<COMPILE_LANGUAGE:CXX>:/MP>>) +  # /MP enables multithreaded builds (relevant when there are many files) for MSVC +  if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # no Clang no Intel +    if(CMAKE_VERSION VERSION_LESS 3.11) +      set_property( +        TARGET pybind11::windows_extras +        APPEND +        PROPERTY INTERFACE_COMPILE_OPTIONS $<$<NOT:$<CONFIG:Debug>>:/MP>) +    else() +      # Only set these options for C++ files.  This is important so that, for +      # instance, projects that include other types of source files like CUDA +      # .cu files don't get these options propagated to nvcc since that would +      # cause the build to fail. +      set_property( +        TARGET pybind11::windows_extras +        APPEND +        PROPERTY INTERFACE_COMPILE_OPTIONS +                 $<$<NOT:$<CONFIG:Debug>>:$<$<COMPILE_LANGUAGE:CXX>:/MP>>) +    endif()    endif()  endif() @@ -298,23 +277,36 @@ function(_pybind11_return_if_cxx_and_linker_flags_work result cxxflags linkerfla  endfunction()  function(_pybind11_generate_lto target prefer_thin_lto) +  if(MINGW) +    message(STATUS "${target} disabled (problems with undefined symbols for MinGW for now)") +    return() +  endif() +    if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")      set(cxx_append "")      set(linker_append "")      if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT APPLE)        # Clang Gold plugin does not support -Os; append -O3 to MinSizeRel builds to override it        set(linker_append ";$<$<CONFIG:MinSizeRel>:-O3>") -    elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") +    elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND NOT MINGW)        set(cxx_append ";-fno-fat-lto-objects")      endif() -    if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND prefer_thin_lto) +    if(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le" OR CMAKE_SYSTEM_PROCESSOR MATCHES "mips64") +      set(NO_FLTO_ARCH TRUE) +    else() +      set(NO_FLTO_ARCH FALSE) +    endif() + +    if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" +       AND prefer_thin_lto +       AND NOT NO_FLTO_ARCH)        _pybind11_return_if_cxx_and_linker_flags_work(          HAS_FLTO_THIN "-flto=thin${cxx_append}" "-flto=thin${linker_append}"          PYBIND11_LTO_CXX_FLAGS PYBIND11_LTO_LINKER_FLAGS)      endif() -    if(NOT HAS_FLTO_THIN) +    if(NOT HAS_FLTO_THIN AND NOT NO_FLTO_ARCH)        _pybind11_return_if_cxx_and_linker_flags_work(          HAS_FLTO "-flto${cxx_append}" "-flto${linker_append}" PYBIND11_LTO_CXX_FLAGS          PYBIND11_LTO_LINKER_FLAGS) diff --git a/3rdparty/pybind11/tools/pybind11Config.cmake.in b/3rdparty/pybind11/tools/pybind11Config.cmake.in index 9808f3d2..9383e8c6 100644 --- a/3rdparty/pybind11/tools/pybind11Config.cmake.in +++ b/3rdparty/pybind11/tools/pybind11Config.cmake.in @@ -13,7 +13,7 @@ This module sets the following variables in your project:  ``pybind11_VERSION``    pybind11 version in format Major.Minor.Release  ``pybind11_VERSION_TYPE`` -  pybind11 version type (dev, release) +  pybind11 version type (``dev*`` or empty for a release)  ``pybind11_INCLUDE_DIRS``    Directories where pybind11 and python headers are located.  ``pybind11_INCLUDE_DIR`` @@ -51,8 +51,6 @@ complex applications, and they are available in all modes:    Python headers too.  ``pybind11::python_link_helper``    Just the "linking" part of ``pybind11:module``, for CMake < 3.15. -``pybind11::python2_no_register`` -  Quiets the warning/error when mixing C++14+ and Python 2, also included in ``pybind11::module``.  ``pybind11::thin_lto``    An alternative to ``INTERPROCEDURAL_OPTIMIZATION``.  ``pybind11::lto`` @@ -87,8 +85,8 @@ you can either use the basic targets, or use the FindPython tools:    target_link_libraries(MyModule2 pybind11::headers)    set_target_properties(MyModule2 PROPERTIES                                    INTERPROCEDURAL_OPTIMIZATION ON -                                  CXX__VISIBILITY_PRESET ON -                                  VISIBLITY_INLINES_HIDDEN ON) +                                  CXX_VISIBILITY_PRESET ON +                                  VISIBILITY_INLINES_HIDDEN ON)  If you build targets yourself, you may be interested in stripping the output  for reduced size; this is the one other feature that the helper function gives you. @@ -139,7 +137,7 @@ This module defines the following commands to assist with creating Python module    pybind11_add_module(<target>      [STATIC|SHARED|MODULE] -    [THIN_LTO] [OPT_SIZE] [NO_EXTRAS] [WITHOUT_SOBAI] +    [THIN_LTO] [OPT_SIZE] [NO_EXTRAS] [WITHOUT_SOABI]      <files>...      ) @@ -147,7 +145,7 @@ Add a module and setup all helpers. You can select the type of the library; the  default is ``MODULE``. There are several options:  ``OPT_SIZE`` -  Optimize for size, even if the ``CMAKE_BUILD_TYPE`` is not ``RelSize``. +  Optimize for size, even if the ``CMAKE_BUILD_TYPE`` is not ``MinSizeRel``.  ``THIN_LTO``    Use thin TLO instead of regular if there's a choice (pybind11's selection    is disabled if ``CMAKE_INTERPROCEDURAL_OPTIMIZATIONS`` is set). @@ -195,13 +193,14 @@ Using ``find_package`` with version info is not recommended except for release v  .. code-block:: cmake    find_package(pybind11 CONFIG) -  find_package(pybind11 2.0 EXACT CONFIG REQUIRED) +  find_package(pybind11 2.9 EXACT CONFIG REQUIRED)  #]=============================================================================]  @PACKAGE_INIT@  # Location of pybind11/pybind11.h -set(pybind11_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@") +# This will be relative unless explicitly set as absolute +set(pybind11_INCLUDE_DIR "@pybind11_INCLUDEDIR@")  set(pybind11_LIBRARY "")  set(pybind11_DEFINITIONS USING_pybind11) @@ -227,6 +226,6 @@ include("${CMAKE_CURRENT_LIST_DIR}/pybind11Common.cmake")  if(NOT pybind11_FIND_QUIETLY)    message(      STATUS -      "Found pybind11: ${pybind11_INCLUDE_DIR} (found version \"${pybind11_VERSION}\" ${pybind11_VERSION_TYPE})" +      "Found pybind11: ${pybind11_INCLUDE_DIR} (found version \"${pybind11_VERSION}${pybind11_VERSION_TYPE}\")"    )  endif() diff --git a/3rdparty/pybind11/tools/pybind11NewTools.cmake b/3rdparty/pybind11/tools/pybind11NewTools.cmake index 357cc61c..9e13daf1 100644 --- a/3rdparty/pybind11/tools/pybind11NewTools.cmake +++ b/3rdparty/pybind11/tools/pybind11NewTools.cmake @@ -5,6 +5,12 @@  # All rights reserved. Use of this source code is governed by a  # BSD-style license that can be found in the LICENSE file. +if(CMAKE_VERSION VERSION_LESS 3.12) +  message(FATAL_ERROR "You cannot use the new FindPython module with CMake < 3.12") +endif() + +include_guard(GLOBAL) +  get_property(    is_config    TARGET pybind11::headers @@ -12,15 +18,11 @@ get_property(  if(pybind11_FIND_QUIETLY)    set(_pybind11_quiet QUIET) +else() +  set(_pybind11_quiet "")  endif() -if(CMAKE_VERSION VERSION_LESS 3.12) -  message(FATAL_ERROR "You cannot use the new FindPython module with CMake < 3.12") -endif() - -if(NOT Python_FOUND -   AND NOT Python3_FOUND -   AND NOT Python2_FOUND) +if(NOT Python_FOUND AND NOT Python3_FOUND)    if(NOT DEFINED Python_FIND_IMPLEMENTATIONS)      set(Python_FIND_IMPLEMENTATIONS CPython PyPy)    endif() @@ -30,7 +32,7 @@ if(NOT Python_FOUND      set(Python_ROOT_DIR "$ENV{pythonLocation}")    endif() -  find_package(Python REQUIRED COMPONENTS Interpreter Development ${_pybind11_quiet}) +  find_package(Python 3.6 REQUIRED COMPONENTS Interpreter Development ${_pybind11_quiet})    # If we are in submodule mode, export the Python targets to global targets.    # If this behavior is not desired, FindPython _before_ pybind11. @@ -47,19 +49,10 @@ if(Python_FOUND)    set(_Python        Python        CACHE INTERNAL "" FORCE) -elseif(Python3_FOUND AND NOT Python2_FOUND) +elseif(Python3_FOUND)    set(_Python        Python3        CACHE INTERNAL "" FORCE) -elseif(Python2_FOUND AND NOT Python3_FOUND) -  set(_Python -      Python2 -      CACHE INTERNAL "" FORCE) -else() -  message(AUTHOR_WARNING "Python2 and Python3 both present, pybind11 in " -                         "PYBIND11_NOPYTHON mode (manually activate to silence warning)") -  set(_pybind11_nopython ON) -  return()  endif()  if(PYBIND11_MASTER_PROJECT) @@ -80,6 +73,15 @@ if(NOT DEFINED ${_Python}_EXECUTABLE)  endif() +if(NOT ${_Python}_EXECUTABLE STREQUAL PYBIND11_PYTHON_EXECUTABLE_LAST) +  # Detect changes to the Python version/binary in subsequent CMake runs, and refresh config if needed +  unset(PYTHON_IS_DEBUG CACHE) +  unset(PYTHON_MODULE_EXTENSION CACHE) +  set(PYBIND11_PYTHON_EXECUTABLE_LAST +      "${${_Python}_EXECUTABLE}" +      CACHE INTERNAL "Python executable during the last CMake run") +endif() +  if(NOT DEFINED PYTHON_IS_DEBUG)    # Debug check - see https://stackoverflow.com/questions/646518/python-how-to-detect-debug-Interpreter    execute_process( @@ -97,7 +99,7 @@ if(NOT DEFINED PYTHON_MODULE_EXTENSION)    execute_process(      COMMAND        "${${_Python}_EXECUTABLE}" "-c" -      "from distutils import sysconfig as s;print(s.get_config_var('EXT_SUFFIX') or s.get_config_var('SO'))" +      "import sys, importlib; s = importlib.import_module('distutils.sysconfig' if sys.version_info < (3, 10) else 'sysconfig'); print(s.get_config_var('EXT_SUFFIX') or s.get_config_var('SO'))"      OUTPUT_VARIABLE _PYTHON_MODULE_EXTENSION      ERROR_VARIABLE _PYTHON_MODULE_EXTENSION_ERR      OUTPUT_STRIP_TRAILING_WHITESPACE) @@ -124,31 +126,34 @@ if(PYTHON_IS_DEBUG)      PROPERTY INTERFACE_COMPILE_DEFINITIONS Py_DEBUG)  endif() -# Check on every access - since Python2 and Python3 could have been used - do nothing in that case. +# Check on every access - since Python can change - do nothing in that case.  if(DEFINED ${_Python}_INCLUDE_DIRS) +  # Only add Python for build - must be added during the import for config +  # since it has to be re-discovered. +  # +  # This needs to be a target to be included after the local pybind11 +  # directory, just in case there there is an installed pybind11 sitting +  # next to Python's includes. It also ensures Python is a SYSTEM library. +  add_library(pybind11::python_headers INTERFACE IMPORTED) +  set_property( +    TARGET pybind11::python_headers PROPERTY INTERFACE_INCLUDE_DIRECTORIES +                                             "$<BUILD_INTERFACE:${${_Python}_INCLUDE_DIRS}>")    set_property(      TARGET pybind11::pybind11      APPEND -    PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<BUILD_INTERFACE:${${_Python}_INCLUDE_DIRS}>) +    PROPERTY INTERFACE_LINK_LIBRARIES pybind11::python_headers)    set(pybind11_INCLUDE_DIRS        "${pybind11_INCLUDE_DIR}" "${${_Python}_INCLUDE_DIRS}"        CACHE INTERNAL "Directories where pybind11 and possibly Python headers are located")  endif() -if(DEFINED ${_Python}_VERSION AND ${_Python}_VERSION VERSION_LESS 3) -  set_property( -    TARGET pybind11::pybind11 -    APPEND -    PROPERTY INTERFACE_LINK_LIBRARIES pybind11::python2_no_register) -endif() -  # In CMake 3.18+, you can find these separately, so include an if -if(TARGET ${_Python}::${_Python}) +if(TARGET ${_Python}::Python)    set_property(      TARGET pybind11::embed      APPEND -    PROPERTY INTERFACE_LINK_LIBRARIES ${_Python}::${_Python}) +    PROPERTY INTERFACE_LINK_LIBRARIES ${_Python}::Python)  endif()  # CMake 3.15+ has this @@ -170,27 +175,25 @@ function(pybind11_add_module target_name)    cmake_parse_arguments(PARSE_ARGV 1 ARG                          "STATIC;SHARED;MODULE;THIN_LTO;OPT_SIZE;NO_EXTRAS;WITHOUT_SOABI" "" "") -  if(ARG_ADD_LIBRARY_STATIC) -    set(type STATIC) -  elseif(ARG_ADD_LIBRARY_SHARED) -    set(type SHARED) +  if(ARG_STATIC) +    set(lib_type STATIC) +  elseif(ARG_SHARED) +    set(lib_type SHARED)    else() -    set(type MODULE) +    set(lib_type MODULE)    endif()    if("${_Python}" STREQUAL "Python") -    python_add_library(${target_name} ${type} ${ARG_UNPARSED_ARGUMENTS}) +    python_add_library(${target_name} ${lib_type} ${ARG_UNPARSED_ARGUMENTS})    elseif("${_Python}" STREQUAL "Python3") -    python3_add_library(${target_name} ${type} ${ARG_UNPARSED_ARGUMENTS}) -  elseif("${_Python}" STREQUAL "Python2") -    python2_add_library(${target_name} ${type} ${ARG_UNPARSED_ARGUMENTS}) +    python3_add_library(${target_name} ${lib_type} ${ARG_UNPARSED_ARGUMENTS})    else()      message(FATAL_ERROR "Cannot detect FindPython version: ${_Python}")    endif()    target_link_libraries(${target_name} PRIVATE pybind11::headers) -  if(type STREQUAL "MODULE") +  if(lib_type STREQUAL "MODULE")      target_link_libraries(${target_name} PRIVATE pybind11::module)    else()      target_link_libraries(${target_name} PRIVATE pybind11::embed) @@ -200,16 +203,21 @@ function(pybind11_add_module target_name)      target_link_libraries(${target_name} PRIVATE pybind11::windows_extras)    endif() -  if(DEFINED ${_Python}_VERSION AND ${_Python}_VERSION VERSION_LESS 3) -    target_link_libraries(${target_name} PRIVATE pybind11::python2_no_register) +  # -fvisibility=hidden is required to allow multiple modules compiled against +  # different pybind versions to work properly, and for some features (e.g. +  # py::module_local).  We force it on everything inside the `pybind11` +  # namespace; also turning it on for a pybind module compilation here avoids +  # potential warnings or issues from having mixed hidden/non-hidden types. +  if(NOT DEFINED CMAKE_CXX_VISIBILITY_PRESET) +    set_target_properties(${target_name} PROPERTIES CXX_VISIBILITY_PRESET "hidden")    endif() -  set_target_properties(${target_name} PROPERTIES CXX_VISIBILITY_PRESET "hidden" -                                                  CUDA_VISIBILITY_PRESET "hidden") +  if(NOT DEFINED CMAKE_CUDA_VISIBILITY_PRESET) +    set_target_properties(${target_name} PROPERTIES CUDA_VISIBILITY_PRESET "hidden") +  endif()    # If we don't pass a WITH_SOABI or WITHOUT_SOABI, use our own default handling of extensions -  if("${type}" STREQUAL "MODULE" AND (NOT ARG_WITHOUT_SOABI OR NOT "WITH_SOABI" IN_LIST -                                                               ARG_UNPARSED_ARGUMENTS)) +  if(NOT ARG_WITHOUT_SOABI AND NOT "WITH_SOABI" IN_LIST ARG_UNPARSED_ARGUMENTS)      pybind11_extension(${target_name})    endif() @@ -225,7 +233,9 @@ function(pybind11_add_module target_name)      endif()    endif() -  if(NOT MSVC AND NOT ${CMAKE_BUILD_TYPE} MATCHES Debug|RelWithDebInfo) +  # Use case-insensitive comparison to match the result of $<CONFIG:cfgs> +  string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE) +  if(NOT MSVC AND NOT ${uppercase_CMAKE_BUILD_TYPE} MATCHES DEBUG|RELWITHDEBINFO)      # Strip unnecessary sections of the binary on Linux/macOS      pybind11_strip(${target_name})    endif() diff --git a/3rdparty/pybind11/tools/pybind11Tools.cmake b/3rdparty/pybind11/tools/pybind11Tools.cmake index 23cff98e..0dc61d39 100644 --- a/3rdparty/pybind11/tools/pybind11Tools.cmake +++ b/3rdparty/pybind11/tools/pybind11Tools.cmake @@ -5,11 +5,18 @@  # All rights reserved. Use of this source code is governed by a  # BSD-style license that can be found in the LICENSE file. +# include_guard(global) (pre-CMake 3.10) +if(TARGET pybind11::python_headers) +  return() +endif() +  # Built-in in CMake 3.5+  include(CMakeParseArguments)  if(pybind11_FIND_QUIETLY)    set(_pybind11_quiet QUIET) +else() +  set(_pybind11_quiet "")  endif()  # If this is the first run, PYTHON_VERSION can stand in for PYBIND11_PYTHON_VERSION @@ -22,47 +29,46 @@ if(NOT DEFINED PYBIND11_PYTHON_VERSION AND DEFINED PYTHON_VERSION)        CACHE STRING "Python version to use for compiling modules")    unset(PYTHON_VERSION)    unset(PYTHON_VERSION CACHE) -else() -  # If this is set as a normal variable, promote it, otherwise, make an empty cache variable. +elseif(DEFINED PYBIND11_PYTHON_VERSION) +  # If this is set as a normal variable, promote it    set(PYBIND11_PYTHON_VERSION        "${PYBIND11_PYTHON_VERSION}"        CACHE STRING "Python version to use for compiling modules") +else() +  # Make an empty cache variable. +  set(PYBIND11_PYTHON_VERSION +      "" +      CACHE STRING "Python version to use for compiling modules")  endif()  # A user can set versions manually too  set(Python_ADDITIONAL_VERSIONS -    "3.9;3.8;3.7;3.6;3.5;3.4" +    "3.11;3.10;3.9;3.8;3.7;3.6"      CACHE INTERNAL "")  list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")  find_package(PythonLibsNew ${PYBIND11_PYTHON_VERSION} MODULE REQUIRED ${_pybind11_quiet})  list(REMOVE_AT CMAKE_MODULE_PATH -1) +# Makes a normal variable a cached variable +macro(_PYBIND11_PROMOTE_TO_CACHE NAME) +  set(_tmp_ptc "${${NAME}}") +  # CMake 3.21 complains if a cached variable is shadowed by a normal one +  unset(${NAME}) +  set(${NAME} +      "${_tmp_ptc}" +      CACHE INTERNAL "") +endmacro() +  # Cache variables so pybind11_add_module can be used in parent projects -set(PYTHON_INCLUDE_DIRS -    ${PYTHON_INCLUDE_DIRS} -    CACHE INTERNAL "") -set(PYTHON_LIBRARIES -    ${PYTHON_LIBRARIES} -    CACHE INTERNAL "") -set(PYTHON_MODULE_PREFIX -    ${PYTHON_MODULE_PREFIX} -    CACHE INTERNAL "") -set(PYTHON_MODULE_EXTENSION -    ${PYTHON_MODULE_EXTENSION} -    CACHE INTERNAL "") -set(PYTHON_VERSION_MAJOR -    ${PYTHON_VERSION_MAJOR} -    CACHE INTERNAL "") -set(PYTHON_VERSION_MINOR -    ${PYTHON_VERSION_MINOR} -    CACHE INTERNAL "") -set(PYTHON_VERSION -    ${PYTHON_VERSION} -    CACHE INTERNAL "") -set(PYTHON_IS_DEBUG -    "${PYTHON_IS_DEBUG}" -    CACHE INTERNAL "") +_pybind11_promote_to_cache(PYTHON_INCLUDE_DIRS) +_pybind11_promote_to_cache(PYTHON_LIBRARIES) +_pybind11_promote_to_cache(PYTHON_MODULE_PREFIX) +_pybind11_promote_to_cache(PYTHON_MODULE_EXTENSION) +_pybind11_promote_to_cache(PYTHON_VERSION_MAJOR) +_pybind11_promote_to_cache(PYTHON_VERSION_MINOR) +_pybind11_promote_to_cache(PYTHON_VERSION) +_pybind11_promote_to_cache(PYTHON_IS_DEBUG)  if(PYBIND11_MASTER_PROJECT)    if(PYTHON_MODULE_EXTENSION MATCHES "pypy") @@ -81,11 +87,19 @@ if(PYBIND11_MASTER_PROJECT)    endif()  endif() -# Only add Python for build - must be added during the import for config since it has to be re-discovered. +# Only add Python for build - must be added during the import for config since +# it has to be re-discovered. +# +# This needs to be an target to it is included after the local pybind11 +# directory, just in case there are multiple versions of pybind11, we want the +# one we expect. +add_library(pybind11::python_headers INTERFACE IMPORTED) +set_property(TARGET pybind11::python_headers PROPERTY INTERFACE_INCLUDE_DIRECTORIES +                                                      "$<BUILD_INTERFACE:${PYTHON_INCLUDE_DIRS}>")  set_property(    TARGET pybind11::pybind11    APPEND -  PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<BUILD_INTERFACE:${PYTHON_INCLUDE_DIRS}>) +  PROPERTY INTERFACE_LINK_LIBRARIES pybind11::python_headers)  set(pybind11_INCLUDE_DIRS      "${pybind11_INCLUDE_DIR}" "${PYTHON_INCLUDE_DIRS}" @@ -101,25 +115,37 @@ if(PYTHON_IS_DEBUG)      PROPERTY INTERFACE_COMPILE_DEFINITIONS Py_DEBUG)  endif() -set_property( -  TARGET pybind11::module -  APPEND -  PROPERTY -    INTERFACE_LINK_LIBRARIES pybind11::python_link_helper -    "$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:Cygwin>>:$<BUILD_INTERFACE:${PYTHON_LIBRARIES}>>") +# The <3.11 code here does not support release/debug builds at the same time, like on vcpkg +if(CMAKE_VERSION VERSION_LESS 3.11) +  set_property( +    TARGET pybind11::module +    APPEND +    PROPERTY +      INTERFACE_LINK_LIBRARIES +      pybind11::python_link_helper +      "$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:Cygwin>>:$<BUILD_INTERFACE:${PYTHON_LIBRARIES}>>" +  ) -if(PYTHON_VERSION VERSION_LESS 3)    set_property( -    TARGET pybind11::pybind11 +    TARGET pybind11::embed      APPEND -    PROPERTY INTERFACE_LINK_LIBRARIES pybind11::python2_no_register) +    PROPERTY INTERFACE_LINK_LIBRARIES pybind11::pybind11 $<BUILD_INTERFACE:${PYTHON_LIBRARIES}>) +else() +  # The IMPORTED INTERFACE library here is to ensure that "debug" and "release" get processed outside +  # of a generator expression - https://gitlab.kitware.com/cmake/cmake/-/issues/18424, as they are +  # target_link_library keywords rather than real libraries. +  add_library(pybind11::_ClassicPythonLibraries IMPORTED INTERFACE) +  target_link_libraries(pybind11::_ClassicPythonLibraries INTERFACE ${PYTHON_LIBRARIES}) +  target_link_libraries( +    pybind11::module +    INTERFACE +      pybind11::python_link_helper +      "$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:Cygwin>>:pybind11::_ClassicPythonLibraries>") + +  target_link_libraries(pybind11::embed INTERFACE pybind11::pybind11 +                                                  pybind11::_ClassicPythonLibraries)  endif() -set_property( -  TARGET pybind11::embed -  APPEND -  PROPERTY INTERFACE_LINK_LIBRARIES pybind11::pybind11 $<BUILD_INTERFACE:${PYTHON_LIBRARIES}>) -  function(pybind11_extension name)    # The prefix and extension are provided by FindPythonLibsNew.cmake    set_target_properties(${name} PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}" @@ -166,8 +192,13 @@ function(pybind11_add_module target_name)    # py::module_local).  We force it on everything inside the `pybind11`    # namespace; also turning it on for a pybind module compilation here avoids    # potential warnings or issues from having mixed hidden/non-hidden types. -  set_target_properties(${target_name} PROPERTIES CXX_VISIBILITY_PRESET "hidden" -                                                  CUDA_VISIBILITY_PRESET "hidden") +  if(NOT DEFINED CMAKE_CXX_VISIBILITY_PRESET) +    set_target_properties(${target_name} PROPERTIES CXX_VISIBILITY_PRESET "hidden") +  endif() + +  if(NOT DEFINED CMAKE_CUDA_VISIBILITY_PRESET) +    set_target_properties(${target_name} PROPERTIES CUDA_VISIBILITY_PRESET "hidden") +  endif()    if(ARG_NO_EXTRAS)      return() @@ -181,7 +212,9 @@ function(pybind11_add_module target_name)      endif()    endif() -  if(NOT MSVC AND NOT ${CMAKE_BUILD_TYPE} MATCHES Debug|RelWithDebInfo) +  # Use case-insensitive comparison to match the result of $<CONFIG:cfgs> +  string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE) +  if(NOT MSVC AND NOT ${uppercase_CMAKE_BUILD_TYPE} MATCHES DEBUG|RELWITHDEBINFO)      pybind11_strip(${target_name})    endif() diff --git a/3rdparty/pybind11/tools/setup_global.py.in b/3rdparty/pybind11/tools/setup_global.py.in index 4cf040b2..d91468c1 100644 --- a/3rdparty/pybind11/tools/setup_global.py.in +++ b/3rdparty/pybind11/tools/setup_global.py.in @@ -1,17 +1,11 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- +#!/usr/bin/env python3  # Setup script for pybind11-global (in the sdist or in tools/setup_global.py in the repository)  # This package is targeted for easy use from CMake. -import contextlib  import glob  import os  import re -import shutil -import subprocess -import sys -import tempfile  # Setuptools has to be before distutils  from setuptools import setup @@ -33,8 +27,10 @@ class InstallHeadersNested(install_headers):  main_headers = glob.glob("pybind11/include/pybind11/*.h")  detail_headers = glob.glob("pybind11/include/pybind11/detail/*.h") +stl_headers = glob.glob("pybind11/include/pybind11/stl/*.h")  cmake_files = glob.glob("pybind11/share/cmake/pybind11/*.cmake") -headers = main_headers + detail_headers +pkgconfig_files = glob.glob("pybind11/share/pkgconfig/*.pc") +headers = main_headers + detail_headers + stl_headers  cmdclass = {"install_headers": InstallHeadersNested}  $extra_cmd @@ -56,8 +52,10 @@ setup(      headers=headers,      data_files=[          (base + "share/cmake/pybind11", cmake_files), +        (base + "share/pkgconfig", pkgconfig_files),          (base + "include/pybind11", main_headers),          (base + "include/pybind11/detail", detail_headers), +        (base + "include/pybind11/stl", stl_headers),      ],      cmdclass=cmdclass,  ) diff --git a/3rdparty/pybind11/tools/setup_main.py.in b/3rdparty/pybind11/tools/setup_main.py.in index 2231a08f..65198bdb 100644 --- a/3rdparty/pybind11/tools/setup_main.py.in +++ b/3rdparty/pybind11/tools/setup_main.py.in @@ -1,5 +1,4 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- +#!/usr/bin/env python3  # Setup script (in the sdist or in tools/setup_main.py in the repository) @@ -16,13 +15,17 @@ setup(          "pybind11",          "pybind11.include.pybind11",          "pybind11.include.pybind11.detail", +        "pybind11.include.pybind11.stl",          "pybind11.share.cmake.pybind11", +        "pybind11.share.pkgconfig",      ],      package_data={ -        "pybind11": ["py.typed", "*.pyi"], +        "pybind11": ["py.typed"],          "pybind11.include.pybind11": ["*.h"],          "pybind11.include.pybind11.detail": ["*.h"], +        "pybind11.include.pybind11.stl": ["*.h"],          "pybind11.share.cmake.pybind11": ["*.cmake"], +        "pybind11.share.pkgconfig": ["*.pc"],      },      extras_require={          "global": ["pybind11_global==$version"] @@ -30,6 +33,9 @@ setup(      entry_points={          "console_scripts": [               "pybind11-config = pybind11.__main__:main", +        ], +        "pipx.run": [ +             "pybind11 = pybind11.__main__:main",          ]      },      cmdclass=cmdclass | 
