summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/bufr/cmakelists-apple-llvm-ranlib.patch
diff options
context:
space:
mode:
Diffstat (limited to 'var/spack/repos/builtin/packages/bufr/cmakelists-apple-llvm-ranlib.patch')
-rw-r--r--var/spack/repos/builtin/packages/bufr/cmakelists-apple-llvm-ranlib.patch15
1 files changed, 15 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/bufr/cmakelists-apple-llvm-ranlib.patch b/var/spack/repos/builtin/packages/bufr/cmakelists-apple-llvm-ranlib.patch
new file mode 100644
index 0000000000..8f2e363e58
--- /dev/null
+++ b/var/spack/repos/builtin/packages/bufr/cmakelists-apple-llvm-ranlib.patch
@@ -0,0 +1,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()