Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
e01f4924
Unverified
Commit
e01f4924
authored
Sep 21, 2020
by
Henry Schreiner
Committed by
GitHub
Sep 21, 2020
Browse files
fix: Add a nice CMake error when Interpreter component is missing. (#2519)
Closes #2515, found by @rhjdjong
parent
5e6ec496
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
tools/pybind11NewTools.cmake
tools/pybind11NewTools.cmake
+10
-0
No files found.
tools/pybind11NewTools.cmake
View file @
e01f4924
...
@@ -70,6 +70,16 @@ if(PYBIND11_MASTER_PROJECT)
...
@@ -70,6 +70,16 @@ if(PYBIND11_MASTER_PROJECT)
endif
()
endif
()
endif
()
endif
()
# If a user finds Python, they may forget to include the Interpreter component
# and the following two steps require it. It is highly recommended by CMake
# when finding development libraries anyway, so we will require it.
if
(
NOT DEFINED
${
_Python
}
_EXECUTABLE
)
message
(
FATAL_ERROR
"
${
_Python
}
was found without the Interpreter component. Pybind11 requires this component."
)
endif
()
# Debug check - see https://stackoverflow.com/questions/646518/python-how-to-detect-debug-Interpreter
# Debug check - see https://stackoverflow.com/questions/646518/python-how-to-detect-debug-Interpreter
execute_process
(
execute_process
(
COMMAND
"
${${
_Python
}
_EXECUTABLE
}
"
"-c"
"import sys; sys.exit(hasattr(sys, 'gettotalrefcount'))"
COMMAND
"
${${
_Python
}
_EXECUTABLE
}
"
"-c"
"import sys; sys.exit(hasattr(sys, 'gettotalrefcount'))"
...
...
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