diff options
author | Brad King <brad.king@kitware.com> | 2015-08-21 17:42:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-08-21 19:21:37 (GMT) |
commit | a4bd30104fe6df3e4a6a37d0abb640a28126009d (patch) | |
tree | edcdb3e712d43718eb16b9f2b8fdeb5a556a9f2f /Source/cmState.cxx | |
parent | 86bb2ce75793ff12905596edc83ecabf2bce22df (diff) | |
download | CMake-a4bd30104fe6df3e4a6a37d0abb640a28126009d.zip CMake-a4bd30104fe6df3e4a6a37d0abb640a28126009d.tar.gz CMake-a4bd30104fe6df3e4a6a37d0abb640a28126009d.tar.bz2 |
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.
Diffstat (limited to 'Source/cmState.cxx')
-rw-r--r-- | Source/cmState.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx index f425861..4ad6d3b 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -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 = |