From facc82fbb465e8e308ceeeeb2bdd2830ae8023b3 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Fri, 25 Feb 2022 09:46:28 -0800 Subject: [PATCH] build: attempt to workaround linker issues on Darwin (#105) The use of a non-cctools librarian causes ld64 some heartburn. Explicitly opt into using the cctools librarian. rdar://87850031 --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 881a872c..f0da9625 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,11 @@ if(BUILD_SHARED_LIBS) set(CMAKE_POSITION_INDEPENDENT_CODE YES) endif() +if(CMAKE_SYSTEM_NAME STREQUAL Darwin AND NOT CMAKE_CROSSCOMPILING) + set(CMAKE_AR "/usr/bin/ar") + set(CMAKE_C_ARCHIVE_CREATE " crs ") +endif() + if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) find_package(dispatch CONFIG) find_package(Foundation CONFIG)