[llvm] 6c9f207 - [cmake] Surpress cmake warning on that EH requires RTTI. NFC.

Michael Liao via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 27 09:55:56 PDT 2021


Author: Michael Liao
Date: 2021-10-27T12:55:45-04:00
New Revision: 6c9f207826ef981062b601049dd6ba535db87d53

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

LOG: [cmake] Surpress cmake warning on that EH requires RTTI. NFC.

- Both LLVM_REQUIRES_RTTI and LLVM_REQUIRES_EH are internal flags that
  individual targets can use to force RTTI/EH. Turning off
  LLVM_REQUIRES_RTTI should honor if that variable is set explicitly for
  an individual target.

Added: 
    

Modified: 
    llvm/cmake/modules/AddLLVM.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 6e1f97a8bbc06..695f8bef07dd6 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -1469,7 +1469,9 @@ function(add_unittest test_suite test_name)
     list(APPEND LLVM_COMPILE_FLAGS "-Wno-gnu-zero-variadic-macro-arguments")
   endif()
 
-  set(LLVM_REQUIRES_RTTI OFF)
+  if (NOT DEFINED LLVM_REQUIRES_RTTI)
+    set(LLVM_REQUIRES_RTTI OFF)
+  endif()
 
   list(APPEND LLVM_LINK_COMPONENTS Support) # gtest needs it for raw_ostream
   add_llvm_executable(${test_name} IGNORE_EXTERNALIZE_DEBUGINFO NO_INSTALL_RPATH ${ARGN})


        


More information about the llvm-commits mailing list