Find Python interpreter to used for scripts/buildsystems/osx/applocal.py (#27179)

The deployment script works with Python 2 and 3. On modern macOS machines
Python 2 may not be available. Find either version and use it.

Co-authored-by: Lily Wang <494550702@qq.com>
This commit is contained in:
Frederik Gladhorn 2022-10-15 01:32:33 +02:00 committed by GitHub
parent 8f229feaf1
commit 8f06ea42d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -603,8 +603,9 @@ function(add_executable)
) )
elseif(Z_VCPKG_TARGET_TRIPLET_PLAT MATCHES "osx") elseif(Z_VCPKG_TARGET_TRIPLET_PLAT MATCHES "osx")
if(NOT MACOSX_BUNDLE_IDX EQUAL -1) if(NOT MACOSX_BUNDLE_IDX EQUAL -1)
find_package(Python COMPONENTS Interpreter)
add_custom_command(TARGET "${target_name}" POST_BUILD add_custom_command(TARGET "${target_name}" POST_BUILD
COMMAND python "${Z_VCPKG_TOOLCHAIN_DIR}/osx/applocal.py" COMMAND "${Python_EXECUTABLE}" "${Z_VCPKG_TOOLCHAIN_DIR}/osx/applocal.py"
"$<TARGET_FILE:${target_name}>" "$<TARGET_FILE:${target_name}>"
"${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$<CONFIG:Debug>:/debug>" "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$<CONFIG:Debug>:/debug>"
VERBATIM VERBATIM