[Bf-blender-cvs] [b87d87b1d3c] master: macOS: fix llvm-ranlib invalid option error

Ankit Meel noreply at git.blender.org
Sun Jan 16 07:20:12 CET 2022


Commit: b87d87b1d3c8400e4ee4ea3f0763df64c8ca7fc0
Author: Ankit Meel
Date:   Sun Jan 16 11:47:55 2022 +0530
Branches: master
https://developer.blender.org/rBb87d87b1d3c8400e4ee4ea3f0763df64c8ca7fc0

macOS: fix llvm-ranlib invalid option error

===================================================================

M	build_files/cmake/platform/platform_apple.cmake

===================================================================

diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake
index bf517f8fde9..447645b6806 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -480,8 +480,11 @@ string(APPEND PLATFORM_LINKFLAGS " -stdlib=libc++")
 # Suppress ranlib "has no symbols" warnings (workaround for T48250)
 set(CMAKE_C_ARCHIVE_CREATE   "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
 set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
-set(CMAKE_C_ARCHIVE_FINISH   "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
-set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
+# llvm-ranlib doesn't support this flag. Xcode's libtool does.
+if(NOT ${CMAKE_RANLIB} MATCHES ".*llvm-ranlib$")
+  set(CMAKE_C_ARCHIVE_FINISH   "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
+  set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
+endif()
 
 if(WITH_COMPILER_CCACHE)
   if(NOT CMAKE_GENERATOR STREQUAL "Xcode")



More information about the Bf-blender-cvs mailing list