eth-cscs / DLA-Future

DLA-Future
https://eth-cscs.github.io/DLA-Future/master/
BSD 3-Clause "New" or "Revised" License
64 stars 14 forks source link

Fix precompiled headers with C files #955

Closed msimberg closed 1 year ago

msimberg commented 1 year ago

Works around https://github.com/eth-cscs/DLA-Future/issues/950 with https://stackoverflow.com/questions/68735830/cmake-precompiled-headers-issue-with-mixed-c-c-project. Note that it's not enough to have a C header in the list of precompiled headers. The executable/library also has to have at least one C file for the .h precompiled header to be generated. In C-mode -Wpedantic also warns about an empty translation unit so I've added a dummy function declaration to the dummy.c file as well.