From: Daniel Arndt Date: Thu, 17 Nov 2022 14:05:54 +0000 (+0000) Subject: Only pass Kokkos flags X-Git-Tag: v9.5.0-rc1~828^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F14435%2Fhead;p=dealii.git Only pass Kokkos flags --- diff --git a/cmake/modules/FindTRILINOS.cmake b/cmake/modules/FindTRILINOS.cmake index 263ce6d153..940ae1d6ba 100644 --- a/cmake/modules/FindTRILINOS.cmake +++ b/cmake/modules/FindTRILINOS.cmake @@ -128,11 +128,11 @@ STRING(REGEX REPLACE REMOVE_DUPLICATES(Trilinos_TPL_INCLUDE_DIRS) -# -# Remove optimization flags like -03 and -DNDEBUG, we handle those elsewhere. -# -STRING(REGEX REPLACE "-O[^ ]*" "" TRILINOS_CXX_FLAGS_SANITIZED "${Trilinos_CXX_COMPILER_FLAGS}") -STRING(REGEX REPLACE "-DNDEBUG" "" TRILINOS_CXX_FLAGS_SANITIZED "${TRILINOS_CXX_FLAGS_SANITIZED}") +IF(TARGET Kokkos::kokkos) + GET_PROPERTY(KOKKOS_COMPILE_FLAGS_FULL TARGET Kokkos::kokkos PROPERTY INTERFACE_COMPILE_OPTIONS) + STRING(REGEX REPLACE "\\$<\\$:([^>]*)>" "\\1" KOKKOS_COMPILE_FLAGS "${KOKKOS_COMPILE_FLAGS_FULL}") + STRING(REPLACE ";" " " KOKKOS_COMPILE_FLAGS "${KOKKOS_COMPILE_FLAGS}") +ENDIF() # # We'd like to have the full library names but the Trilinos package only @@ -166,7 +166,7 @@ DEAL_II_PACKAGE_HANDLE(TRILINOS REQUIRED Trilinos_INCLUDE_DIRS OPTIONAL Trilinos_TPL_INCLUDE_DIRS CXX_FLAGS - OPTIONAL TRILINOS_CXX_FLAGS_SANITIZED + OPTIONAL KOKKOS_COMPILE_FLAGS LINKER_FLAGS OPTIONAL Trilinos_EXTRA_LD_FLAGS CLEAR