diff options
author | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2018-01-31 15:20:02 (GMT) |
---|---|---|
committer | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2018-01-31 15:23:03 (GMT) |
commit | 653b894683abe63233cb8679b34ea39d9017e317 (patch) | |
tree | 200e5066b754d8ddfdc7beb86c4db179aa2e69d0 /Source/cmComputeLinkInformation.cxx | |
parent | 4499cc8bb65e217e1cb2959452ed391af82e757b (diff) | |
download | CMake-653b894683abe63233cb8679b34ea39d9017e317.zip CMake-653b894683abe63233cb8679b34ea39d9017e317.tar.gz CMake-653b894683abe63233cb8679b34ea39d9017e317.tar.bz2 |
Reduce raw string pointers usage.
* Change some functions to take `std::string` instead of
`const char*` in the following classes: `cmMakeFile`, `cmake`,
`cmCoreTryCompile`, `cmSystemTools`, `cmState`, `cmLocalGenerator`
and a few others.
* Greatly reduce using of `const char*` overloads for
`cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`.
* Remove many redundant `c_str()` conversions throughout the code.
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 33dd2d7..8a5a6de 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -632,7 +632,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item, } } else { // This is not a CMake target. Use the name given. - if (cmSystemTools::FileIsFullPath(item.c_str())) { + if (cmSystemTools::FileIsFullPath(item)) { if (cmSystemTools::FileIsDirectory(item)) { // This is a directory. this->AddDirectoryItem(item); @@ -668,13 +668,13 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item, } else { // Skip items that are not full paths. We will not be able to // reliably specify them. - if (!cmSystemTools::FileIsFullPath(item.c_str())) { + if (!cmSystemTools::FileIsFullPath(item)) { return; } // Get the name of the library from the file name. std::string file = cmSystemTools::GetFilenameName(item); - if (!this->ExtractSharedLibraryName.find(file.c_str())) { + if (!this->ExtractSharedLibraryName.find(file)) { // This is not the name of a shared library. return; } @@ -1746,8 +1746,9 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs, } } else if (use_link_rpath) { // Do not add any path inside the source or build tree. - const char* topSourceDir = this->CMakeInstance->GetHomeDirectory(); - const char* topBinaryDir = + std::string const& topSourceDir = + this->CMakeInstance->GetHomeDirectory(); + std::string const& topBinaryDir = this->CMakeInstance->GetHomeOutputDirectory(); if (!cmSystemTools::ComparePath(ri, topSourceDir) && !cmSystemTools::ComparePath(ri, topBinaryDir) && |