Skip to content

[stable/20220421][llvm/cmake/config-ix.cmake] If LD64_EXECUTABLE is already set, avoid the need to look up ld64 #5569

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions llvm/cmake/config-ix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -615,15 +615,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)
Expand Down