[PATCH] D98861: [CMAKE] Fix cross-compilation build
Vladislav Vinogradov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 23 01:26:59 PDT 2021
vinograd47 updated this revision to Diff 332557.
vinograd47 added a comment.
@jhenderson Done
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98861/new/
https://reviews.llvm.org/D98861
Files:
llvm/CMakeLists.txt
llvm/cmake/modules/GetErrcMessages.cmake
Index: llvm/cmake/modules/GetErrcMessages.cmake
===================================================================
--- llvm/cmake/modules/GetErrcMessages.cmake
+++ llvm/cmake/modules/GetErrcMessages.cmake
@@ -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)
Index: llvm/CMakeLists.txt
===================================================================
--- llvm/CMakeLists.txt
+++ llvm/CMakeLists.txt
@@ -507,9 +507,6 @@
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_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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98861.332557.patch
Type: text/x-patch
Size: 1788 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210323/b7a7aeae/attachment.bin>
More information about the llvm-commits
mailing list