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
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")
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)