[llvm] r311949 - Fix cmake check for futimens when deploying to earlier macOS releases.

Juergen Ributzka via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 28 16:04:39 PDT 2017


Author: ributzka
Date: Mon Aug 28 16:04:38 2017
New Revision: 311949

URL: http://llvm.org/viewvc/llvm-project?rev=311949&view=rev
Log:
Fix cmake check for futimens when deploying to earlier macOS releases.

macOS 10.13 added a new API (futimens). This API is only available on macOS 10.13
and later, but the cmake check we have in place only tests if the symbol is
present and ignores the availability attribute. Luckily we have new warning for
this and by making this warning an error the cmake check will return the correct
result.

See also rdar://problem/33992750.

Differential Revision: https://reviews.llvm.org/D37027

Modified:
    llvm/trunk/cmake/config-ix.cmake
    llvm/trunk/cmake/modules/HandleLLVMOptions.cmake

Modified: llvm/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/config-ix.cmake?rev=311949&r1=311948&r2=311949&view=diff
==============================================================================
--- llvm/trunk/cmake/config-ix.cmake (original)
+++ llvm/trunk/cmake/config-ix.cmake Mon Aug 28 16:04:38 2017
@@ -13,6 +13,7 @@ include(TestBigEndian)
 
 include(CheckCompilerVersion)
 include(HandleLLVMStdlib)
+include(HandleLLVMOptions)
 
 if( UNIX AND NOT (BEOS OR HAIKU) )
   # Used by check_symbol_exists:

Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=311949&r1=311948&r2=311949&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
+++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Mon Aug 28 16:04:38 2017
@@ -383,6 +383,7 @@ elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE
   append_if(LLVM_ENABLE_WERROR "-Werror" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
   append_if(LLVM_ENABLE_WERROR "-Wno-error" CMAKE_REQUIRED_FLAGS)
   add_flag_if_supported("-Werror=date-time" WERROR_DATE_TIME)
+  add_flag_if_supported("-Werror=unguarded-availability-new" WERROR_UNGUARDED_AVAILABILITY_NEW)
   if (LLVM_ENABLE_CXX1Y)
     check_cxx_compiler_flag("-std=c++1y" CXX_SUPPORTS_CXX1Y)
     append_if(CXX_SUPPORTS_CXX1Y "-std=c++1y" CMAKE_CXX_FLAGS)




More information about the llvm-commits mailing list