mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-30 18:29:37 -06:00
Restore implicit include directory extraction for adaptive relative paths
Update the logic added by commitef41d49812(Fix implicit include directory extraction for adaptive relative paths, 2019-04-08, v3.14.2~5^2) to account for the new `try_compile` work directory used for the ABI check since commit2edf0fc6d7(Modules: Use new keyword-dispatched try_compile signature, 2022-09-13, v3.25.0-rc1~144^2). Paths relative to the work directory will now have one more `../` in them, so update the test data to match. Fixes: #24279
This commit is contained in:
@@ -233,8 +233,9 @@ 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
|
||||
elseif("${d}" MATCHES [[^\.\.[\/]\.\.[\/]\.\.[\/](.*)$]])
|
||||
# This relative path is deep enough to get out of the
|
||||
# CMakeFiles/CMakeScratch/<unique>
|
||||
# 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.
|
||||
|
||||
@@ -16,8 +16,8 @@ This is a hand-written test case.
|
||||
#include "..." search starts here:
|
||||
#include <...> search starts here:
|
||||
/usr/local/include
|
||||
../../../adaptive/relative/include
|
||||
../../../../adaptive/relative/include
|
||||
/usr/include
|
||||
End of search list.
|
||||
|
||||
/usr/bin/ld -L/usr/lib64 -L../../../adaptive/relative/lib
|
||||
/usr/bin/ld -L/usr/lib64 -L../../../../adaptive/relative/lib
|
||||
|
||||
@@ -16,8 +16,8 @@ This is a hand-written test case.
|
||||
#include "..." search starts here:
|
||||
#include <...> search starts here:
|
||||
/usr/local/include
|
||||
../../../adaptive/relative/include
|
||||
../../../../adaptive/relative/include
|
||||
/usr/include
|
||||
End of search list.
|
||||
|
||||
/usr/bin/ld -L/usr/lib64 -L../../../adaptive/relative/lib
|
||||
/usr/bin/ld -L/usr/lib64 -L../../../../adaptive/relative/lib
|
||||
|
||||
Reference in New Issue
Block a user