summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeLib
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-05-16 16:05:49 (GMT)
committerBrad King <brad.king@kitware.com>2011-05-16 16:05:49 (GMT)
commita7e7a04aafdcb91e13180f421df550418041d9bf (patch)
treeec13794e274b84a1394c731e1fb419bf8003f3e3 /Tests/CMakeLib
parentc9174c0e4b3605895ff15a2c4102dfdfec011c8c (diff)
downloadCMake-a7e7a04aafdcb91e13180f421df550418041d9bf.zip
CMake-a7e7a04aafdcb91e13180f421df550418041d9bf.tar.gz
CMake-a7e7a04aafdcb91e13180f421df550418041d9bf.tar.bz2
Fix run_compile_commands build on Apple GCC 3.3
This compiler does not provide the "at" method of std::map. Approximate it well enough for our needs.
Diffstat (limited to 'Tests/CMakeLib')
-rw-r--r--Tests/CMakeLib/run_compile_commands.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx
index c925167..31049d3 100644
--- a/Tests/CMakeLib/run_compile_commands.cxx
+++ b/Tests/CMakeLib/run_compile_commands.cxx
@@ -2,7 +2,19 @@
class CompileCommandParser {
public:
- typedef std::map<std::string, std::string> CommandType;
+ class CommandType: public std::map<cmStdString, cmStdString>
+ {
+ public:
+#if defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ < 4
+ cmStdString const& at(cmStdString const& k) const
+ {
+ const_iterator i = this->find(k);
+ if(i != this->end()) { return i->second; }
+ static cmStdString empty;
+ return empty;
+ }
+#endif
+ };
typedef std::vector<CommandType> TranslationUnitsType;
CompileCommandParser(std::ifstream *input)