[llvm] 05a165b - [llvm/cmake/config-ix.cmake] If `LD64_EXECUTABLE` is already set, avoid the need to look up `ld64`
Argyrios Kyrtzidis via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 5 21:01:30 PDT 2022
Author: Argyrios Kyrtzidis
Date: 2022-11-05T20:58:41-07:00
New Revision: 05a165bf0434e135c6a853731f92669b4b7fda98
URL: https://github.com/llvm/llvm-project/commit/05a165bf0434e135c6a853731f92669b4b7fda98
DIFF: https://github.com/llvm/llvm-project/commit/05a165bf0434e135c6a853731f92669b4b7fda98.diff
LOG: [llvm/cmake/config-ix.cmake] If `LD64_EXECUTABLE` is already set, avoid the need to look up `ld64`
This provides option to set the `LD64_EXECUTABLE` variable to a path at CMake configure time directly.
Added:
Modified:
llvm/cmake/config-ix.cmake
Removed:
################################################################################
diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
index 74ffaf7bfdec7..ba85da6a8c3d0 100644
--- a/llvm/cmake/config-ix.cmake
+++ b/llvm/cmake/config-ix.cmake
@@ -622,15 +622,17 @@ if(CMAKE_GENERATOR MATCHES "Ninja" AND
endif()
if(CMAKE_HOST_APPLE AND APPLE)
- if(NOT CMAKE_XCRUN)
- find_program(CMAKE_XCRUN NAMES xcrun)
- endif()
- if(CMAKE_XCRUN)
- execute_process(COMMAND ${CMAKE_XCRUN} -find ld
- OUTPUT_VARIABLE LD64_EXECUTABLE
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- else()
- find_program(LD64_EXECUTABLE NAMES ld DOC "The ld64 linker")
+ if(NOT LD64_EXECUTABLE)
+ if(NOT CMAKE_XCRUN)
+ find_program(CMAKE_XCRUN NAMES xcrun)
+ endif()
+ if(CMAKE_XCRUN)
+ execute_process(COMMAND ${CMAKE_XCRUN} -find ld
+ OUTPUT_VARIABLE LD64_EXECUTABLE
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ else()
+ find_program(LD64_EXECUTABLE NAMES ld DOC "The ld64 linker")
+ endif()
endif()
if(LD64_EXECUTABLE)
More information about the llvm-commits
mailing list