diff options
author | Markus Böck <markus.boeck02@gmail.com> | 2021-03-15 20:56:08 +0100 |
---|---|---|
committer | Markus Böck <markus.boeck02@gmail.com> | 2021-03-15 20:56:08 +0100 |
commit | af2796c76d2ff4b73165ed47959afd35a769beee (patch) | |
tree | b06a6f21a0678aea5deb96abc643d848a47149e2 /lld/CMakeLists.txt | |
parent | bcb3f0f867b27179f9cab49d2ef41fe7769112c0 (diff) | |
download | llvm-af2796c76d2ff4b73165ed47959afd35a769beee.tar.gz |
[test] Add ability to get error messages from CMake for errc substitution
Visual Studios implementation of the C++ Standard Library does not use strerror to produce a message for std::error_code unlike other standard libraries such as libstdc++ or libc++ that might be used.
This patch adds a cmake script that through running a C++ program gets the error messages for the POSIX error codes and passes them onto lit through an optional config parameter.
If the config parameter is not set, or getting the messages failed, due to say a cross compiling configuration without an emulator, it will fall back to using pythons strerror functions.
Differential Revision: https://reviews.llvm.org/D98278
Diffstat (limited to 'lld/CMakeLists.txt')
-rw-r--r-- | lld/CMakeLists.txt | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lld/CMakeLists.txt b/lld/CMakeLists.txt index cbca979aaeb1..53e09f938888 100644 --- a/lld/CMakeLists.txt +++ b/lld/CMakeLists.txt @@ -54,6 +54,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) include(AddLLVM) include(TableGen) include(HandleLLVMOptions) + include(GetErrcMessages) include(CheckAtomic) if(LLVM_INCLUDE_TESTS) @@ -98,6 +99,8 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) endif() set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit") + 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") |