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
6ad3f874
Unverified
Commit
6ad3f874
authored
Sep 23, 2021
by
Henry Schreiner
Committed by
GitHub
Sep 23, 2021
Browse files
fix(build): avoid a possible warning about shadowed variables and changing behaviors (#3220)
parent
21282e64
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
24 deletions
+18
-24
tools/pybind11Tools.cmake
tools/pybind11Tools.cmake
+18
-24
No files found.
tools/pybind11Tools.cmake
View file @
6ad3f874
...
...
@@ -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"
)
...
...
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