Skip to content

Fix regressions in legacy implicit include directories

Brad King requested to merge brad.king/cmake:fix-legacy-implicit-includes into master

Follow up !2716 (merged) with a few fixes:

  • The legacy exclusion of /usr/include should apply only to C, CXX, and CUDA, but not to Fortran.

  • The Platform/Darwin module needs to add <sdk>/usr/include to the initial default implicit include directories rather than unconditionally appending it. Platform/UnixPaths had a similar change for plain /usr/include in the original MR.

  • The detected value of CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES has paths that already include the sysroot prefix when using CMAKE_SYSROOT, so do not add another copy of the sysroot prefix on such paths.

Fixes: #18914 (closed)

Merge request reports