From b05f16bb9ecc3b67a357bf01697e974704e10fa2 Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Tue, 21 Feb 2023 14:28:04 -0800 Subject: [PATCH] [Test] Invoke GetErrcMessages from config-ix instead of llvm/CMakeLists Since GetErrcMessages uses cmake's `try_run` mechanism it's sensitive to changes to CMAKE_CXX_FLAGS, so we move it into config-ix with the similar flag-sensitive configuration. This makes it run before HandleLLVMOptions and avoids issues with LLVM_ENABLE_WERROR and other configuration that manipulate CMAKE_CXX_FLAGS. Differential Revision: https://reviews.llvm.org/D144526 --- llvm/CMakeLists.txt | 5 ----- llvm/cmake/config-ix.cmake | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index ed350c5..c993ff5 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -975,11 +975,6 @@ set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR} ) set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_LIBRARY_DIR} ) set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_LIBRARY_DIR} ) -if(LLVM_INCLUDE_TESTS) - include(GetErrcMessages) - get_errc_messages(LLVM_LIT_ERRC_MESSAGES) -endif() - # For up-to-date instructions for installing the TFLite dependency, refer to # the bot setup script: https://github.com/google/ml-compiler-opt/blob/main/buildbot/buildbot_init.sh set(LLVM_HAVE_TFLITE "" CACHE BOOL "Use tflite") diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake index b78c1b3..752ca33 100644 --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake @@ -438,6 +438,11 @@ if (CMAKE_COMPILER_IS_GNUCXX) endif() endif() +if(LLVM_INCLUDE_TESTS) + include(GetErrcMessages) + get_errc_messages(LLVM_LIT_ERRC_MESSAGES) +endif() + # By default, we target the host, but this can be overridden at CMake # invocation time. include(GetHostTriple) -- 2.7.4