[llvm] d321548 - [llvm] Disable xar on macOS 12.0 and later

Jonas Devlieghere via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 29 15:31:33 PDT 2021


Author: Jonas Devlieghere
Date: 2021-10-29T15:31:14-07:00
New Revision: d321548c3ce987f4f21350ba1c81fdb5d4354224

URL: https://github.com/llvm/llvm-project/commit/d321548c3ce987f4f21350ba1c81fdb5d4354224
DIFF: https://github.com/llvm/llvm-project/commit/d321548c3ce987f4f21350ba1c81fdb5d4354224.diff

LOG: [llvm] Disable xar on macOS 12.0 and later

The xar file format has been deprecated since macOS 12.0, causing a
warning to be printed:

  warning: 'xar_open' is deprecated: first deprecated in macOS 12.0 -
  xar is a deprecated file format and should not be used.

Disable xar support when the macosx deployment target is greater or
equal to 12.0.

Differential revision: https://reviews.llvm.org/D112849

Added: 
    

Modified: 
    llvm/cmake/config-ix.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
index c81b7e47ac788..dd771ecee20b3 100644
--- a/llvm/cmake/config-ix.cmake
+++ b/llvm/cmake/config-ix.cmake
@@ -213,7 +213,13 @@ endif()
 
 check_library_exists(xar xar_open "" LLVM_HAVE_LIBXAR)
 if(LLVM_HAVE_LIBXAR)
-  set(XAR_LIB xar)
+  message(STATUS "The xar file format has been deprecated: LLVM_HAVE_LIBXAR might be removed in the future.")
+  # The xar file format has been deprecated since macOS 12.0.
+  if (CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 12)
+    set(LLVM_HAVE_LIBXAR 0)
+  else()
+    set(XAR_LIB xar)
+  endif()
 endif()
 
 # function checks


        


More information about the llvm-commits mailing list