[PATCH] D144526: [Test] Invoke GetErrcMessages from config-ix instead of llvm/CMakeLists

Justin Bogner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 21 15:44:07 PST 2023


bogner created this revision.
bogner added a reviewer: beanz.
Herald added a subscriber: mcrosier.
Herald added a project: All.
bogner requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144526

Files:
  llvm/CMakeLists.txt
  llvm/cmake/config-ix.cmake


Index: llvm/cmake/config-ix.cmake
===================================================================
--- llvm/cmake/config-ix.cmake
+++ llvm/cmake/config-ix.cmake
@@ -438,6 +438,11 @@
   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)
Index: llvm/CMakeLists.txt
===================================================================
--- llvm/CMakeLists.txt
+++ llvm/CMakeLists.txt
@@ -975,11 +975,6 @@
 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")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144526.499316.patch
Type: text/x-patch
Size: 1053 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230221/2b7fbab8/attachment.bin>


More information about the llvm-commits mailing list