[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.
This commit is contained in:
parent
0e18d5ed21
commit
05a165bf04
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue