[llvm] [CMake] Provide more useful message for check_symbol_exists failures (PR #104709)

Kagami Sascha Rosylight via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 18 07:14:37 PDT 2024


https://github.com/saschanaz created https://github.com/llvm/llvm-project/pull/104709

"Failed to configure libxml2" doesn't help much as it does not tell about the cause. As there is a documented reason for the check, this revises the message to show the intention.

https://github.com/llvm/llvm-project/blob/6ed2a6bf0d26122210c8732d80431529784c4000/llvm/cmake/config-ix.cmake#L172-L173

>From e34d8860493fd033569855dc7073f9fff48fb0af Mon Sep 17 00:00:00 2001
From: Kagami Sascha Rosylight <saschanaz at outlook.com>
Date: Sun, 18 Aug 2024 16:08:35 +0200
Subject: [PATCH] [CMake] Provide more useful message for check_symbol_exists
 failures

---
 llvm/cmake/config-ix.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
index 0aae13e30f2ab4..3c1de18abb81f0 100644
--- a/llvm/cmake/config-ix.cmake
+++ b/llvm/cmake/config-ix.cmake
@@ -178,7 +178,7 @@ if(LLVM_ENABLE_LIBXML2)
     check_symbol_exists(xmlReadMemory libxml/xmlreader.h HAVE_LIBXML2)
     cmake_pop_check_state()
     if(LLVM_ENABLE_LIBXML2 STREQUAL FORCE_ON AND NOT HAVE_LIBXML2)
-      message(FATAL_ERROR "Failed to configure libxml2")
+      message(FATAL_ERROR "Found an unusable libxml2, check whether it matches the compile target")
     endif()
   endif()
   set(LLVM_ENABLE_LIBXML2 "${HAVE_LIBXML2}")
@@ -198,7 +198,7 @@ if(LLVM_ENABLE_CURL)
     check_symbol_exists(curl_easy_init curl/curl.h HAVE_CURL)
     cmake_pop_check_state()
     if(LLVM_ENABLE_CURL STREQUAL FORCE_ON AND NOT HAVE_CURL)
-      message(FATAL_ERROR "Failed to configure curl")
+      message(FATAL_ERROR "Found an unusable curl, check whether it matches the compile target")
     endif()
   endif()
   set(LLVM_ENABLE_CURL "${HAVE_CURL}")



More information about the llvm-commits mailing list