Right now, c_interface_test is fully compiled and linked as part of the compile workflow. Since the only purpose of this test is to confirm that quda.h contains only "legal C code", there's no point in doing the full link. This dependency as it stands leads to link-time workarounds akin to what's in #1370 .
The more robust way to handle this is to use a try_compile command, as documented in https://cmake.org/cmake/help/v3.18/command/try_compile.html#try-compiling-source-files (or newer; cmake 3.25 in particular adds some nice debugging features on top of this apparently). This eliminates the need for workarounds, and in the case of the workaround above, eliminates a need to "bake in" a specific c++ library.
Right now,
c_interface_test
is fully compiled and linked as part of the compile workflow. Since the only purpose of this test is to confirm thatquda.h
contains only "legalC
code", there's no point in doing the full link. This dependency as it stands leads to link-time workarounds akin to what's in #1370 .The more robust way to handle this is to use a
try_compile
command, as documented in https://cmake.org/cmake/help/v3.18/command/try_compile.html#try-compiling-source-files (or newer; cmake 3.25 in particular adds some nice debugging features on top of this apparently). This eliminates the need for workarounds, and in the case of the workaround above, eliminates a need to "bake in" a specific c++ library.