]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Only pass Kokkos flags 14435/head
authorDaniel Arndt <arndtd@ornl.gov>
Thu, 17 Nov 2022 14:05:54 +0000 (14:05 +0000)
committerDaniel Arndt <arndtd@ornl.gov>
Sat, 19 Nov 2022 00:57:09 +0000 (18:57 -0600)
cmake/modules/FindTRILINOS.cmake

index 263ce6d15313c1ee2c110548d63d0f1d11d21cbe..940ae1d6baf764a45a8836aa3e79a82d47e7ab27 100644 (file)
@@ -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 "\\$<\\$<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
@@ -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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.