[cmake] Force Python version to 2.7 #9818
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When I try to build Kodi with CMake on Arch Linux, CMake finds version 3.5 of Python and tries to use it. The build then fails with this error:
/home/mark/Coding/Repos/kodi-git/src/xbmc/xbmc/interfaces/python/LanguageHook.cpp: In member function 'virtual XBMCAddon::String XBMCAddon::Python::PythonLanguageHook::GetAddonId()': /home/mark/Coding/Repos/kodi-git/src/xbmc/xbmc/interfaces/python/LanguageHook.cpp:140:38: error: 'PyString_AsString' was not declared in this scope return PyString_AsString(pyid); ^ /home/mark/Coding/Repos/kodi-git/src/xbmc/xbmc/interfaces/python/LanguageHook.cpp: In member function 'virtual XBMCAddon::String XBMCAddon::Python::PythonLanguageHook::GetAddonVersion()': /home/mark/Coding/Repos/kodi-git/src/xbmc/xbmc/interfaces/python/LanguageHook.cpp:155:43: error: 'PyString_AsString' was not declared in this scope return PyString_AsString(pyversion); ^ build/interfaces/python/CMakeFiles/python_interface.dir/build.make:134: recipe for target 'build/interfaces/python/CMakeFiles/python_interface.dir/LanguageHook.cpp.o' failed make[2]: *** [build/interfaces/python/CMakeFiles/python_interface.dir/LanguageHook.cpp.o] Error 1 CMakeFiles/Makefile2:3066: recipe for target 'build/interfaces/python/CMakeFiles/python_interface.dir/all' failed
If I force the Python version to 2.7 in FindPython.cmake, everything builds fine.