summaryrefslogtreecommitdiffstats
path: root/Source/cmCoreTryCompile.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-02-12 19:53:43 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-02-20 20:26:18 (GMT)
commita281809384cc19cc9a7d1726b243020b380b9395 (patch)
tree6fdf2de4e88230d0425acf06a8b459b0177ef978 /Source/cmCoreTryCompile.cxx
parent76207b0861478318115d65c2e983f4d88c937724 (diff)
downloadCMake-a281809384cc19cc9a7d1726b243020b380b9395.zip
CMake-a281809384cc19cc9a7d1726b243020b380b9395.tar.gz
CMake-a281809384cc19cc9a7d1726b243020b380b9395.tar.bz2
Use cmJoin where possible.
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-rw-r--r--Source/cmCoreTryCompile.cxx15
1 files changed, 3 insertions, 12 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 8e20c14..bcd2d81 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -260,14 +260,10 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
err << "Unknown extension \"" << ext << "\" for file\n"
<< " " << *si << "\n"
<< "try_compile() works only for enabled languages. "
- << "Currently these are:\n ";
+ << "Currently these are:\n ";
std::vector<std::string> langs;
gg->GetEnabledLanguages(langs);
- for(std::vector<std::string>::iterator l = langs.begin();
- l != langs.end(); ++l)
- {
- err << " " << *l;
- }
+ err << cmJoin(langs, " ");
err << "\nSee project() command to enable other languages.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, err.str());
return -1;
@@ -373,12 +369,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
// handle any compile flags we need to pass on
if (!compileDefs.empty())
{
- fprintf(fout, "add_definitions( ");
- for (size_t i = 0; i < compileDefs.size(); ++i)
- {
- fprintf(fout,"%s ",compileDefs[i].c_str());
- }
- fprintf(fout, ")\n");
+ fprintf(fout, "add_definitions(%s)\n", cmJoin(compileDefs, " ").c_str());
}
/* Use a random file name to avoid rapid creation and deletion