Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CMakeLists.txt in the test directory to only try_compile c_interface_test #1371

Open
weinbe2 opened this issue Apr 5, 2023 · 1 comment
Assignees
Labels

Comments

@weinbe2
Copy link
Contributor

weinbe2 commented Apr 5, 2023

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.

@mathiaswagner
Copy link
Member

Maybe we should check https://cmake.org/cmake/help/latest/prop_tgt/LINKER_LANGUAGE.html instead of using the WAR in #1370.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants