[libffi] Check return value of execute_process() (#10469)

To avoid hiding errors, the return values of the execute_process()
commands should be checked and a fatal error should be issued.
This commit is contained in:
Robert Schumacher 2020-04-16 13:43:04 -07:00 committed by GitHub
commit 959a9eae9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -120,8 +120,13 @@ macro(add_assembly ASMFILE)
COMMAND ${CMAKE_C_COMPILER} /nologo /EP /I. /Iinclude /I${CMAKE_CURRENT_SOURCE_DIR}/include "${ASMFILE_FULL}"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
OUTPUT_FILE ${ARCH_ASM_NAME}.asm
RESULT_VARIABLE retcode
)
if(NOT ${retcode} STREQUAL "0")
message(FATAL_ERROR "Unable to assemble, exit code: '${retcode}'.")
endif()
# Produced *.asm file could be just added to sources.
# It works in x64 mode, but for some strange reason MASM returns error code when in x86,
# (even though it didn't report any errors and correctly generated object file)
@ -129,8 +134,13 @@ macro(add_assembly ASMFILE)
execute_process(
COMMAND ${ARCH_ASSEMBLER} ${ARCH_ASM_NAME}.asm
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
RESULT_VARIABLE retcode
)
if(NOT ${retcode} STREQUAL "0")
message(FATAL_ERROR "Unable to compile assembly, exit code: '${retcode}'.")
endif()
list(APPEND FFI_SOURCES ${CMAKE_BINARY_DIR}/${ARCH_ASM_NAME}.obj)
else()
list(APPEND FFI_SOURCES ${ASMFILE})

View File

@ -1,4 +1,4 @@
Source: libffi
Version: 3.3-1
Version: 3.3-2
Homepage: https://github.com/libffi/libffi
Description: Portable, high level programming interface to various calling conventions