diff options
author | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2019-05-14 13:16:11 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-05-15 14:20:05 (GMT) |
commit | 23e8364aedcbeb7ce606b6075c98827e52f0c7f6 (patch) | |
tree | 66d765b7cc87c36b24efa83b4749ee0959863666 /Source/cmCoreTryCompile.cxx | |
parent | e2d0aea2c734c8c5028f3573082e75bd157dbe72 (diff) | |
download | CMake-23e8364aedcbeb7ce606b6075c98827e52f0c7f6.zip CMake-23e8364aedcbeb7ce606b6075c98827e52f0c7f6.tar.gz CMake-23e8364aedcbeb7ce606b6075c98827e52f0c7f6.tar.bz2 |
Source: std::string related cleanup
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-rw-r--r-- | Source/cmCoreTryCompile.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 2f62db1..f12ef0b 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -122,8 +122,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, } } - const char* sourceDirectory = argv[2].c_str(); - const char* projectName = nullptr; + std::string sourceDirectory = argv[2]; + std::string projectName; std::string targetName; std::vector<std::string> cmakeFlags(1, "CMAKE_FLAGS"); // fake argv[0] std::vector<std::string> compileDefs; @@ -309,7 +309,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, doing = DoingNone; } else if (i == 3) { this->SrcFileSignature = false; - projectName = argv[i].c_str(); + projectName = argv[i]; } else if (i == 4 && !this->SrcFileSignature) { targetName = argv[i]; } else { @@ -480,7 +480,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, // we need to create a directory and CMakeLists file etc... // first create the directories - sourceDirectory = this->BinaryDirectory.c_str(); + sourceDirectory = this->BinaryDirectory; // now create a CMakeLists.txt file in that directory FILE* fout = cmsys::SystemTools::Fopen(outFileName, "w"); @@ -950,7 +950,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, << " '" << copyFile << "'\n"; /* clang-format on */ if (!this->FindErrorMessage.empty()) { - emsg << this->FindErrorMessage.c_str(); + emsg << this->FindErrorMessage; } if (copyFileError.empty()) { this->Makefile->IssueMessage(MessageType::FATAL_ERROR, emsg.str()); |