summaryrefslogblamecommitdiff
path: root/var/spack/repos/builtin/packages/bufr/cmakelists-apple-llvm-ranlib.patch
blob: 8f2e363e58d735668183ff3a367be3d44f4bc8fc (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                                                     
--- a/CMakeLists.txt	2022-02-08 10:03:55.000000000 -0700
+++ b/CMakeLists.txt	2022-02-08 10:03:51.000000000 -0700
@@ -39,9 +39,9 @@
   find_package(Python3 REQUIRED COMPONENTS Interpreter)
 endif()
 
-if(APPLE)
-  # The linker on macOS does not include `common symbols` by default
-  # Passing the -c flag includes them and fixes an error with undefined symbols
+if(APPLE AND NOT "${CMAKE_RANLIB}" MATCHES "^.*(llvm-ranlib)$")
+  # The linker on macOS does not include `common symbols` by default, Intel requires
+  # passing the -c flag to include them and fix an error with undefined symbols
   set(CMAKE_Fortran_ARCHIVE_FINISH "<CMAKE_RANLIB> -c <TARGET>")
   set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -c <TARGET>")
 endif()