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

Use 'CMAKE_<LANG>_STANDARD_LINK_DIRECTORIES' if available #127

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MarkSchofield
Copy link
Owner

Fixes #112.

As called out in #112, CMake toolchains shouldn't use link_directories and include_directories - discussed in the thread 'cross compile - adding standard link directories in a toolchain file' on the CMake forums.

Issue #67 called out that include_directories are bad, and those occurrences were fixed with #69. Removing link_directories needs support for CMAKE_<LANG>_STANDARD_LINK_DIRECTORIES, and that first shipped in CMake 3.31. This change checks to see if CMake is 3.31 or higher, and if so prefers CMAKE_<LANG>_STANDARD_LINK_DIRECTORIES over link_directories.

@MarkSchofield
Copy link
Owner Author

Hmm... My CUDA builds failed because they fail to find kernel32. I tried setting 'CMAKE_CUDA_STANDARD_LINK_DIRECTORIES', too, but that didn't help :/

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

Successfully merging this pull request may close these issues.

link_directories and include_directories should not be called by toolchain
1 participant