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 "\\$<\\$<COMPILE_LANGUAGE:CXX>:([^>]*)>" "\\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
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