File tree Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,21 @@ option(
72
72
ON
73
73
)
74
74
75
+ # Find a Python interpreter using the best available mechanism.
76
+ if (${CMAKE_VERSION} VERSION_LESS "3.12" )
77
+ include (FindPythonInterp )
78
+ set (DEFAULT_FIREBASE_PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE} " )
79
+ else ()
80
+ find_package (Python3 COMPONENTS Interpreter )
81
+ set (DEFAULT_FIREBASE_PYTHON_EXECUTABLE "${Python3_EXECUTABLE} " )
82
+ endif ()
83
+
84
+ set (
85
+ FIREBASE_PYTHON_EXECUTABLE
86
+ "${DEFAULT_FIREBASE_PYTHON_EXECUTABLE} "
87
+ CACHE FILEPATH
88
+ "The Python interpreter to use"
89
+ )
75
90
76
91
list (INSERT CMAKE_MODULE_PATH 0 ${PROJECT_SOURCE_DIR} /cmake )
77
92
include (compiler_setup )
Original file line number Diff line number Diff line change 12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
- include (FindPythonInterp )
16
-
17
15
# Generate output in-place. So long as the build is idempotent this helps
18
16
# verify that the protoc-generated output isn't changing.
19
17
set (OUTPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
@@ -200,7 +198,7 @@ if(FIREBASE_IOS_PROTOC_GENERATE_SOURCES)
200
198
COMMENT "Generating nanopb sources"
201
199
OUTPUT ${NANOPB_GENERATED_SOURCES}
202
200
COMMAND
203
- ${PYTHON_EXECUTABLE }
201
+ ${FIREBASE_PYTHON_EXECUTABLE }
204
202
${CMAKE_CURRENT_SOURCE_DIR} /build_protos.py
205
203
--nanopb
206
204
--protoc=$<TARGET_FILE:protoc>
@@ -232,7 +230,7 @@ if(FIREBASE_IOS_PROTOC_GENERATE_SOURCES)
232
230
COMMENT "Generating C++ protobuf sources"
233
231
OUTPUT ${PROTOBUF_CPP_GENERATED_SOURCES}
234
232
COMMAND
235
- ${PYTHON_EXECUTABLE }
233
+ ${FIREBASE_PYTHON_EXECUTABLE }
236
234
${CMAKE_CURRENT_SOURCE_DIR} /build_protos.py
237
235
--cpp
238
236
--protoc=$<TARGET_FILE:protoc>
Original file line number Diff line number Diff line change 14
14
15
15
include (CheckSymbolExists )
16
16
include (CheckIncludeFiles )
17
- include (FindPythonInterp )
18
17
19
18
20
19
## firestore_util
@@ -286,7 +285,7 @@ add_custom_command(
286
285
OUTPUT
287
286
${GRPC_ROOT_CERTIFICATE_SOURCES}
288
287
COMMAND
289
- ${PYTHON_EXECUTABLE } ${FIREBASE_SOURCE_DIR} /scripts/binary_to_array.py
288
+ ${FIREBASE_PYTHON_EXECUTABLE } ${FIREBASE_SOURCE_DIR} /scripts/binary_to_array.py
290
289
--output_header=${OUTPUT_DIR}/grpc_root_certificates_generated.h
291
290
--output_source=${OUTPUT_DIR}/grpc_root_certificates_generated.cc
292
291
--cpp_namespace=firebase::firestore::remote
You can’t perform that action at this time.
0 commit comments