1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00

[CMAKE] Fix cross-compilation build

Call `get_errc_messages` only if `LLVM_INCLUDE_TESTS` was set.

Reviewed By: zero9178, abhina.sreeskantharajan, jhenderson

Differential Revision: https://reviews.llvm.org/D98861
This commit is contained in:
Vladislav Vinogradov 2021-03-18 15:35:20 +03:00
parent e4bd7891be
commit c7fbf3b5e8
2 changed files with 10 additions and 3 deletions

View File

@ -507,9 +507,6 @@ if (MSVC_IDE OR XCODE)
endif()
set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit")
include(GetErrcMessages)
get_errc_messages(LLVM_LIT_ERRC_MESSAGES)
# On Win32 hosts, provide an option to specify the path to the GnuWin32 tools.
if( WIN32 AND NOT CYGWIN )
set(LLVM_LIT_TOOLS_DIR "" CACHE PATH "Path to GnuWin32 tools")
@ -762,6 +759,11 @@ set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/bin )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
if(LLVM_INCLUDE_TESTS)
include(GetErrcMessages)
get_errc_messages(LLVM_LIT_ERRC_MESSAGES)
endif()
# For up-to-date instructions for installing the Tensorflow dependency, refer to
# the bot setup script: https://github.com/google/ml-compiler-opt/blob/master/buildbot/buildbot_init.sh
# In this case, the latest C API library is available for download from

View File

@ -4,6 +4,11 @@
# Messages are semi colon separated.
# Keep amount, order and tested error codes in sync with llvm/utils/lit/lit/llvm/config.py.
function(get_errc_messages outvar)
if(CMAKE_CROSSCOMPILING AND NOT CMAKE_CROSSCOMPILING_EMULATOR AND NOT DEFINED errc_exit_code)
set(${outvar} "" PARENT_SCOPE)
message(STATUS "Can't get errc messages in cross-compilation mode")
return()
endif()
set(errc_test_code ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/getErrc.cpp)