File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,6 +43,16 @@ if(APPLE)
4343 message (STATUS "Homebrew installation found at ${HOMEBREW_PREFIX} " )
4444 set (CMAKE_PREFIX_PATH "${HOMEBREW_PREFIX} " )
4545 endif ()
46+
47+ # Apple's ranlib supports -no_warning_for_no_symbols; llvm-ranlib does not.
48+ # Check that we are using the system Apple ranlib before applying the flag.
49+ if (CMAKE_RANLIB MATCHES ".*/usr/bin/ranlib$" )
50+ # Suppress "has no symbols" warnings for static libraries.
51+ set (CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> -Scr <TARGET> <LINK_FLAGS> <OBJECTS>" )
52+ set (CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> -Scr <TARGET> <LINK_FLAGS> <OBJECTS>" )
53+ set (CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>" )
54+ set (CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>" )
55+ endif ()
4656endif ()
4757
4858message (STATUS "UNIX: Detected compiler: ${CMAKE_C_COMPILER} " )
You can’t perform that action at this time.
0 commit comments