From 97e40925ae59f2ae3b0bb384364d36fedd55a7db Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Sat, 17 Feb 2024 19:19:20 +0000 Subject: [PATCH] [cmake] Kokkos always requires rtti. --- unittests/Kokkos/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/unittests/Kokkos/CMakeLists.txt b/unittests/Kokkos/CMakeLists.txt index 95f826bb0..be0250cf1 100644 --- a/unittests/Kokkos/CMakeLists.txt +++ b/unittests/Kokkos/CMakeLists.txt @@ -3,5 +3,14 @@ add_clad_unittest(KokkosTests main.cpp ) +# If llvm does not require rtti, kokkos does. +if (NOT (LLVM_REQUIRES_RTTI OR LLVM_ENABLE_RTTI)) + if (LLVM_COMPILER_IS_GCC_COMPATIBLE) + target_compile_options(KokkosTests PUBLIC -frtti) + elseif(MSVC) + target_compile_options(KokkosTests PUBLIC /GR) + endif() +endif() + target_link_libraries(KokkosTests PUBLIC ${Kokkos_LIBRARIES}) target_include_directories(KokkosTests SYSTEM PRIVATE ${Kokkos_INCLUDE_DIRS})