From 5e804f9e89767fdc3b18efc335eb699b70d0747d Mon Sep 17 00:00:00 2001 From: Shoaib Meenai Date: Thu, 20 Aug 2020 19:50:09 -0700 Subject: [PATCH] [cmake] Don't use ld.lld when targeting Darwin ld.lld is an ELF linker. We can switch to the new LLD for Mach-O port when it's more complete, but for now, assume the user will have set CMAKE_LINKER correctly themselves when targeting Darwin. --- cmake/modules/LLVMExternalProjectUtils.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/LLVMExternalProjectUtils.cmake b/cmake/modules/LLVMExternalProjectUtils.cmake index 706a1ffb5c7..0aeaf663ad1 100644 --- a/cmake/modules/LLVMExternalProjectUtils.cmake +++ b/cmake/modules/LLVMExternalProjectUtils.cmake @@ -137,7 +137,7 @@ function(llvm_ExternalProject_Add name source_dir) if(lld IN_LIST TOOLCHAIN_TOOLS) if(_cmake_system_name STREQUAL Windows) list(APPEND compiler_args -DCMAKE_LINKER=${LLVM_RUNTIME_OUTPUT_INTDIR}/lld-link${CMAKE_EXECUTABLE_SUFFIX}) - else() + elseif(NOT _cmake_system_name STREQUAL Darwin) list(APPEND compiler_args -DCMAKE_LINKER=${LLVM_RUNTIME_OUTPUT_INTDIR}/ld.lld${CMAKE_EXECUTABLE_SUFFIX}) endif() endif()