diff options
author | Brad King <brad.king@kitware.com> | 2019-02-14 15:14:11 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-02-14 15:14:47 (GMT) |
commit | 50ba2f019baa3e5487a975cb72059f1fc178f9d0 (patch) | |
tree | e75148951737edb1cc76eb532f1ee8583632b253 /Source/cmAlgorithms.h | |
parent | fd74eba1402d66a4d6a1af3442cf219d02f7cbc8 (diff) | |
parent | 6fc33829443ea3ef2dc8cc71c0a98b635bec6179 (diff) | |
download | CMake-50ba2f019baa3e5487a975cb72059f1fc178f9d0.zip CMake-50ba2f019baa3e5487a975cb72059f1fc178f9d0.tar.gz CMake-50ba2f019baa3e5487a975cb72059f1fc178f9d0.tar.bz2 |
Merge topic 'fix-legacy-implicit-includes'
6fc3382944 Update logic for sysroot in detected implicit include directories
2ad14ef4ea cmAlgorithms: Add cmHasPrefix to match existing cmHasSuffix
557b2d6e65 Fix regression in -I/usr/include exclusion logic
017598a444 macOS: Fix addition of <sdk>/usr/include to default implicit include dirs
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2957
Diffstat (limited to 'Source/cmAlgorithms.h')
-rw-r--r-- | Source/cmAlgorithms.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h index 30328c6..1c4160b 100644 --- a/Source/cmAlgorithms.h +++ b/Source/cmAlgorithms.h @@ -348,6 +348,14 @@ std::reverse_iterator<Iter> cmMakeReverseIterator(Iter it) return std::reverse_iterator<Iter>(it); } +inline bool cmHasPrefix(std::string const& str, std::string const& prefix) +{ + if (str.size() < prefix.size()) { + return false; + } + return str.compare(0, prefix.size(), prefix) == 0; +} + inline bool cmHasSuffix(const std::string& str, const std::string& suffix) { if (str.size() < suffix.size()) { |