Fix regressions in legacy implicit include directories
Follow up !2716 (merged) with a few fixes:
-
The legacy exclusion of
/usr/includeshould apply only toC,CXX, andCUDA, but not toFortran. -
The
Platform/Darwinmodule needs to add<sdk>/usr/includeto the initial default implicit include directories rather than unconditionally appending it.Platform/UnixPathshad a similar change for plain/usr/includein the original MR. -
The detected value of
CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIEShas paths that already include the sysroot prefix when usingCMAKE_SYSROOT, so do not add another copy of the sysroot prefix on such paths.
Fixes: #18914 (closed)