This is an automated email from the ASF dual-hosted git repository.

alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 86d7f3d84a985409d2fd94bec21eeb98acbfc8a3
Author: Alexey Serbin <[email protected]>
AuthorDate: Fri Aug 19 12:56:08 2022 -0700

    [cmake] fail early if cannot find linker
    
    This patch switches from SEND_ERROR to FATAL_ERROR mode for the linker
    detection issues, so cmake doesn't continue with the processing, instead
    stopping and reporting on the error right away [1].
    
    I think the updated behavior makes more sense: while addressing recent
    build issues on macOS, I spent some time digging into krb5-related error
    reported by cmake later on, but it turned that the culprit was the issue
    with finding a proper linker.  It would save me some time if I turned my
    attention to the linker-related error from the very beginning.
    
    In addition, this patch removes the "Linker not found" status message
    that might be confusing if the GET_LINKER_VERSION function runs for
    multiple linker candidates (as of now, that's so at least for Linux).
    
    [1] https://cmake.org/cmake/help/latest/command/message.html
    
    Change-Id: I78c811acc7813de1c5d15a6a131b9749a76bf271
    Reviewed-on: http://gerrit.cloudera.org:8080/18871
    Tested-by: Kudu Jenkins
    Reviewed-by: Yingchun Lai <[email protected]>
    Reviewed-by: Attila Bukor <[email protected]>
---
 cmake_modules/KuduLinker.cmake | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/cmake_modules/KuduLinker.cmake b/cmake_modules/KuduLinker.cmake
index 0725bb03d..c35df4ff9 100644
--- a/cmake_modules/KuduLinker.cmake
+++ b/cmake_modules/KuduLinker.cmake
@@ -84,7 +84,7 @@ function(APPEND_LINKER_FLAGS)
   endforeach()
 
   if(NOT DEFINED linker_flags)
-    message(SEND_ERROR "Could not find a suitable linker")
+    message(FATAL_ERROR "Could not find a suitable linker")
   endif()
   message(STATUS "Using linker flags: ${linker_flags}")
   foreach(var CMAKE_SHARED_LINKER_FLAGS CMAKE_EXE_LINKER_FLAGS 
CMAKE_MODULE_LINKER_FLAGS)
@@ -176,7 +176,5 @@ function(GET_LINKER_VERSION)
 
   if (LINKER_FOUND)
     message(STATUS "Found linker: ${LINKER_FAMILY} version ${LINKER_VERSION}")
-  else()
-    message(STATUS "Linker not found")
   endif()
 endfunction()

Reply via email to