diff options
author | Brad King <brad.king@kitware.com> | 2023-06-05 10:42:22 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-06-05 10:42:37 (GMT) |
commit | da6bb1621d23c634b117351440e59b9f6118d5eb (patch) | |
tree | 3ed9cc636c1f465c9e91f12bdeb10f43287bfae2 | |
parent | bcbf4155850f5af5d9998f335a637bd88c2e4568 (diff) | |
parent | f4d28d9e27dffca0388d4e7d87963ecc6d77d6e2 (diff) | |
download | CMake-da6bb1621d23c634b117351440e59b9f6118d5eb.zip CMake-da6bb1621d23c634b117351440e59b9f6118d5eb.tar.gz CMake-da6bb1621d23c634b117351440e59b9f6118d5eb.tar.bz2 |
Merge topic 'hip-usr-include'
f4d28d9e27 HIP: Fix implicit include directory detection under /usr/include
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8534
-rw-r--r-- | Source/cmLocalGenerator.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 63b2043..7ad4023 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1201,6 +1201,17 @@ std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectoriesImplicit( for (size_t i = impDirVecOldSize; i < impDirVec.size(); ++i) { cmSystemTools::ConvertToUnixSlashes(impDirVec[i]); } + + // The CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES are computed using + // try_compile in CMAKE_DETERMINE_COMPILER_ABI, but the implicit include + // directories are not known during that try_compile. This can be a + // problem when the HIP runtime include path is /usr/include because the + // runtime include path is always added to the userDirs and the compiler + // includes standard library headers via "__clang_hip_runtime_wrapper.h". + if (lang == "HIP" && impDirVec.size() == impDirVecOldSize && + !cm::contains(impDirVec, "/usr/include")) { + implicitExclude.emplace("/usr/include"); + } } // The Platform/UnixPaths module used to hard-code /usr/include for C, CXX, |