[llvm] b05f16b - [Test] Invoke GetErrcMessages from config-ix instead of llvm/CMakeLists
Justin Bogner via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 21 16:07:50 PST 2023
Author: Justin Bogner
Date: 2023-02-21T16:06:39-08:00
New Revision: b05f16bb9ecc3b67a357bf01697e974704e10fa2
URL: https://github.com/llvm/llvm-project/commit/b05f16bb9ecc3b67a357bf01697e974704e10fa2
DIFF: https://github.com/llvm/llvm-project/commit/b05f16bb9ecc3b67a357bf01697e974704e10fa2.diff
LOG: [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
Added:
Modified:
llvm/CMakeLists.txt
llvm/cmake/config-ix.cmake
Removed:
################################################################################
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index ed350c568afec..c993ff53d134e 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 b78c1b34ab8b9..752ca333caa3b 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)
More information about the llvm-commits
mailing list