]> https://gitweb.dealii.org/ - dealii.git/commit
CMake: silence the CMAKE_CXX_EXTENSIONS warning when including Kokkos 14723/head
authorMatthias Maier <tamiko@43-1.org>
Wed, 25 Jan 2023 02:35:14 +0000 (20:35 -0600)
committerMatthias Maier <tamiko@43-1.org>
Wed, 25 Jan 2023 02:35:14 +0000 (20:35 -0600)
commit43e807f183e0c072a407b55371556c47fdc284bb
tree2523a2535603006786c80ddb431a6d047b7e63c3
parentbccb4bea7a2c664a5489b445c085c249055d84bb
CMake: silence the CMAKE_CXX_EXTENSIONS warning when including Kokkos

The CMAKE_CXX_EXTENSIONS variable controls whether CMake sets the
"CXX_EXTENSIONS" property for a target. If this property is set then
CMake ensures that gnu extensions are enabled by default by using
corresponding -std=gnu1X flags instead of -std=cxx1X flags.

Kokkos forcefully disables this variable as soon as FindKOKKOS.cmake is
included with a prominent warning. Thus simply set the variable prior to
including FindKOKKOS.cmake.

On a sidenote - Kokkos' workaround here is not really effective: We
currently do not use the CXX_STANDARD target property but set the
language standard by hand. Thus, the variable is simply ignored.

Also, even if a project happens to use the CMAKE_CXX_STANDARD variable,
this generally doesn't work as the project that includes
FindKOKKOS.cmake can simply override the variable later.
cmake/modules/FindDEAL_II_ARBORX.cmake
cmake/modules/FindDEAL_II_KOKKOS.cmake
cmake/modules/FindDEAL_II_TRILINOS.cmake

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.