Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
e315e1fe
Unverified
Commit
e315e1fe
authored
Oct 04, 2021
by
Henry Schreiner
Browse files
Merge branch 'master' into stable
parents
71fd5241
97976c16
Changes
143
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
25 deletions
+28
-25
tools/pybind11Config.cmake.in
tools/pybind11Config.cmake.in
+1
-1
tools/pybind11NewTools.cmake
tools/pybind11NewTools.cmake
+9
-0
tools/pybind11Tools.cmake
tools/pybind11Tools.cmake
+18
-24
No files found.
tools/pybind11Config.cmake.in
View file @
e315e1fe
...
...
@@ -147,7 +147,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 ``
Rel
Size``.
Optimize for size, even if the ``CMAKE_BUILD_TYPE`` is not ``
Min
Size
Rel
``.
``THIN_LTO``
Use thin TLO instead of regular if there's a choice (pybind11's selection
is disabled if ``CMAKE_INTERPROCEDURAL_OPTIMIZATIONS`` is set).
...
...
tools/pybind11NewTools.cmake
View file @
e315e1fe
...
...
@@ -82,6 +82,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
(
...
...
tools/pybind11Tools.cmake
View file @
e315e1fe
...
...
@@ -45,31 +45,25 @@ 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"
)
...
...
Prev
1
…
4
5
6
7
8
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment