summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBiswapriyo Nath <nathbappai@gmail.com>2021-12-11 00:58:24 +0530
committerGitHub <noreply@github.com>2021-12-10 11:28:24 -0800
commit705f27f6eef3070dd864c3d5bdbcb25b44e2eb7e (patch)
treebaf6d27f90e6359422479b80527efb9d1b0aeadc
parent5fc87f4c4bf04228039c752003931d58a33e7a1b (diff)
downloadflatbuffers-705f27f6eef3070dd864c3d5bdbcb25b44e2eb7e.tar.gz
flatbuffers-705f27f6eef3070dd864c3d5bdbcb25b44e2eb7e.tar.bz2
flatbuffers-705f27f6eef3070dd864c3d5bdbcb25b44e2eb7e.zip
[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
-rw-r--r--CMakeLists.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ca05a1e0..2fc20b7d 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()