summaryrefslogtreecommitdiffstats
path: root/Source/cmAlgorithms.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-02-14 15:14:11 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-02-14 15:14:47 (GMT)
commit50ba2f019baa3e5487a975cb72059f1fc178f9d0 (patch)
treee75148951737edb1cc76eb532f1ee8583632b253 /Source/cmAlgorithms.h
parentfd74eba1402d66a4d6a1af3442cf219d02f7cbc8 (diff)
parent6fc33829443ea3ef2dc8cc71c0a98b635bec6179 (diff)
downloadCMake-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.h8
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()) {