[PATCH] D85362: [CMake] Print the autodetected host linker version
Petr Hosek via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 5 14:11:07 PDT 2020
phosek created this revision.
phosek added reviewers: smeenai, beanz.
Herald added subscribers: cfe-commits, mgorny.
Herald added a project: clang.
phosek requested review of this revision.
There's no easy way to find out what the autodetected version is, but
sometimes it may be useful to confirm that the right version is being
used. Print it as CMake status message.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D85362
Files:
clang/CMakeLists.txt
Index: clang/CMakeLists.txt
===================================================================
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -424,15 +424,15 @@
RESULT_VARIABLE HAD_ERROR
OUTPUT_VARIABLE LD_V_OUTPUT
)
- if (NOT HAD_ERROR)
- if ("${LD_V_OUTPUT}" MATCHES ".*ld64-([0-9.]+).*")
- string(REGEX REPLACE ".*ld64-([0-9.]+).*" "\\1" HOST_LINK_VERSION ${LD_V_OUTPUT})
- elseif ("${LD_V_OUTPUT}" MATCHES "[^0-9]*([0-9.]+).*")
- string(REGEX REPLACE "[^0-9]*([0-9.]+).*" "\\1" HOST_LINK_VERSION ${LD_V_OUTPUT})
- endif()
- else()
+ if (HAD_ERROR)
message(FATAL_ERROR "${CMAKE_LINKER} failed with status ${HAD_ERROR}")
endif()
+ if ("${LD_V_OUTPUT}" MATCHES ".*ld64-([0-9.]+).*")
+ string(REGEX REPLACE ".*ld64-([0-9.]+).*" "\\1" HOST_LINK_VERSION ${LD_V_OUTPUT})
+ elseif ("${LD_V_OUTPUT}" MATCHES "[^0-9]*([0-9.]+).*")
+ string(REGEX REPLACE "[^0-9]*([0-9.]+).*" "\\1" HOST_LINK_VERSION ${LD_V_OUTPUT})
+ endif()
+ message(STATUS "Host linker version: ${HOST_LINK_VERSION}")
endif()
include(CMakeParseArguments)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85362.283393.patch
Type: text/x-patch
Size: 1082 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200805/f2467a20/attachment.bin>
More information about the cfe-commits
mailing list