Skip to content

Commit

Permalink
build: attempt to workaround linker issues on Darwin (#105) (#106)
Browse files Browse the repository at this point in the history
The use of a non-cctools librarian causes ld64 some heartburn.
Explicitly opt into using the cctools librarian.

rdar://87850031
(cherry picked from commit facc82f)

Co-authored-by: Saleem Abdulrasool <[email protected]>
  • Loading branch information
Lukasa and compnerd authored Feb 25, 2022
1 parent 3bea268 commit ddb07e8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<CMAKE_AR> crs <TARGET> <LINK_FLAGS> <OBJECTS>")
endif()

if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
find_package(dispatch CONFIG)
find_package(Foundation CONFIG)
Expand Down

0 comments on commit ddb07e8

Please sign in to comment.