mirror of
https://github.com/reactos/CMake.git
synced 2024-11-27 21:41:03 +00:00
include_directories: Fix regression in BEFORE option (#15693)
Refactoring in commit 6ed9c7e0
(cmState: Host buildsystem properties for
directories, 2015-07-18) broke include_directories(BEFORE). Fix it and
add a test case.
This commit is contained in:
parent
86bb2ce757
commit
a4bd30104f
@ -1296,22 +1296,21 @@ void cmState::Directory::PrependIncludeDirectoriesEntry(
|
||||
this->DirectoryState->IncludeDirectories.begin()
|
||||
+ this->Snapshot_.Position->IncludeDirectoryPosition;
|
||||
|
||||
std::vector<std::string>::const_reverse_iterator rend =
|
||||
std::vector<std::string>::reverse_iterator rend =
|
||||
this->DirectoryState->IncludeDirectories.rend();
|
||||
std::vector<std::string>::reverse_iterator rbegin =
|
||||
cmMakeReverseIterator(entryEnd);
|
||||
std::vector<std::string>::const_reverse_iterator crbegin = rbegin;
|
||||
crbegin = std::find(crbegin, rend, cmPropertySentinal);
|
||||
rbegin = std::find(rbegin, rend, cmPropertySentinal);
|
||||
|
||||
std::vector<std::string>::const_iterator entryIt = crbegin.base();
|
||||
std::vector<std::string>::const_iterator entryBegin =
|
||||
std::vector<std::string>::iterator entryIt = rbegin.base();
|
||||
std::vector<std::string>::iterator entryBegin =
|
||||
this->DirectoryState->IncludeDirectories.begin();
|
||||
|
||||
std::vector<cmListFileBacktrace>::iterator btIt =
|
||||
this->DirectoryState->IncludeDirectoryBacktraces.begin()
|
||||
+ std::distance(entryBegin, entryIt);
|
||||
|
||||
this->DirectoryState->IncludeDirectories.insert(rbegin.base(), vec);
|
||||
this->DirectoryState->IncludeDirectories.insert(entryIt, vec);
|
||||
this->DirectoryState->IncludeDirectoryBacktraces.insert(btIt, lfbt);
|
||||
|
||||
this->Snapshot_.Position->IncludeDirectoryPosition =
|
||||
|
@ -0,0 +1 @@
|
||||
-- INCLUDE_DIRECTORIES: '[^;]*/Tests/RunCMake/include_directories/BeforeDir;[^;]*/Tests/RunCMake/include_directories/AfterDir'
|
4
Tests/RunCMake/include_directories/DirectoryBefore.cmake
Normal file
4
Tests/RunCMake/include_directories/DirectoryBefore.cmake
Normal file
@ -0,0 +1,4 @@
|
||||
include_directories(AfterDir)
|
||||
include_directories(BEFORE BeforeDir)
|
||||
get_property(dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
|
||||
message(STATUS "INCLUDE_DIRECTORIES: '${dirs}'")
|
@ -5,6 +5,7 @@ set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/NotDefa
|
||||
|
||||
run_cmake(NotFoundContent)
|
||||
run_cmake(DebugIncludes)
|
||||
run_cmake(DirectoryBefore)
|
||||
run_cmake(TID-bad-target)
|
||||
run_cmake(ImportedTarget)
|
||||
run_cmake(CMP0021)
|
||||
|
Loading…
Reference in New Issue
Block a user