Skip to content

Comments

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

Open
MarkSchofield wants to merge 1 commit intomainfrom
mschofie/standard-link-directories
Open

Use 'CMAKE_<LANG>_STANDARD_LINK_DIRECTORIES' if available#127
MarkSchofield wants to merge 1 commit intomainfrom
mschofie/standard-link-directories

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 :/

@MarkSchofield MarkSchofield force-pushed the mschofie/standard-link-directories branch from db39aaf to 4c36cb5 Compare November 8, 2025 21:43
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