Skip to content

Commit

Permalink
Use find_program to get python in cmake (#546)
Browse files Browse the repository at this point in the history
* Use find_program to get python in cmake

* Update build_linux.yml

* Revert "Update build_linux.yml"

This reverts commit 82bd9f4.
  • Loading branch information
a-maurice authored Nov 30, 2022
1 parent 30081b1 commit 30d6892
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ else()
set(DESKTOP OFF)
endif()

# Define the Python executable before including the subprojects
find_program(FIREBASE_PYTHON_EXECUTABLE
NAMES python3 python
REQUIRED
)

include(FindPkgConfig)
include(android_dependencies)
include(build_universal)
Expand Down
2 changes: 1 addition & 1 deletion cmake/build_aar.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function(build_aar LIBRARY_NAME LIBRARY_TARGET PROGUARD_TARGET

add_custom_command(
OUTPUT "${OUTPUT_AAR}"
COMMAND python "${FIREBASE_SOURCE_DIR}/aar_builder/build_aar.py"
COMMAND ${FIREBASE_PYTHON_EXECUTABLE} "${FIREBASE_SOURCE_DIR}/aar_builder/build_aar.py"
"--output_file=${OUTPUT_AAR}"
"--library_file=$<TARGET_FILE:${LIBRARY_TARGET}>"
"--architecture=${ANDROID_ABI}"
Expand Down
6 changes: 3 additions & 3 deletions cmake/firebase_swig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,13 @@ macro(firebase_swig_add_library name)
OUTPUT ${UNITY_SWIG_CS_FIX_FILE}
DEPENDS ${UNITY_SWIG_CS_GEN_FILE}
COMMAND
python
${FIREBASE_PYTHON_EXECUTABLE}
${CMAKE_CURRENT_LIST_DIR}/../swig_commenter.py
--input=\"${all_cpp_header_files}\"
--output=\"${UNITY_SWIG_CS_GEN_FILE}\"
--namespace_prefix=\"Firebase\"
COMMAND
python
${FIREBASE_PYTHON_EXECUTABLE}
${FIREBASE_SWIG_FIX_PY}
--language=csharp
--in_file=\"${UNITY_SWIG_CS_GEN_FILE}\"
Expand All @@ -233,7 +233,7 @@ macro(firebase_swig_add_library name)
OUTPUT ${UNITY_SWIG_CPP_FIX_FILE}
DEPENDS ${UNITY_SWIG_CPP_GEN_FILE}
COMMAND
python
${FIREBASE_PYTHON_EXECUTABLE}
${FIREBASE_SWIG_FIX_PY}
--language=cpp
--in_file=\"${UNITY_SWIG_CPP_GEN_FILE}\"
Expand Down

0 comments on commit 30d6892

Please sign in to comment.