summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDerek Bailey <derekbailey@google.com>2022-01-28 15:00:57 -0800
committerGitHub <noreply@github.com>2022-01-28 15:00:57 -0800
commitdbbaeac85c95eda8cbed3955d969196d131372f7 (patch)
tree8220b28a8371d754af6f48adceedec180da839fd /CMakeLists.txt
parent028f0fde6286b5fc7b1adddf76ba111b0a0fcfb7 (diff)
downloadflatbuffers-dbbaeac85c95eda8cbed3955d969196d131372f7.tar.gz
flatbuffers-dbbaeac85c95eda8cbed3955d969196d131372f7.tar.bz2
flatbuffers-dbbaeac85c95eda8cbed3955d969196d131372f7.zip
Use `${PYTHON_EXECUTABLE}` instead of `py` in cmake (#7042)
* Emit include for bfbs-gen-embed * Use python3 explicitly * bump min python version to 3.6 * Sort find_package for python * try casting Path to string * cast WindowsPath to string to please CI * stringify the wrong thing * another stringify path
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 4 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1a7ceaaa..b4a489f2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -526,16 +526,16 @@ function(compile_flatbuffers_schema_to_embedded_binary SRC_FBS OPT)
register_generated_output(${GEN_BFBS_HEADER})
endfunction()
-# Look if we have python 3 installed so that we can run the generate code python
-# script after flatc is built.
-find_package(PythonInterp 3)
+# Look if we have python 3.5 installed so that we can run the generate code
+# python script after flatc is built.
+find_package(PythonInterp 3.5)
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(MSVC)
- set(GENERATION_SCRIPT py scripts/generate_code.py)
+ set(GENERATION_SCRIPT ${PYTHON_EXECUTABLE} scripts/generate_code.py)
else()
set(GENERATION_SCRIPT scripts/generate_code.py)
endif()