summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeParseImplicitIncludeInfo.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-04-08 14:16:14 (GMT)
committerBrad King <brad.king@kitware.com>2019-04-08 14:16:47 (GMT)
commit442f4c49026f4fb0d8eaa7f9d004cedff42bf9bb (patch)
treef3644c102542d3c76bc3f9b15ed4cb5ad7369ab2 /Modules/CMakeParseImplicitIncludeInfo.cmake
parent7e60e77c3c2a09eb11750616db50d2dc149a9c54 (diff)
parentef41d49812f90f3d2a6edcae282a30b545df7f6d (diff)
downloadCMake-442f4c49026f4fb0d8eaa7f9d004cedff42bf9bb.zip
CMake-442f4c49026f4fb0d8eaa7f9d004cedff42bf9bb.tar.gz
CMake-442f4c49026f4fb0d8eaa7f9d004cedff42bf9bb.tar.bz2
Merge branch 'backport-implicit-includes-relative'
Diffstat (limited to 'Modules/CMakeParseImplicitIncludeInfo.cmake')
-rw-r--r--Modules/CMakeParseImplicitIncludeInfo.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/CMakeParseImplicitIncludeInfo.cmake b/Modules/CMakeParseImplicitIncludeInfo.cmake
index 977debb..176b3ff 100644
--- a/Modules/CMakeParseImplicitIncludeInfo.cmake
+++ b/Modules/CMakeParseImplicitIncludeInfo.cmake
@@ -218,6 +218,14 @@ function(cmake_parse_implicit_include_info text lang dir_var log_var state_var)
get_filename_component(dir "${d}" ABSOLUTE)
list(APPEND implicit_dirs "${dir}")
string(APPEND log " collapse include dir [${d}] ==> [${dir}]\n")
+ elseif("${d}" MATCHES [[^\.\.[\/]\.\.[\/](.*)$]])
+ # This relative path is deep enough to get out of the CMakeFiles/CMakeTmp
+ # directory where the ABI check is done. Assume that the compiler has
+ # computed this path adaptively based on the current working directory
+ # such that the effective result is absolute.
+ get_filename_component(dir "${CMAKE_BINARY_DIR}/${CMAKE_MATCH_1}" ABSOLUTE)
+ list(APPEND implicit_dirs "${dir}")
+ string(APPEND log " collapse relative include dir [${d}] ==> [${dir}]\n")
else()
string(APPEND log " skipping relative include dir [${d}]\n")
endif()