Merge pull request #33 from cblichmann:master

PiperOrigin-RevId: 301562682
Change-Id: I9bc0700c295236523bbe1c13451b01fad12e4720
This commit is contained in:
Copybara-Service 2020-03-18 04:19:34 -07:00
commit d4faf10b4a
2 changed files with 5 additions and 1 deletions

View File

@ -135,7 +135,7 @@ function(add_sapi_library)
endif()
add_custom_command(
OUTPUT "${_sapi_gen_header}"
COMMAND "${Python3_EXECUTABLE}" -B
COMMAND "${SAPI_PYTHON3_EXECUTABLE}" -B
"${SAPI_SOURCE_DIR}/sandboxed_api/tools/generator2/sapi_generator.py"
"--sapi_name=${_sapi_LIBRARY_NAME}"
"--sapi_out=${_sapi_gen_header}"

View File

@ -77,7 +77,11 @@ find_package(Libffi REQUIRED)
if(SAPI_ENABLE_EXAMPLES)
find_package(ZLIB REQUIRED)
endif()
# Find Python 3 and add its location to the cache so that its available in
# the add_sapi_library() macro in embedding projects.
find_package(Python3 COMPONENTS Interpreter REQUIRED)
set(SAPI_PYTHON3_EXECUTABLE "${Python3_EXECUTABLE}" CACHE INTERNAL "" FORCE)
# Undo global change
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_sapi_saved_CMAKE_FIND_LIBRARY_SUFFIXES})