From 705f27f6eef3070dd864c3d5bdbcb25b44e2eb7e Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Sat, 11 Dec 2021 00:58:24 +0530 Subject: [PATCH] [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 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca05a1e01..2fc20b7dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -523,7 +523,7 @@ if(PYTHONINTERP_FOUND AND # Skip doing this if the MSVC version is below VS 12. # https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html (NOT MSVC OR MSVC_VERSION GREATER 1800)) - if(WIN32) + if(MSVC) set(GENERATION_SCRIPT py scripts/generate_code.py) else() set(GENERATION_SCRIPT scripts/generate_code.py) @@ -750,4 +750,4 @@ endif() # Include for running Google Benchmarks. if(FLATBUFFERS_BUILD_BENCHMARKS AND CMAKE_VERSION VERSION_GREATER 3.13) add_subdirectory(benchmarks) -endif() \ No newline at end of file +endif()