diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2006-10-13 15:53:12 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2006-10-13 15:53:12 (GMT) |
commit | 5330a03994660ed59cf3f4b4cc4c2cf77999a59d (patch) | |
tree | d834a30e98f38a5f495fa7943c5fb58b7caae907 | |
parent | 5a0af031701f020462ee5781068eab6fe25976ea (diff) | |
download | CMake-5330a03994660ed59cf3f4b4cc4c2cf77999a59d.zip CMake-5330a03994660ed59cf3f4b4cc4c2cf77999a59d.tar.gz CMake-5330a03994660ed59cf3f4b4cc4c2cf77999a59d.tar.bz2 |
ENH: allow for -gdwarf-2 to be in cflags or cxxflags for xcode
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 319f460..1a21adb 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -866,17 +866,11 @@ std::string cmGlobalXCodeGenerator::ExtractFlag(const char* flag, std::string::size_type pos = flags.find(flag); if(pos != flags.npos) { - retFlag = flag; - // remove the flag - flags[pos]=' '; - flags[pos+1]=' '; - char pos2 = flags[pos+2]; - // if the pos after the option - if(pos2 != ' ' && pos2 != 0 ) + while(pos < flags.size() && flags[pos] != ' ') { - retFlag += pos2; - // remove the next part of the flag - flags[pos+2] = ' '; + retFlag += flags[pos]; + flags[pos] = ' '; + pos++; } } return retFlag; @@ -1392,7 +1386,19 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, optLevel[0] = '1'; } std::string gflagc = this->ExtractFlag("-g", cflags); + // put back gdwarf-2 if used since there is no way + // to represent it in the gui, but we still want debug yes + if(gflagc == "-gdwarf-2") + { + cflags += " "; + cflags += gflagc; + } std::string gflag = this->ExtractFlag("-g", flags); + if(gflag == "-gdwarf-2") + { + flags += " "; + flags += gflag; + } const char* debugStr = "YES"; if(gflagc.size() ==0 && gflag.size() == 0) { |