[PATCH] D137916: [cmake] Disable RTTI by default for tests
Trass3r via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 14 05:06:39 PST 2022
Trass3r updated this revision to Diff 475111.
Trass3r retitled this revision from "[cmake] Disable RTTI for tests" to "[cmake] Disable RTTI by default for tests".
Trass3r added a comment.
fix build error
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137916/new/
https://reviews.llvm.org/D137916
Files:
third-party/unittest/CMakeLists.txt
Index: third-party/unittest/CMakeLists.txt
===================================================================
--- third-party/unittest/CMakeLists.txt
+++ third-party/unittest/CMakeLists.txt
@@ -31,9 +31,6 @@
add_definitions("-Wno-covered-switch-default")
endif()
-set(LLVM_REQUIRES_RTTI 1)
-add_definitions( -DGTEST_HAS_RTTI=0 )
-
if (HAVE_LIBPTHREAD)
list(APPEND LIBS pthread)
endif()
@@ -60,6 +57,8 @@
set_target_properties(llvm_gtest PROPERTIES INTERFACE_COMPILE_OPTIONS "-Wno-suggest-override")
endif()
+target_compile_definitions(llvm_gtest PUBLIC GTEST_HAS_RTTI=0)
+
if (NOT LLVM_ENABLE_THREADS)
target_compile_definitions(llvm_gtest PUBLIC GTEST_HAS_PTHREAD=0)
endif ()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137916.475111.patch
Type: text/x-patch
Size: 700 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221114/1eb9cdf6/attachment.bin>
More information about the llvm-commits
mailing list