[CMake]: Fix python command for mingw environment (#6984)

In mingw build environment, this fixes the build error:
'py' is not recognized as an internal or external command
The 'py' launcher is available for MSVC python only. More
https://docs.python.org/3/using/windows.html#from-the-command-line
This commit is contained in:
Biswapriyo Nath 2021-12-11 00:58:24 +05:30 committed by GitHub
parent 5fc87f4c4b
commit 705f27f6ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -523,7 +523,7 @@ if(PYTHONINTERP_FOUND AND
# Skip doing this if the MSVC version is below VS 12. # Skip doing this if the MSVC version is below VS 12.
# https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html # https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html
(NOT MSVC OR MSVC_VERSION GREATER 1800)) (NOT MSVC OR MSVC_VERSION GREATER 1800))
if(WIN32) if(MSVC)
set(GENERATION_SCRIPT py scripts/generate_code.py) set(GENERATION_SCRIPT py scripts/generate_code.py)
else() else()
set(GENERATION_SCRIPT scripts/generate_code.py) set(GENERATION_SCRIPT scripts/generate_code.py)