Fix regressions in legacy implicit include directories
Follow up !2716 (merged) with a few fixes:
-
The legacy exclusion of
/usr/include
should apply only toC
,CXX
, andCUDA
, but not toFortran
. -
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 usingCMAKE_SYSROOT
, so do not add another copy of the sysroot prefix on such paths.
Fixes: #18914 (closed)