-
Notifications
You must be signed in to change notification settings - Fork 7.5k
cmake: Fix dev warning from cmake 3.17 #23981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
All checks are passing now. Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a little safety around setting a variable.
set(FPHSA_NAME_MISMATCHED 1) | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonInterp REQUIRED_VARS PYTHON_EXECUTABLE VERSION_VAR PYTHON_VERSION_STRING) | ||
unset(FPHSA_NAME_MISMATCHED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although I don't expect this to be an issue in this case, then in general it is safer to read existing value, and restore that afterwards.
set(FPHSA_NAME_MISMATCHED 1) | |
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonInterp REQUIRED_VARS PYTHON_EXECUTABLE VERSION_VAR PYTHON_VERSION_STRING) | |
unset(FPHSA_NAME_MISMATCHED) | |
set(FPHSA_NAME_MISMATCHED_CURRENT ${FPHSA_NAME_MISMATCHED}) | |
set(FPHSA_NAME_MISMATCHED 1) | |
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonInterp REQUIRED_VARS PYTHON_EXECUTABLE VERSION_VAR PYTHON_VERSION_STRING) | |
set(FPHSA_NAME_MISMATCHED ${FPHSA_NAME_MISMATCHED_CURRENT}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is better. Done.
In cmake 3.17 the behaviour of FindPackageHandleStandardArgs was modified. See cmake commit FPHSA: detect package name mismatches ("ee4673c1ae1e4a1aa4687412717567c2ffbb501b"). This change introduces a new warning. Fixes zephyrproject-rtos#23922 Signed-off-by: Christian Taedcke <[email protected]>
@chrta I discovered that since CMake 3.12 (Zephyr requires minimum 3.13), the use of FindZephyrInterp has been deprecated in favor of FindPython3. Will test out FindPython3, and if that also fixes this old issue: #11103 , then we should simply switch to that, and remove this local copy. |
Close this because #24308 fixes this issue in a better way. |
In cmake 3.17 the behaviour of FindPackageHandleStandardArgs was modified.
See cmake commit FPHSA: detect package name mismatches
("ee4673c1ae1e4a1aa4687412717567c2ffbb501b").
This change introduces a new warning.
Fixes #23922
Signed-off-by: Christian Taedcke [email protected]